Branch: master

81d9dc49 2014-03-14 11:03:27 Slávek Banko
Use TDE hardware library to control shutdown options in Kickoff menu
This resolves Bug 1931
M kicker/kicker/ui/k_new_mnu.cpp
diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp
index 52b1317..1aa68a9 100644
--- a/kicker/kicker/ui/k_new_mnu.cpp
+++ b/kicker/kicker/ui/k_new_mnu.cpp
@@ -1359,8 +1359,15 @@
     }
 
     bool maysd = false;
+#ifdef COMPILE_HALBACKEND
     if (ksmserver.readBoolEntry( "offerShutdown", true ) && DM().canShutdown())
         maysd = true;
+#else
+    TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice();
+    if( rootDevice ) {
+        maysd = rootDevice->canPowerOff();
+    }
+#endif
 
     if ( maysd )
     {