summaryrefslogtreecommitdiff
path: root/kdecore/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kdecore/kernel')
-rw-r--r--kdecore/kernel/ktoolinvocation.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/kdecore/kernel/ktoolinvocation.cpp b/kdecore/kernel/ktoolinvocation.cpp
index 560803a..50f4f12 100644
--- a/kdecore/kernel/ktoolinvocation.cpp
+++ b/kdecore/kernel/ktoolinvocation.cpp
@@ -19,7 +19,9 @@
*/
#include "ktoolinvocation.h"
+#ifndef KDE_NO_DBUS
#include "klauncher_iface.h"
+#endif
#include "kdebug.h"
#include "kglobal.h"
#include "kstandarddirs.h"
@@ -51,7 +53,7 @@ KToolInvocation::KToolInvocation() : QObject(0), d(0)
KToolInvocation::~KToolInvocation()
{
}
-
+#ifndef KDE_NO_DBUS
Q_GLOBAL_STATIC_WITH_ARGS(org::kde::KLauncher, klauncherIface,
(QString::fromLatin1("org.kde.klauncher"), QString::fromLatin1("/KLauncher"), QDBusConnection::sessionBus()))
@@ -63,7 +65,7 @@ org::kde::KLauncher *KToolInvocation::klauncher()
}
return ::klauncherIface();
}
-
+#endif
static void printError(const QString& text, QString* error)
{
if (error)
@@ -89,6 +91,7 @@ int KToolInvocation::startServiceInternal(const char *_function,
const QByteArray& startup_id, bool noWait,
const QString& workdir)
{
+#ifndef KDE_NO_DBUS
QString function = QLatin1String(_function);
org::kde::KLauncher *launcher = KToolInvocation::klauncher();
QDBusMessage msg = QDBusMessage::createMethodCall(launcher->service(),
@@ -137,6 +140,9 @@ int KToolInvocation::startServiceInternal(const char *_function,
if (pid)
*pid = reply.arguments().at(3).toInt();
return reply.arguments().at(0).toInt();
+#else
+ return 0;
+#endif
}
#ifndef KDE_NO_DEPRECATED
@@ -283,7 +289,7 @@ void KToolInvocation::invokeHelp( const QString& anchor,
invokeBrowser(url.url());
return;
}
-
+#ifndef KDE_NO_DBUS
QDBusInterface *iface = new QDBusInterface(QLatin1String("org.kde.khelpcenter"),
QLatin1String("/KHelpCenter"),
QLatin1String("org.kde.khelpcenter.khelpcenter"),
@@ -314,6 +320,7 @@ void KToolInvocation::invokeHelp( const QString& anchor,
iface->call(QString::fromLatin1("openUrl"), url.url(), startup_id );
delete iface;
+#endif
}
void KToolInvocation::invokeMailer(const QString &address, const QString &subject, const QByteArray& startup_id)
@@ -369,6 +376,7 @@ void KToolInvocation::invokeMailer(const KUrl &mailtoURL, const QByteArray& star
void KToolInvocation::startKdeinit()
{
+#ifndef KDE_NO_DBUS
KComponentData inst( "startkdeinitlock" );
KLockFile lock( KStandardDirs::locateLocal("tmp", QString::fromLatin1("startkdeinitlock"), inst ));
if( lock.lock( KLockFile::NoBlockFlag ) != KLockFile::LockOK ) {
@@ -391,6 +399,7 @@ void KToolInvocation::startKdeinit()
QProcess::execute(srv, args);
// if ( gui )
// qApp->restoreOverrideCursor();
+#endif
}
#include "../../ktoolinvocation.moc"