mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
[libcalamares] Store DBus reply value, drop debug-logging
This commit is contained in:
parent
aae815cf3b
commit
c98a330bf9
1 changed files with 12 additions and 2 deletions
|
@ -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 >
|
||||
|
|
Loading…
Add table
Reference in a new issue