mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-01 11:25:36 -04: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 <QtDBus>
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
namespace CalamaresUtils
|
namespace CalamaresUtils
|
||||||
{
|
{
|
||||||
namespace Partition
|
namespace Partition
|
||||||
|
@ -58,13 +60,21 @@ querySolidAutoMount( QDBusConnection& dbus, AutoMountInfo& info )
|
||||||
// Find previous setting; this **does** need to block
|
// Find previous setting; this **does** need to block
|
||||||
auto msg = kdedCall( QStringLiteral( "isModuleAutoloaded" ) );
|
auto msg = kdedCall( QStringLiteral( "isModuleAutoloaded" ) );
|
||||||
msg.setArguments( { moduleName } );
|
msg.setArguments( { moduleName } );
|
||||||
|
std::optional< bool > result;
|
||||||
QDBusMessage r = dbus.call( msg, QDBus::Block );
|
QDBusMessage r = dbus.call( msg, QDBus::Block );
|
||||||
if ( r.type() == QDBusMessage::ReplyMessage )
|
if ( r.type() == QDBusMessage::ReplyMessage )
|
||||||
{
|
{
|
||||||
auto arg = r.arguments();
|
auto arg = r.arguments();
|
||||||
cDebug() << arg;
|
if ( arg.length() == 1 )
|
||||||
info.wasSolidModuleAutoLoaded = false;
|
{
|
||||||
|
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 >
|
std::shared_ptr< AutoMountInfo >
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue