diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2012-07-26 12:10:35 (GMT) |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2012-07-26 12:10:35 (GMT) |
commit | 744ba7fda608f630df8b4985b0df87fbc7570e94 (patch) | |
tree | 511bccc585453b6eace4cd3e4f35fbc3fe872b56 /kdecore/sycoca/ksycoca.cpp | |
parent | 57ee4665bf1a069d9ead75a67c43206538212778 (diff) | |
download | libcalendaring-744ba7fda608f630df8b4985b0df87fbc7570e94.tar.gz |
...and another bunch of dbus dependencies
Diffstat (limited to 'kdecore/sycoca/ksycoca.cpp')
-rw-r--r-- | kdecore/sycoca/ksycoca.cpp | 12 |
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."); } |