Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Commit 620b7d9

Browse files
committed
Move dbus watcher connect calls to one place
1 parent 9daf6c5 commit 620b7d9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/udisks2block.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,7 @@ UDisks2::Block::Block(const QString &path, const UDisks2::InterfacePropertyMap &
6363
qCInfo(lcMemoryCardLog) << "Drive properties:" << driveProperties;
6464
m_drive = driveProperties;
6565
});
66-
67-
connect(m_pendingDrive.data(), &QObject::destroyed, this, &Block::complete);
6866
});
69-
70-
connect(m_pendingEncrypted.data(), &QObject::destroyed, this, &Block::complete);
71-
connect(m_pendingFileSystem.data(), &QObject::destroyed, this, &Block::complete);
72-
connect(m_pendingPartitionTable.data(), &QObject::destroyed, this, &Block::complete);
73-
connect(m_pendingPartition.data(), &QObject::destroyed, this, &Block::complete);
74-
connect(m_pendingBlock.data(), &QObject::destroyed, this, &Block::complete);
7567
} else {
7668
if (m_mountable) {
7769
QVariantMap map = interfacePropertyMap.value(UDISKS2_FILESYSTEM_INTERFACE);
@@ -524,6 +516,8 @@ void UDisks2::Block::getProperties(const QString &path, const QString &interface
524516
m_connection);
525517
QDBusPendingCall pendingCall = dbusPropertyInterface.asyncCall(DBUS_GET_ALL, interface);
526518
watcherPointer = new QDBusPendingCallWatcher(pendingCall, this);
519+
520+
connect(watcherPointer.data(), &QObject::destroyed, this, &Block::complete);
527521
connect(watcherPointer.data(), &QDBusPendingCallWatcher::finished, this, [success, path, interface](QDBusPendingCallWatcher *watcher) {
528522
if (watcher->isValid() && watcher->isFinished()) {
529523
QDBusPendingReply<> reply = *watcher;

0 commit comments

Comments
 (0)