diff --git a/kcms/baloo/kcm.h b/kcms/baloo/kcm.h --- a/kcms/baloo/kcm.h +++ b/kcms/baloo/kcm.h @@ -50,7 +50,6 @@ private: BalooSettings *m_settings; FilteredFolderModel *m_filteredFolderModel; - bool m_previouslyEnabled; }; } diff --git a/kcms/baloo/kcm.cpp b/kcms/baloo/kcm.cpp --- a/kcms/baloo/kcm.cpp +++ b/kcms/baloo/kcm.cpp @@ -73,20 +73,20 @@ void ServerConfigModule::load() { ManagedConfigModule::load(); - m_previouslyEnabled = m_settings->indexingEnabled(); } void ServerConfigModule::save() { ManagedConfigModule::save(); - Baloo::IndexerConfig config; - config.setFirstRun(m_previouslyEnabled != m_settings->indexingEnabled()); - - m_previouslyEnabled = m_settings->indexingEnabled(); - - // Start Baloo + // Update Baloo config or start Baloo if (m_settings->indexingEnabled()) { + // Update the baloo_file's config cache - if it not yet running, + // the DBus call goes nowhere + Baloo::IndexerConfig config; + config.refresh(); + + // Trying to start baloo when it is already running is fine const QString exe = QStandardPaths::findExecutable(QStringLiteral("baloo_file")); QProcess::startDetached(exe, QStringList()); } @@ -100,9 +100,6 @@ QDBusConnection::sessionBus().asyncCall(message); } - - // Update the baloo_file's config cache - config.refresh(); } FilteredFolderModel *ServerConfigModule::filteredModel() const