Ticket #7749: 7749-config.patch

File 7749-config.patch, 2.3 KB (added by nigel, 2 years ago)

Something like this?

  • configure

     
    12011201    mheg 
    12021202    opengl_video 
    12031203    opengl_vsync 
     1204    qtdbus 
    12041205    qtwebkit 
    12051206    v4l 
    12061207    valgrind 
     
    34393440 
    34403441enabled qtwebkit || die "Error! QtWebkit headers not found" 
    34413442 
     3443# Check if Qt was built with DBus support: 
     3444qt_inc="-I${sysroot}/$(${qmake} -query QT_INSTALL_HEADERS)" 
     3445check_cxx ${qt_inc} <<EOF && enable qtdbus 
     3446#include <QtDBus> 
     3447EOF 
     3448 
    34423449if enabled firewire; then 
    34433450    firewire="no" 
    34443451    libavc_5_3="no" 
  • programs/mythfrontend/exitprompt.cpp

     
     1#include "config.h" 
    12 
    23#include <QCoreApplication> 
     4#if CONFIG_QTDBUS 
    35#include <QtDBus> 
    46#include <QDBusInterface> 
     7#endif 
    58 
    69#include "exitprompt.h" 
    710#include "mythcontext.h" 
     
    1518    qApp->exit(); 
    1619} 
    1720 
    18 void ExitPrompter::halt() 
     21bool DBusHalt(void) 
    1922{ 
     23#if CONFIG_QTDBUS 
    2024    QDBusInterface kde("org.kde.ksmserver", 
    2125                       "/KSMServer", 
    2226                       "org.kde.KSMServerInterface"); 
     
    5054    } 
    5155    if (!void_reply.isValid()) 
    5256        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 
     63void ExitPrompter::halt() 
     64{ 
     65    if (!DBusHalt()) 
    5466    { 
    5567        QString halt_cmd = gContext->GetSetting("HaltCommand", 
    5668                                            "sudo /sbin/halt -p"); 
     
    6173    } 
    6274} 
    6375 
    64 void ExitPrompter::reboot() 
     76bool DBusReboot(void) 
    6577{ 
     78#if CONFIG_QTDBUS 
    6679    QDBusInterface kde("org.kde.ksmserver", 
    6780                       "/KSMServer", 
    6881                       "org.kde.KSMServerInterface"); 
     
    96109    } 
    97110    if (!void_reply.isValid()) 
    98111        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 
     118void ExitPrompter::reboot() 
     119{ 
     120    if (!DBusReboot()) 
    100121    { 
    101122        QString reboot_cmd = gContext->GetSetting("RebootCommand", 
    102123                                              "sudo /sbin/reboot");