grab the source name before removing the iterator
the previous fix, which i accidentally reverted while cleaning up this code, was actually wrong (so in a way i'm glad i caught it): the signal MUST be emitted AFTER the item is removed from the collection otherwise any code that checks to see if that source exists will see that it does still exist even though it was just signaled as being removed. order sometimes really matters :) CCMAIL:kde@rusu.info BUG:287795
This commit is contained in:
parent
58b6cc3e43
commit
6cd33ae4a0
@ -331,10 +331,11 @@ void DataEngine::removeAllSources()
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
Plasma::DataContainer *s = it.value();
|
||||
const QString &source = it.key();
|
||||
it.remove();
|
||||
s->disconnect(this);
|
||||
s->deleteLater();
|
||||
emit sourceRemoved(it.key());
|
||||
it.remove();
|
||||
emit sourceRemoved(source);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user