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 | |
parent | 57ee4665bf1a069d9ead75a67c43206538212778 (diff) | |
download | libcalendaring-744ba7fda608f630df8b4985b0df87fbc7570e94.tar.gz |
...and another bunch of dbus dependencies
-rw-r--r-- | kabc/addresseehelper.cpp | 7 | ||||
-rw-r--r-- | kdecore/services/kmimetype.cpp | 9 | ||||
-rw-r--r-- | kdecore/sycoca/ksycoca.cpp | 12 | ||||
-rw-r--r-- | kdecore/util/kdedmodule.cpp | 4 |
4 files changed, 27 insertions, 5 deletions
diff --git a/kabc/addresseehelper.cpp b/kabc/addresseehelper.cpp index 725b42c..4ef88be 100644 --- a/kabc/addresseehelper.cpp +++ b/kabc/addresseehelper.cpp @@ -24,8 +24,9 @@ #include <kconfiggroup.h> #include <QApplication> +#ifndef KDE_NO_DBUS #include <QtDBus/QtDBus> - +#endif using namespace KABC; AddresseeHelper *AddresseeHelper::s_self; @@ -45,10 +46,12 @@ AddresseeHelper::AddresseeHelper() { initSettings(); +#ifndef KDE_NO_DBUS QDBusConnection::sessionBus().connect( QString(), QLatin1String( "/KABC" ), QLatin1String( "org.kde.kabc.AddressBookConfig" ), QLatin1String( "changed" ), this, SLOT(initSettings())); +#endif } // static @@ -114,4 +117,4 @@ bool AddresseeHelper::tradeAsFamilyName() const return mTradeAsFamilyName; } -#include "addresseehelper.moc"
\ No newline at end of file +#include "addresseehelper.moc" diff --git a/kdecore/services/kmimetype.cpp b/kdecore/services/kmimetype.cpp index 955bf62..9360c93 100644 --- a/kdecore/services/kmimetype.cpp +++ b/kdecore/services/kmimetype.cpp @@ -32,7 +32,12 @@ #include <kurl.h> #include <QtCore/QFile> +#ifndef KDE_NO_DBUS #include <QtDBus/QtDBus> +#else +#include <QStack> +#include <QXmlStreamReader> +#endif #include <QBuffer> extern int servicesDebugArea(); @@ -489,11 +494,15 @@ QString KMimeType::favIconForUrl( const KUrl& url ) || !KMimeTypeRepository::self()->useFavIcons()) return QString(); +#ifndef KDE_NO_DBUS QDBusInterface kded( QString::fromLatin1("org.kde.kded"), QString::fromLatin1("/modules/favicons"), QString::fromLatin1("org.kde.FavIcon") ); QDBusReply<QString> result = kded.call( QString::fromLatin1("iconForUrl"), url.url() ); return result; // default is QString() +#else + return QString(); +#endif } QString KMimeType::comment( const KUrl &url) const 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."); } diff --git a/kdecore/util/kdedmodule.cpp b/kdecore/util/kdedmodule.cpp index 6a5ba85..caf641a 100644 --- a/kdecore/util/kdedmodule.cpp +++ b/kdecore/util/kdedmodule.cpp @@ -25,7 +25,9 @@ #include "kdebug.h" #include <QtCore/QTimer> +#ifndef KDE_NO_DBUS #include <QtDBus/QtDBus> +#endif @@ -49,6 +51,7 @@ KDEDModule::~KDEDModule() void KDEDModule::setModuleName( const QString& name ) { d->moduleName = name; +#ifndef KDE_NO_DBUS QDBusObjectPath realPath( QString::fromLatin1("/modules/") + d->moduleName); if (realPath.path().isEmpty()) @@ -90,6 +93,7 @@ void KDEDModule::setModuleName( const QString& name ) kDebug() << "registerObject() successful for " << d->moduleName; emit moduleRegistered(realPath); } +#endif } |