From 620b7d920879dc2f082690ab79a84df15db4003e Mon Sep 17 00:00:00 2001 From: Raine Makelainen Date: Mon, 27 May 2019 17:04:58 +0300 Subject: [PATCH] Move dbus watcher connect calls to one place --- src/udisks2block.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/udisks2block.cpp b/src/udisks2block.cpp index c6b5042..786fdf7 100644 --- a/src/udisks2block.cpp +++ b/src/udisks2block.cpp @@ -63,15 +63,7 @@ UDisks2::Block::Block(const QString &path, const UDisks2::InterfacePropertyMap & qCInfo(lcMemoryCardLog) << "Drive properties:" << driveProperties; m_drive = driveProperties; }); - - connect(m_pendingDrive.data(), &QObject::destroyed, this, &Block::complete); }); - - connect(m_pendingEncrypted.data(), &QObject::destroyed, this, &Block::complete); - connect(m_pendingFileSystem.data(), &QObject::destroyed, this, &Block::complete); - connect(m_pendingPartitionTable.data(), &QObject::destroyed, this, &Block::complete); - connect(m_pendingPartition.data(), &QObject::destroyed, this, &Block::complete); - connect(m_pendingBlock.data(), &QObject::destroyed, this, &Block::complete); } else { if (m_mountable) { QVariantMap map = interfacePropertyMap.value(UDISKS2_FILESYSTEM_INTERFACE); @@ -524,6 +516,8 @@ void UDisks2::Block::getProperties(const QString &path, const QString &interface m_connection); QDBusPendingCall pendingCall = dbusPropertyInterface.asyncCall(DBUS_GET_ALL, interface); watcherPointer = new QDBusPendingCallWatcher(pendingCall, this); + + connect(watcherPointer.data(), &QObject::destroyed, this, &Block::complete); connect(watcherPointer.data(), &QDBusPendingCallWatcher::finished, this, [success, path, interface](QDBusPendingCallWatcher *watcher) { if (watcher->isValid() && watcher->isFinished()) { QDBusPendingReply<> reply = *watcher;