From f0a33a235c1bf7d29fa2c08c8120acac8b88c6d0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 22 Dec 2020 21:23:50 +0100 Subject: [PATCH] [libcalamares] Make automountDisable() more flexible --- src/libcalamares/partition/AutoMount.cpp | 4 ++-- src/libcalamares/partition/AutoMount.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libcalamares/partition/AutoMount.cpp b/src/libcalamares/partition/AutoMount.cpp index 29fbfea5f..984662960 100644 --- a/src/libcalamares/partition/AutoMount.cpp +++ b/src/libcalamares/partition/AutoMount.cpp @@ -68,12 +68,12 @@ querySolidAutoMount( QDBusConnection& dbus, AutoMountInfo& info ) } std::unique_ptr< AutoMountInfo > -automountDisable() +automountDisable( bool disable ) { auto u = std::make_unique< AutoMountInfo >(); QDBusConnection dbus = QDBusConnection::sessionBus(); querySolidAutoMount( dbus, *u ); - enableSolidAutoMount( dbus, false ); + enableSolidAutoMount( dbus, !disable ); return u; } diff --git a/src/libcalamares/partition/AutoMount.h b/src/libcalamares/partition/AutoMount.h index ecb1780a0..b77bdbae6 100644 --- a/src/libcalamares/partition/AutoMount.h +++ b/src/libcalamares/partition/AutoMount.h @@ -30,10 +30,13 @@ struct AutoMountInfo; * steps (create table, create partition, set partition flags) which are * blocked if the partition gets mounted partway through the operation. * + * @param disable set this to false to reverse the sense of the function + * call and force *enabling* automount, instead. + * * Returns an opaque structure which can be passed to automountRestore() * to return the system to the previously-configured automount settings. */ -DLLEXPORT std::unique_ptr< AutoMountInfo > automountDisable(); +DLLEXPORT std::unique_ptr< AutoMountInfo > automountDisable( bool disable = true ); /** @brief Restore automount settings *