Ticket #7749: 7749-config.patch
| File 7749-config.patch, 2.3 KB (added by nigel, 2 years ago) |
|---|
-
configure
1201 1201 mheg 1202 1202 opengl_video 1203 1203 opengl_vsync 1204 qtdbus 1204 1205 qtwebkit 1205 1206 v4l 1206 1207 valgrind … … 3439 3440 3440 3441 enabled qtwebkit || die "Error! QtWebkit headers not found" 3441 3442 3443 # Check if Qt was built with DBus support: 3444 qt_inc="-I${sysroot}/$(${qmake} -query QT_INSTALL_HEADERS)" 3445 check_cxx ${qt_inc} <<EOF && enable qtdbus 3446 #include <QtDBus> 3447 EOF 3448 3442 3449 if enabled firewire; then 3443 3450 firewire="no" 3444 3451 libavc_5_3="no" -
programs/mythfrontend/exitprompt.cpp
1 #include "config.h" 1 2 2 3 #include <QCoreApplication> 4 #if CONFIG_QTDBUS 3 5 #include <QtDBus> 4 6 #include <QDBusInterface> 7 #endif 5 8 6 9 #include "exitprompt.h" 7 10 #include "mythcontext.h" … … 15 18 qApp->exit(); 16 19 } 17 20 18 void ExitPrompter::halt()21 bool DBusHalt(void) 19 22 { 23 #if CONFIG_QTDBUS 20 24 QDBusInterface kde("org.kde.ksmserver", 21 25 "/KSMServer", 22 26 "org.kde.KSMServerInterface"); … … 50 54 } 51 55 if (!void_reply.isValid()) 52 56 int_reply = hal.call("Shutdown"); 53 if (!void_reply.isValid() && !int_reply.isValid()) 57 58 return void_reply.isValid() || void_reply.isValid(); 59 #endif 60 return false; 61 } 62 63 void ExitPrompter::halt() 64 { 65 if (!DBusHalt()) 54 66 { 55 67 QString halt_cmd = gContext->GetSetting("HaltCommand", 56 68 "sudo /sbin/halt -p"); … … 61 73 } 62 74 } 63 75 64 void ExitPrompter::reboot()76 bool DBusReboot(void) 65 77 { 78 #if CONFIG_QTDBUS 66 79 QDBusInterface kde("org.kde.ksmserver", 67 80 "/KSMServer", 68 81 "org.kde.KSMServerInterface"); … … 96 109 } 97 110 if (!void_reply.isValid()) 98 111 int_reply = hal.call("Reboot"); 99 if (!void_reply.isValid() && !int_reply.isValid()) 112 113 return void_reply.isValid() || !int_reply.isValid(); 114 #endif 115 return false; 116 } 117 118 void ExitPrompter::reboot() 119 { 120 if (!DBusReboot()) 100 121 { 101 122 QString reboot_cmd = gContext->GetSetting("RebootCommand", 102 123 "sudo /sbin/reboot");
