From 107220694fe3387df4051dcd94ae6c9995cb45f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 18 Oct 2014 14:19:37 +0200 Subject: Allow contitional build with tdehwlib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- kicker/kicker/ui/k_new_mnu.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'kicker') 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 #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#endif #include #include #include @@ -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() -- cgit v1.2.1