--- a/trunk/kshutdown2/src/kshutdown.cpp
+++ b/trunk/kshutdown2/src/kshutdown.cpp
@@ -1143,19 +1143,18 @@
type,
KWorkSpace::ShutdownModeForceNow
);
-
+
if (!m_kdeShutDownAvailable) {
U_DEBUG << "No KDE ShutDown API available" U_END;
- error = "Check \"Offer shutdown options\"
in the \"Session Management\" settings
(KDE System Settings).";
+ if (error.isEmpty())
+ error = "Check \"Offer shutdown options\"
in the \"Session Management\" settings
(KDE System Settings).";
}
}
#endif // KS_NATIVE_KDE
#ifdef KS_DBUS
if (!consoleKitName.isEmpty()) {
- error = ""; // reset
-
if (!m_consoleKitInterface) {
m_consoleKitInterface = new QDBusInterface(
"org.freedesktop.ConsoleKit",
@@ -1168,7 +1167,8 @@
QDBusReply reply = m_consoleKitInterface->call(consoleKitName);
if (!reply.isValid()) {
U_ERROR << reply.error().message() U_END;
- error = reply.error().name();
+ if (error.isEmpty())
+ error = reply.error().name();
}
else {
available = reply.value();
@@ -1177,7 +1177,8 @@
else {
// FIXME: this sometimes returns error (service timeout?)
U_ERROR << "ConsoleKit Error:" << m_consoleKitInterface->lastError().message() U_END;
- error = "No valid org.freedesktop.ConsoleKit interface found";
+ if (error.isEmpty())
+ error = "No valid org.freedesktop.ConsoleKit interface found";
}
}
@@ -1199,8 +1200,14 @@
}
#endif // KS_DBUS
+ #ifdef KS_NATIVE_KDE
+ // BUG #19 - disable only if both ConsoleKit and native KDE API is unavailable
+ if (!available && !m_kdeShutDownAvailable)
+ disable(error);
+ #else
if (!available)
disable(error);
+ #endif // KS_NATIVE_KDE
}
// LogoutAction