summaryrefslogtreecommitdiffstats
path: root/kicker
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2014-10-18 14:19:37 +0200
committerSlávek Banko <slavek.banko@axis.cz>2014-10-18 14:29:21 +0200
commit107220694fe3387df4051dcd94ae6c9995cb45f6 (patch)
tree4301e933aa91df778cdc97153f4e1bd4ba4e3114 /kicker
parent69da674b30d246f4df152501b9312518cd900372 (diff)
downloadtdebase-107220694fe3387df4051dcd94ae6c9995cb45f6.tar.gz
tdebase-107220694fe3387df4051dcd94ae6c9995cb45f6.zip
Allow contitional build with tdehwlib
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kicker')
-rw-r--r--kicker/kicker/ui/k_new_mnu.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp
index 70efdea79..a5641168f 100644
--- a/kicker/kicker/ui/k_new_mnu.cpp
+++ b/kicker/kicker/ui/k_new_mnu.cpp
@@ -52,7 +52,9 @@
#include <kdebug.h>
#include <tdeglobal.h>
#include <tdeglobalsettings.h>
+#ifdef __TDE_HAVE_TDEHWLIB
#include <tdehardwaredevices.h>
+#endif
#include <kiconloader.h>
#include <klineedit.h>
#include <tdelocale.h>
@@ -1365,10 +1367,10 @@ void KMenu::insertStaticExitItems()
}
bool maysd = false;
-#ifdef COMPILE_HALBACKEND
+#if defined(COMPILE_HALBACKEND)
if (ksmserver.readBoolEntry( "offerShutdown", true ) && DM().canShutdown())
maysd = true;
-#else
+#elif defined(__TDE_HAVE_TDEHWLIB)
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice();
if( rootDevice ) {
maysd = rootDevice->canPowerOff();
@@ -3798,7 +3800,7 @@ void KMenu::insertSuspendOption( int &nId, int &index )
bool suspend_freeze = false;
bool standby = false;
bool suspend_disk = false;
-#ifdef COMPILE_HALBACKEND
+#if defined(COMPILE_HALBACKEND)
suspend_ram = libhal_device_get_property_bool(m_halCtx,
"/org/freedesktop/Hal/devices/computer",
"power_management.can_suspend",
@@ -3813,7 +3815,7 @@ void KMenu::insertSuspendOption( int &nId, int &index )
"/org/freedesktop/Hal/devices/computer",
"power_management.can_hibernate",
NULL);
-#else // COMPILE_HALBACKEND
+#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice();
if (rootDevice) {
suspend_ram = rootDevice->canSuspend();
@@ -3874,7 +3876,7 @@ void KMenu::slotSuspend(int id)
DCOPRef("kdesktop", "KScreensaverIface").call("lock()");
}
-#ifdef COMPILE_HALBACKEND
+#if defined(COMPILE_HALBACKEND)
DBusMessage* msg = NULL;
if (m_dbusConn) {
@@ -3907,7 +3909,7 @@ void KMenu::slotSuspend(int id)
}
dbus_message_unref(msg);
}
-#else // COMPILE_HALBACKEND
+#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND
TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice();
if (rootDevice) {
if (id == 1) {
@@ -3922,10 +3924,12 @@ void KMenu::slotSuspend(int id)
return;
}
}
+#else
+ error = false;
#endif
- if (error)
+ if (error) {
KMessageBox::error(this, i18n("Suspend failed"));
-
+ }
}
void KMenu::runUserCommand()