From b0a5d8b2bf0d20a5487df243ab586d1a60e19cb3 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 13 Jun 2022 08:01:13 +0300 Subject: [PATCH] kdecore: ksycoca database is usable without kded there is config option to disable resources monitoring in which case even if kded is started it will not keep the database up-to-date and it has to be done manually Signed-off-by: Ivailo Monev --- kdecore/sycoca/ksycoca.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kdecore/sycoca/ksycoca.cpp b/kdecore/sycoca/ksycoca.cpp index 663ba687..beceaf13 100644 --- a/kdecore/sycoca/ksycoca.cpp +++ b/kdecore/sycoca/ksycoca.cpp @@ -327,14 +327,8 @@ bool KSycocaPrivate::checkDatabase(BehaviorsIfNotFound ifNotFound) closeDatabase(); // close the dummy one - static const QString kdedInterface = QString::fromLatin1("org.kde.kded"); - QDBusConnectionInterface* sessionInterface = QDBusConnection::sessionBus().interface(); - // We can only use the installed ksycoca file if kded is running, since - // kded is what keeps the file up-to-date. - const bool kdedRunning = sessionInterface->isServiceRegistered(kdedInterface); - // Check if new database already available - if (kdedRunning && openDatabase(ifNotFound & IfNotFoundOpenDummy)) { + if (openDatabase(ifNotFound & IfNotFoundOpenDummy)) { if (checkVersion()) { // Database exists, and version is ok. return true; @@ -361,6 +355,9 @@ bool KSycocaPrivate::checkDatabase(BehaviorsIfNotFound ifNotFound) } // If kded is not running we need to launch it as it monitors for changes + static const QString kdedInterface = QString::fromLatin1("org.kde.kded"); + QDBusConnectionInterface* sessionInterface = QDBusConnection::sessionBus().interface(); + const bool kdedRunning = sessionInterface->isServiceRegistered(kdedInterface); if (!kdedRunning) { kDebug(7011) << "Launching kded"; sessionInterface->startService(kdedInterface);