From 225ddaa3667808031fe65763d7f533437484486c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 17 May 2021 18:10:38 +0200 Subject: [PATCH] Respect build option WITH_TDEHWLIB, otherwise it can lead to FTBFS in special cases. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit e031e12d06c77e0a05ad0c30c21f3afea94764af) --- drkonqi/backtrace.cpp | 4 ++-- kcontrol/displayconfig/displayconfig.cpp | 8 ++++++-- kcontrol/displayconfig/displayconfig.h | 6 +----- kcontrol/randr/CMakeLists.txt | 1 + kcontrol/randr/tderandrtray.cpp | 8 ++++++-- kcontrol/randr/tderandrtray.h | 2 +- kicker/kicker/ui/k_new_mnu.cpp | 12 ++++++++---- ksmserver/server.cpp | 4 ++-- ksmserver/server.h | 4 ++-- ksmserver/shutdown.cpp | 4 ++-- ksmserver/shutdowndlg.cpp | 8 ++++++-- tdeioslave/media/medianotifier/CMakeLists.txt | 1 + .../media/medianotifier/notificationdialog.cpp | 6 +++++- tdeioslave/media/mounthelper/CMakeLists.txt | 1 + .../media/mounthelper/tdeio_media_mounthelper.cpp | 8 ++++++-- tdm/kfrontend/kgapp.cpp | 6 +++--- tdm/kfrontend/kgapp.h | 2 +- 17 files changed, 54 insertions(+), 31 deletions(-) diff --git a/drkonqi/backtrace.cpp b/drkonqi/backtrace.cpp index 70bb35fa7..8078f94be 100644 --- a/drkonqi/backtrace.cpp +++ b/drkonqi/backtrace.cpp @@ -36,7 +36,7 @@ #include #include #include -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include #endif @@ -358,7 +358,7 @@ void BackTrace::processBacktrace() } #endif // HAVE_ELFICON -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB // Append potentially important hardware information m_strBt.append("\n==== (tdehwlib) hardware information ====\n"); TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); diff --git a/kcontrol/displayconfig/displayconfig.cpp b/kcontrol/displayconfig/displayconfig.cpp index 8311b428e..4408e2c74 100644 --- a/kcontrol/displayconfig/displayconfig.cpp +++ b/kcontrol/displayconfig/displayconfig.cpp @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -744,7 +748,7 @@ void KDisplayConfig::setRealResolutionSliderValue(int index) { KDisplayConfig::KDisplayConfig(TQWidget *parent, const char *name, const TQStringList &) : TDECModule(KDisplayCFactory::instance(), parent, name), iccTab(0), numberOfProfiles(0), numberOfScreens(0), m_randrsimple(0), activeProfileName(""), m_gammaApplyTimer(0) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); #endif @@ -863,7 +867,7 @@ KDisplayConfig::~KDisplayConfig() } void KDisplayConfig::deviceChanged (TDEGenericDevice* device) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB if (device->type() == TDEGenericDeviceType::Monitor) { if (base->rescanHardware->isEnabled()) { base->rescanHardware->setEnabled(false); diff --git a/kcontrol/displayconfig/displayconfig.h b/kcontrol/displayconfig/displayconfig.h index dce061003..6b4faea70 100644 --- a/kcontrol/displayconfig/displayconfig.h +++ b/kcontrol/displayconfig/displayconfig.h @@ -21,10 +21,6 @@ #ifndef _KCM_DisplayCONFIG_H #define _KCM_DisplayCONFIG_H -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include @@ -35,7 +31,7 @@ #include #include -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include #else #define TDEGenericDevice void diff --git a/kcontrol/randr/CMakeLists.txt b/kcontrol/randr/CMakeLists.txt index 25a3a897e..89c530523 100644 --- a/kcontrol/randr/CMakeLists.txt +++ b/kcontrol/randr/CMakeLists.txt @@ -11,6 +11,7 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} ${TDE_INCLUDE_DIR} ${TQT_INCLUDE_DIRS} ) diff --git a/kcontrol/randr/tderandrtray.cpp b/kcontrol/randr/tderandrtray.cpp index a443c3781..647f0eca7 100644 --- a/kcontrol/randr/tderandrtray.cpp +++ b/kcontrol/randr/tderandrtray.cpp @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -92,7 +96,7 @@ KRandRSystemTray::KRandRSystemTray(TQWidget* parent, const char *name) applyIccConfiguration(cur_profile, NULL); } -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); #endif @@ -888,7 +892,7 @@ void KRandRSystemTray::slotOutputChanged(int parameter) } void KRandRSystemTray::deviceChanged (TDEGenericDevice* device) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB if (device->type() == TDEGenericDeviceType::Monitor) { KRandrPassivePopup::message( i18n("New display output options are available!"), diff --git a/kcontrol/randr/tderandrtray.h b/kcontrol/randr/tderandrtray.h index 8f382922f..54b35bdda 100644 --- a/kcontrol/randr/tderandrtray.h +++ b/kcontrol/randr/tderandrtray.h @@ -25,7 +25,7 @@ #include #include -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include #else #define TDEGenericDevice void diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp index 0cb572211..28b5f0a95 100644 --- a/kicker/kicker/ui/k_new_mnu.cpp +++ b/kicker/kicker/ui/k_new_mnu.cpp @@ -21,6 +21,10 @@ ******************************************************************/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -52,7 +56,7 @@ #include #include #include -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include #endif #include @@ -1366,7 +1370,7 @@ void KMenu::insertStaticExitItems() #if defined(COMPILE_HALBACKEND) if (ksmserver.readBoolEntry( "offerShutdown", true ) && DM().canShutdown()) maysd = true; -#elif defined(__TDE_HAVE_TDEHWLIB) +#elif defined(WITH_TDEHWLIB) TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if( rootDevice ) { maysd = rootDevice->canPowerOff(); @@ -3790,7 +3794,7 @@ void KMenu::insertSuspendOption( int &nId, int &index ) "/org/freedesktop/Hal/devices/computer", "power_management.can_hibernate", NULL); -#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND +#elif defined(WITH_TDEHWLIB) // COMPILE_HALBACKEND TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if (rootDevice) { suspend_ram = rootDevice->canSuspend(); @@ -3884,7 +3888,7 @@ void KMenu::slotSuspend(int id) } dbus_message_unref(msg); } -#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND +#elif defined(WITH_TDEHWLIB) // COMPILE_HALBACKEND TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if (rootDevice) { if (id == 1) { diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp index f09dcd9df..52d5582dd 100644 --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -598,7 +598,7 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag clientInteracting = 0; xonCommand = config->readEntry( "xonCommand", "xon" ); -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB hwDevices = TDEGlobal::hardwareDevices(); #endif @@ -722,7 +722,7 @@ void KSMServer::cleanUp() DM().shutdown( shutdownType, shutdownMode, bootOption ); } else { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice(); if (rootDevice) { if (shutdownType == TDEApplication::ShutdownTypeHalt) { diff --git a/ksmserver/server.h b/ksmserver/server.h index bc677752c..2218adcb3 100644 --- a/ksmserver/server.h +++ b/ksmserver/server.h @@ -23,7 +23,7 @@ Copyright (C) 2000 Matthias Ettrich #include #include -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include #endif @@ -253,7 +253,7 @@ private: WindowMap legacyWindows; -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB TDEHardwareDevices* hwDevices; #endif int initialClientCount; diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp index a4a51779e..acb3890d3 100644 --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -152,7 +152,7 @@ bool KSMServer::checkStatus( bool &logoutConfirmed, bool &maysd, bool &mayrb, mayrb = true; } else { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice(); if (rootDevice) { if (rootDevice->canPowerOff()) { @@ -241,7 +241,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm, // If this is not done the desktop of the locked session will be shown after suspend/hibernate until the lock fully engages! kapp->dcopClient()->call("kdesktop", "KScreensaverIface", "lock()", TQCString(""), replyType, replyData); } -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice(); if (rootDevice) { if (selection == 1) { // Suspend diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index cb37bc723..295cfc616 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -6,6 +6,10 @@ Copyright (C) 2010 Timothy Pearson Copyright (C) 2000 Matthias Ettrich ******************************************************************/ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "shutdowndlg.h" #include @@ -33,7 +37,7 @@ Copyright (C) 2000 Matthias Ettrich #include #include #include -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include #endif #include @@ -866,7 +870,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, canHibernate = true; } } -#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND +#elif defined(WITH_TDEHWLIB) // COMPILE_HALBACKEND TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if (rootDevice) { canFreeze = rootDevice->canFreeze(); diff --git a/tdeioslave/media/medianotifier/CMakeLists.txt b/tdeioslave/media/medianotifier/CMakeLists.txt index ff2a8d802..215ee6de3 100644 --- a/tdeioslave/media/medianotifier/CMakeLists.txt +++ b/tdeioslave/media/medianotifier/CMakeLists.txt @@ -14,6 +14,7 @@ include_directories( ${CMAKE_BINARY_DIR}/tdeioslave/media/libmediacommon ${CMAKE_SOURCE_DIR}/tdeioslave/media/libmediacommon ${CMAKE_SOURCE_DIR}/tdmlib + ${CMAKE_BINARY_DIR} ${TDE_INCLUDE_DIR} ${TQT_INCLUDE_DIRS} ) diff --git a/tdeioslave/media/medianotifier/notificationdialog.cpp b/tdeioslave/media/medianotifier/notificationdialog.cpp index 7e4004e8c..392fbad94 100644 --- a/tdeioslave/media/medianotifier/notificationdialog.cpp +++ b/tdeioslave/media/medianotifier/notificationdialog.cpp @@ -17,6 +17,10 @@ Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "notificationdialog.h" #include @@ -28,7 +32,7 @@ #include #include #include -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include #endif diff --git a/tdeioslave/media/mounthelper/CMakeLists.txt b/tdeioslave/media/mounthelper/CMakeLists.txt index 766fe3def..349926ef0 100644 --- a/tdeioslave/media/mounthelper/CMakeLists.txt +++ b/tdeioslave/media/mounthelper/CMakeLists.txt @@ -12,6 +12,7 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/tdeioslave/media/libmediacommon + ${CMAKE_BINARY_DIR} ${TDE_INCLUDE_DIR} ${TQT_INCLUDE_DIRS} ) diff --git a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp index 3f0319f9f..a9cacf8da 100644 --- a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp +++ b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp @@ -19,6 +19,10 @@ Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -33,7 +37,7 @@ #include #include #include -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include #endif @@ -189,7 +193,7 @@ MountHelper::MountHelper() : TDEApplication() void MountHelper::invokeEject(const TQString &device, bool quiet) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB // Try TDE HW library eject first... TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); TDEGenericDevice *hwdevice = hwdevices->findByDeviceNode(device); diff --git a/tdm/kfrontend/kgapp.cpp b/tdm/kfrontend/kgapp.cpp index 3fefc00bc..9e6fccfdd 100644 --- a/tdm/kfrontend/kgapp.cpp +++ b/tdm/kfrontend/kgapp.cpp @@ -122,14 +122,14 @@ void GreeterApp::init() startTimer( pingInterval * 60000 ); } -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); #endif } void GreeterApp::deviceChanged(TDEGenericDevice* device) { -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #ifdef WITH_XRANDR if (device->type() == TDEGenericDeviceType::Monitor) { KRandrSimpleAPI *randrsimple = new KRandrSimpleAPI(); @@ -137,7 +137,7 @@ void GreeterApp::deviceChanged(TDEGenericDevice* device) { delete randrsimple; } #endif // WITH_XRANDR -#endif // __TDE_HAVE_TDEHWLIB +#endif // WITH_TDEHWLIB } void diff --git a/tdm/kfrontend/kgapp.h b/tdm/kfrontend/kgapp.h index c9e2802c1..4b6c65f6a 100644 --- a/tdm/kfrontend/kgapp.h +++ b/tdm/kfrontend/kgapp.h @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define KGAPP_H #include -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include #else #define TDEGenericDevice void