[libcalamares] Make automountDisable() more flexible

This commit is contained in:
Adriaan de Groot 2020-12-22 21:23:50 +01:00
parent 9e6bddf31a
commit f0a33a235c
2 changed files with 6 additions and 3 deletions

View File

@ -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;
}

View File

@ -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
*