[libcalamares] Make automountDisable() more flexible

main
Adriaan de Groot 4 years ago
parent 9e6bddf31a
commit f0a33a235c

@ -68,12 +68,12 @@ querySolidAutoMount( QDBusConnection& dbus, AutoMountInfo& info )
} }
std::unique_ptr< AutoMountInfo > std::unique_ptr< AutoMountInfo >
automountDisable() automountDisable( bool disable )
{ {
auto u = std::make_unique< AutoMountInfo >(); auto u = std::make_unique< AutoMountInfo >();
QDBusConnection dbus = QDBusConnection::sessionBus(); QDBusConnection dbus = QDBusConnection::sessionBus();
querySolidAutoMount( dbus, *u ); querySolidAutoMount( dbus, *u );
enableSolidAutoMount( dbus, false ); enableSolidAutoMount( dbus, !disable );
return u; return u;
} }

@ -30,10 +30,13 @@ struct AutoMountInfo;
* steps (create table, create partition, set partition flags) which are * steps (create table, create partition, set partition flags) which are
* blocked if the partition gets mounted partway through the operation. * 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() * Returns an opaque structure which can be passed to automountRestore()
* to return the system to the previously-configured automount settings. * 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 /** @brief Restore automount settings
* *

Loading…
Cancel
Save