mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Prevent multiple connections between sender and receiver
Use a Qt::uniqueConnection so that only one connection exists between the sender and receiver. REVIEW: 119532
This commit is contained in:
parent
7299d007f2
commit
c654019eb9
|
@ -313,7 +313,8 @@ void PlacesItemModel::requestEject(int index)
|
||||||
Solid::OpticalDrive* drive = item->device().parent().as<Solid::OpticalDrive>();
|
Solid::OpticalDrive* drive = item->device().parent().as<Solid::OpticalDrive>();
|
||||||
if (drive) {
|
if (drive) {
|
||||||
connect(drive, SIGNAL(ejectDone(Solid::ErrorType,QVariant,QString)),
|
connect(drive, SIGNAL(ejectDone(Solid::ErrorType,QVariant,QString)),
|
||||||
this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)));
|
this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)),
|
||||||
|
Qt::UniqueConnection);
|
||||||
drive->eject();
|
drive->eject();
|
||||||
} else {
|
} else {
|
||||||
const QString label = item->text();
|
const QString label = item->text();
|
||||||
|
@ -330,7 +331,8 @@ void PlacesItemModel::requestTeardown(int index)
|
||||||
Solid::StorageAccess* access = item->device().as<Solid::StorageAccess>();
|
Solid::StorageAccess* access = item->device().as<Solid::StorageAccess>();
|
||||||
if (access) {
|
if (access) {
|
||||||
connect(access, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)),
|
connect(access, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)),
|
||||||
this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)));
|
this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)),
|
||||||
|
Qt::UniqueConnection);
|
||||||
access->teardown();
|
access->teardown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -359,7 +361,8 @@ void PlacesItemModel::requestStorageSetup(int index)
|
||||||
m_storageSetupInProgress[access] = index;
|
m_storageSetupInProgress[access] = index;
|
||||||
|
|
||||||
connect(access, SIGNAL(setupDone(Solid::ErrorType,QVariant,QString)),
|
connect(access, SIGNAL(setupDone(Solid::ErrorType,QVariant,QString)),
|
||||||
this, SLOT(slotStorageSetupDone(Solid::ErrorType,QVariant,QString)));
|
this, SLOT(slotStorageSetupDone(Solid::ErrorType,QVariant,QString)),
|
||||||
|
Qt::UniqueConnection);
|
||||||
|
|
||||||
access->setup();
|
access->setup();
|
||||||
}
|
}
|
||||||
|
@ -598,6 +601,7 @@ void PlacesItemModel::slotStorageSetupDone(Solid::ErrorType error,
|
||||||
{
|
{
|
||||||
Q_UNUSED(udi);
|
Q_UNUSED(udi);
|
||||||
|
|
||||||
|
Q_ASSERT(!m_storageSetupInProgress.isEmpty());
|
||||||
const int index = m_storageSetupInProgress.take(sender());
|
const int index = m_storageSetupInProgress.take(sender());
|
||||||
const PlacesItem* item = placesItem(index);
|
const PlacesItem* item = placesItem(index);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
|
|
Loading…
Reference in a new issue