[libcalamares] Store DBus reply value, drop debug-logging

This commit is contained in:
Adriaan de Groot 2021-02-03 00:46:00 +01:00
parent aae815cf3b
commit c98a330bf9

View file

@ -12,6 +12,8 @@
#include <QtDBus>
#include <optional>
namespace CalamaresUtils
{
namespace Partition
@ -58,13 +60,21 @@ querySolidAutoMount( QDBusConnection& dbus, AutoMountInfo& info )
// Find previous setting; this **does** need to block
auto msg = kdedCall( QStringLiteral( "isModuleAutoloaded" ) );
msg.setArguments( { moduleName } );
std::optional< bool > result;
QDBusMessage r = dbus.call( msg, QDBus::Block );
if ( r.type() == QDBusMessage::ReplyMessage )
{
auto arg = r.arguments();
cDebug() << arg;
info.wasSolidModuleAutoLoaded = false;
if ( arg.length() == 1 )
{
auto v = arg.at( 0 );
if ( v.isValid() && v.type() == QVariant::Bool )
{
result = v.toBool();
}
}
}
info.wasSolidModuleAutoLoaded = result.has_value() ? result.value() : false;
}
std::shared_ptr< AutoMountInfo >