diff options
| author | Arjun AK <[email protected]> | 2014-07-30 18:26:39 +0530 |
|---|---|---|
| committer | Arjun AK <[email protected]> | 2014-07-30 18:26:39 +0530 |
| commit | c654019eb945b6b44b2243bb476912ef87a2c35e (patch) | |
| tree | 45ce3144aed3fe3288c98e0f97f5ca87b7c4b3c7 /src | |
| parent | 7299d007f2ba781785147d54696c0098b4f01022 (diff) | |
Prevent multiple connections between sender and receiver
Use a Qt::uniqueConnection so that only one connection exists between the sender and receiver.
REVIEW: 119532
Diffstat (limited to 'src')
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 1f05e07f9..dc2b95c36 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -313,7 +313,8 @@ void PlacesItemModel::requestEject(int index) Solid::OpticalDrive* drive = item->device().parent().as<Solid::OpticalDrive>(); if (drive) { connect(drive, SIGNAL(ejectDone(Solid::ErrorType,QVariant,QString)), - this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant))); + this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)), + Qt::UniqueConnection); drive->eject(); } else { const QString label = item->text(); @@ -330,7 +331,8 @@ void PlacesItemModel::requestTeardown(int index) Solid::StorageAccess* access = item->device().as<Solid::StorageAccess>(); if (access) { connect(access, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)), - this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant))); + this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)), + Qt::UniqueConnection); access->teardown(); } } @@ -359,7 +361,8 @@ void PlacesItemModel::requestStorageSetup(int index) m_storageSetupInProgress[access] = index; 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(); } @@ -598,6 +601,7 @@ void PlacesItemModel::slotStorageSetupDone(Solid::ErrorType error, { Q_UNUSED(udi); + Q_ASSERT(!m_storageSetupInProgress.isEmpty()); const int index = m_storageSetupInProgress.take(sender()); const PlacesItem* item = placesItem(index); if (!item) { |
