From 10bec1d97079d5ac0ebf80d2ad534fadc2146673 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 8 Feb 2021 15:05:24 +0100 Subject: [PATCH] [libcalamares] Expand API to allow clearing out the filesystem use --- src/libcalamares/partition/Global.cpp | 9 +++++++++ src/libcalamares/partition/Global.h | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/src/libcalamares/partition/Global.cpp b/src/libcalamares/partition/Global.cpp index fbe775f11..fb7b09aaf 100644 --- a/src/libcalamares/partition/Global.cpp +++ b/src/libcalamares/partition/Global.cpp @@ -45,3 +45,12 @@ CalamaresUtils::Partition::useFilesystemGS( Calamares::GlobalStorage* gs, const gs->insert( fsUse_key, existingMap ); } } + +void +CalamaresUtils::Partition::clearFilesystemGS( Calamares::GlobalStorage* gs ) +{ + if ( gs ) + { + gs->remove( fsUse_key ); + } +} diff --git a/src/libcalamares/partition/Global.h b/src/libcalamares/partition/Global.h index 960e302d0..733e2f69c 100644 --- a/src/libcalamares/partition/Global.h +++ b/src/libcalamares/partition/Global.h @@ -52,6 +52,12 @@ void DLLEXPORT useFilesystemGS( Calamares::GlobalStorage* gs, const QString& fil */ bool DLLEXPORT isFilesystemUsedGS( const Calamares::GlobalStorage* gs, const QString& filesystemType ); +/** @brief Clears the usage data for filesystems + * + * This removes the internal key *filesystem_use*. + */ +void DLLEXPORT clearFilesystemGS( Calamares::GlobalStorage* gs ); + /** @brief Convenience function for using "the" Global Storage * * @see useFilesystemGS(const QString&, bool)