diff --git a/runners/dictionary/dictionarymatchengine.h b/runners/dictionary/dictionarymatchengine.h --- a/runners/dictionary/dictionarymatchengine.h +++ b/runners/dictionary/dictionarymatchengine.h @@ -37,6 +37,7 @@ private Q_SLOTS: void dataUpdated(const QString &name, const Plasma::DataEngine::Data &data); void sourceAdded(const QString &source); + void sourceRemoved(const QString &source); }; diff --git a/runners/dictionary/dictionarymatchengine.cpp b/runners/dictionary/dictionarymatchengine.cpp --- a/runners/dictionary/dictionarymatchengine.cpp +++ b/runners/dictionary/dictionarymatchengine.cpp @@ -43,6 +43,7 @@ qDebug() << "The dictionary data engine timed out (word:" << word << ")"; locker.unlock(); + QMetaObject::invokeMethod(this, "sourceRemoved", Qt::QueuedConnection, Q_ARG(const QString&, word)); // after a timeout, if dataUpdated gets m_wordLock here, it can lock data->mutex successfully. m_wordLock.lockForWrite(); @@ -60,6 +61,11 @@ m_dictionaryEngine->connectSource(source, this); } +void DictionaryMatchEngine::sourceRemoved(const QString &source) +{ + m_dictionaryEngine->disconnectSource(source, this); +} + void DictionaryMatchEngine::dataUpdated(const QString &source, const Plasma::DataEngine::Data &result) { if (!result.contains(QLatin1String("text")))