diff --git a/src/declarativeimports/core/tooltip.h b/src/declarativeimports/core/tooltip.h --- a/src/declarativeimports/core/tooltip.h +++ b/src/declarativeimports/core/tooltip.h @@ -189,7 +189,7 @@ void interactiveChanged(); private Q_SLOTS: - void settingsChanged(); + void settingsChanged(const QString &file); private: bool isValid() const; diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp --- a/src/declarativeimports/core/tooltip.cpp +++ b/src/declarativeimports/core/tooltip.cpp @@ -54,8 +54,8 @@ const QString configFile = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QStringLiteral("/plasmarc"); KDirWatch::self()->addFile(configFile); - QObject::connect(KDirWatch::self(), SIGNAL(created(QString)), this, SLOT(settingsChanged())); - QObject::connect(KDirWatch::self(), SIGNAL(dirty(QString)), this, SLOT(settingsChanged())); + QObject::connect(KDirWatch::self(), &KDirWatch::created, this, &ToolTip::settingsChanged); + QObject::connect(KDirWatch::self(), &KDirWatch::dirty, this, &ToolTip::settingsChanged); } ToolTip::~ToolTip() @@ -74,8 +74,12 @@ } } -void ToolTip::settingsChanged() +void ToolTip::settingsChanged(const QString &file) { + if (!file.endsWith(QLatin1String("plasmarc"))) { + return; + } + KSharedConfig::openConfig(QStringLiteral("plasmarc"))->reparseConfiguration(); loadSettings(); }