summaryrefslogtreecommitdiff
path: root/kdecore/sycoca/ksycoca.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdecore/sycoca/ksycoca.cpp')
-rw-r--r--kdecore/sycoca/ksycoca.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/kdecore/sycoca/ksycoca.cpp b/kdecore/sycoca/ksycoca.cpp
index 24099d1..dfbcbb6 100644
--- a/kdecore/sycoca/ksycoca.cpp
+++ b/kdecore/sycoca/ksycoca.cpp
@@ -37,8 +37,9 @@
#include <QtCore/QFile>
#include <QtCore/QBuffer>
#include <QProcess>
+#ifndef KDE_NO_DBUS
#include <QtDBus/QtDBus>
-
+#endif
// #include <config.h>
#include <stdlib.h>
@@ -180,10 +181,12 @@ K_GLOBAL_STATIC(KSycocaSingleton, ksycocaInstance)
KSycoca::KSycoca()
: d(new KSycocaPrivate)
{
+#ifndef KDE_NO_DBUS
QDBusConnection::sessionBus().connect(QString(), QString(),
QString::fromLatin1("org.kde.KSycoca"),
QString::fromLatin1("notifyDatabaseChanged"),
this, SLOT(notifyDatabaseChanged(QStringList)));
+#endif
}
bool KSycocaPrivate::openDatabase(bool openDummyIfNotFound)
@@ -416,8 +419,11 @@ bool KSycocaPrivate::checkDatabase(BehaviorsIfNotFound ifNotFound)
// We can only use the installed ksycoca file if kdeinit+klauncher+kded are running,
// since kded is what keeps the file uptodate.
+#ifndef KDE_NO_DBUS
const bool kdeinitRunning = QDBusConnection::sessionBus().interface()->isServiceRegistered(QString::fromLatin1("org.kde.klauncher"));
-
+#else
+ const bool kdeinitRunning = false;
+#endif
// Check if new database already available
if (kdeinitRunning && openDatabase(ifNotFound & IfNotFoundOpenDummy)) {
if (checkVersion()) {
@@ -434,7 +440,7 @@ bool KSycocaPrivate::checkDatabase(BehaviorsIfNotFound ifNotFound)
KToolInvocation::klauncher(); // this calls startKdeinit, and blocks until it returns
// and since kdeinit4 only returns after kbuildsycoca4 is done, we can proceed.
} else {
- kDebug(7011) << QThread::currentThread() << "We have no database.... launching" << KBUILDSYCOCA_EXENAME;
+ //kDebug(7011) << QThread::currentThread() << "We have no database.... launching" << KBUILDSYCOCA_EXENAME;
if (QProcess::execute(KStandardDirs::findExe(QString::fromLatin1(KBUILDSYCOCA_EXENAME))) != 0)
qWarning("ERROR: Running KSycoca failed.");
}