Commit c0fa968c authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[SourcesModel] Check changed file name before reloading configuration

Avoid needlessly reloading configuration if something completely unrelated, such as plasma appletsrc, changed.

Differential Revision:
parent cd9b4aad
......@@ -42,8 +42,8 @@ SourcesModel::SourcesModel(QObject* parent)
this, SLOT(slotMatchesChanged(QList<Plasma::QueryMatch>)));
KDirWatch* watch = KDirWatch::self();
connect(watch, SIGNAL(created(QString)), this, SLOT(reloadConfiguration()));
connect(watch, SIGNAL(dirty(QString)), this, SLOT(reloadConfiguration()));
connect(watch, &KDirWatch::created, this, &SourcesModel::slotSettingsFileChanged);
connect(watch, &KDirWatch::dirty, this, &SourcesModel::slotSettingsFileChanged);
watch->addFile(QStandardPaths::locate(QStandardPaths::ConfigLocation, "krunnerrc"));
......@@ -347,6 +347,15 @@ void SourcesModel::slotMatchAdded(const Plasma::QueryMatch& m)
void SourcesModel::slotSettingsFileChanged(const QString &path)
if (!path.endsWith(QLatin1String("krunnerrc"))) {
void SourcesModel::clear()
......@@ -103,6 +103,7 @@ private slots:
void slotMatchesChanged(const QList<Plasma::QueryMatch>& list);
void slotMatchAdded(const Plasma::QueryMatch& match);
void slotResetTimeout();
void slotSettingsFileChanged(const QString &path);
// A list of all the types that are being shown
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment