Index: configure
===================================================================
--- configure	(revision 23519)
+++ configure	(working copy)
@@ -1201,6 +1201,7 @@
     mheg
     opengl_video
     opengl_vsync
+    qtdbus
     qtwebkit
     v4l
     valgrind
@@ -3439,6 +3440,12 @@
 
 enabled qtwebkit || die "Error! QtWebkit headers not found"
 
+# Check if Qt was built with DBus support:
+qt_inc="-I${sysroot}/$(${qmake} -query QT_INSTALL_HEADERS)"
+check_cxx ${qt_inc} <<EOF && enable qtdbus
+#include <QtDBus>
+EOF
+
 if enabled firewire; then
     firewire="no"
     libavc_5_3="no"
Index: programs/mythfrontend/exitprompt.cpp
===================================================================
--- programs/mythfrontend/exitprompt.cpp	(revision 23519)
+++ programs/mythfrontend/exitprompt.cpp	(working copy)
@@ -1,7 +1,10 @@
+#include "config.h"
 
 #include <QCoreApplication>
+#if CONFIG_QTDBUS
 #include <QtDBus>
 #include <QDBusInterface>
+#endif
 
 #include "exitprompt.h"
 #include "mythcontext.h"
@@ -15,8 +18,9 @@
     qApp->exit();
 }
 
-void ExitPrompter::halt()
+bool DBusHalt(void)
 {
+#if CONFIG_QTDBUS
     QDBusInterface kde("org.kde.ksmserver",
                        "/KSMServer",
                        "org.kde.KSMServerInterface");
@@ -50,7 +54,15 @@
     }
     if (!void_reply.isValid())
         int_reply = hal.call("Shutdown");
-    if (!void_reply.isValid() && !int_reply.isValid())
+
+    return void_reply.isValid() || void_reply.isValid();
+#endif
+    return false;
+}
+
+void ExitPrompter::halt()
+{
+    if (!DBusHalt())
     {
         QString halt_cmd = gContext->GetSetting("HaltCommand",
                                             "sudo /sbin/halt -p");
@@ -61,8 +73,9 @@
     }
 }
 
-void ExitPrompter::reboot()
+bool DBusReboot(void)
 {
+#if CONFIG_QTDBUS
     QDBusInterface kde("org.kde.ksmserver",
                        "/KSMServer",
                        "org.kde.KSMServerInterface");
@@ -96,7 +109,15 @@
     }
     if (!void_reply.isValid())
         int_reply = hal.call("Reboot");
-    if (!void_reply.isValid() && !int_reply.isValid())
+
+    return void_reply.isValid() || !int_reply.isValid();
+#endif
+    return false;
+}
+
+void ExitPrompter::reboot()
+{
+    if (!DBusReboot())
     {
         QString reboot_cmd = gContext->GetSetting("RebootCommand",
                                               "sudo /sbin/reboot");

