summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2012-07-24 09:38:03 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2012-07-25 10:14:33 (GMT)
commitad30baa6092185860c6ab688ff55b4309db523a0 (patch)
tree1e628bbc559a22e456036622a30c22d983f3bab0
parentb11b2039ae794ad7dab77124bde95626034b9622 (diff)
downloadlibcalendaring-ad30baa6092185860c6ab688ff55b4309db523a0.tar.gz
conditionally disable dbus interfaces
-rw-r--r--kdecore/date/ksystemtimezone.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/kdecore/date/ksystemtimezone.cpp b/kdecore/date/ksystemtimezone.cpp
index c2e2da3..d8894dc 100644
--- a/kdecore/date/ksystemtimezone.cpp
+++ b/kdecore/date/ksystemtimezone.cpp
@@ -43,10 +43,13 @@
#include <QtCore/QRegExp>
#include <QtCore/QStringList>
#include <QtCore/QTextStream>
+
+#ifndef KDE_NO_TIMEZONED
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusConnectionInterface>
#include <QtDBus/QDBusReply>
+#endif
#include <kglobal.h>
#include <klocale.h>
@@ -61,8 +64,9 @@
#include "ktimezone_win.h"
#endif
+#ifndef KDE_NO_TIMEZONED
#define KTIMEZONED_DBUS_IFACE "org.kde.KTimeZoned"
-
+#endif
/* Return the offset to UTC in the current time zone at the specified UTC time.
* The thread-safe function localtime_r() is used in preference if available.
@@ -180,12 +184,14 @@ K_GLOBAL_STATIC(KTimeZone, simulatedLocalZone)
KSystemTimeZones::KSystemTimeZones()
: d(0)
{
+#ifndef KDE_NO_TIMEZONED
QDBusConnection dbus = QDBusConnection::sessionBus();
const QString dbusIface = QString::fromLatin1(KTIMEZONED_DBUS_IFACE);
dbus.connect(QString(), QString(), dbusIface, QLatin1String("configChanged"), this, SLOT(configChanged()));
dbus.connect(QString(), QString(), dbusIface, QLatin1String("zonetabChanged"), this, SLOT(zonetabChanged(QString)));
// No need to connect to definitionChanged() - see comments in zoneDefinitionChanged()
//dbus.connect(QString(), QString(), dbusIface, QLatin1String("definitionChanged"), this, SLOT(zoneDefinitionChanged(QString)));
+#endif
}
KSystemTimeZones::~KSystemTimeZones()
@@ -297,6 +303,7 @@ KSystemTimeZonesPrivate *KSystemTimeZonesPrivate::instance()
// A KSystemTimeZones instance is required only to catch D-Bus signals.
m_parent = new KSystemTimeZones;
+#ifndef KDE_NO_TIMEZONED
// Ensure that the KDED time zones module has initialized. The call loads the module on demand.
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String("org.kde.kded")))
KToolInvocation::klauncher(); // this calls startKdeinit, and blocks until it returns
@@ -308,7 +315,7 @@ KSystemTimeZonesPrivate *KSystemTimeZonesPrivate::instance()
kError(161) << "KSystemTimeZones: ktimezoned initialize() D-Bus call failed: " << reply.error().message() << endl;
kDebug(161)<<"instance(): ... initialised";
delete ktimezoned;
-
+#endif
// Read the time zone config written by ktimezoned
readConfig(true);