Commit db562134 authored by Nate Graham's avatar Nate Graham
Browse files

Port to QDBusMessage::createMethodCall() and also new DBus reboot message

parent dbef6113
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include <QSessionManager> #include <QSessionManager>
#include <QClipboard> #include <QClipboard>
#include <QDBusConnection> #include <QDBusConnection>
#include <QDBusInterface> #include <QDBusMessage>
#include <QDBusPendingCall> #include <QDBusPendingCall>
// KDE includes // KDE includes
...@@ -518,8 +518,12 @@ void DiscoverObject::showPassiveNotification(const QString& msg) ...@@ -518,8 +518,12 @@ void DiscoverObject::showPassiveNotification(const QString& msg)
void DiscoverObject::reboot() void DiscoverObject::reboot()
{ {
QDBusInterface interface(QStringLiteral("org.kde.ksmserver"), QStringLiteral("/KSMServer"), QStringLiteral("org.kde.KSMServerInterface"), QDBusConnection::sessionBus()); QDBusConnection::sessionBus().asyncCall(
interface.asyncCall(QStringLiteral("logout"), 1, 1, 2); // Options: confirm first | reboot | force QDBusMessage::createMethodCall(QStringLiteral("org.kde.LogoutPrompt"),
QStringLiteral("/LogoutPrompt"),
QStringLiteral("org.kde.LogoutPrompt"),
QStringLiteral("promptReboot"))
);
} }
QRect DiscoverObject::initialGeometry() const QRect DiscoverObject::initialGeometry() const
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#include "DiscoverNotifier.h" #include "DiscoverNotifier.h"
#include "BackendNotifierFactory.h" #include "BackendNotifierFactory.h"
#include <QDebug> #include <QDebug>
#include <QDBusInterface> #include <QDBusConnection>
#include <QDBusPendingReply> #include <QDBusPendingCall>
#include <QDBusMessage>
#include <QNetworkConfigurationManager> #include <QNetworkConfigurationManager>
#include <KLocalizedString> #include <KLocalizedString>
#include <KNotification> #include <KNotification>
...@@ -206,8 +207,12 @@ void DiscoverNotifier::showRebootNotification() ...@@ -206,8 +207,12 @@ void DiscoverNotifier::showRebootNotification()
void DiscoverNotifier::reboot() void DiscoverNotifier::reboot()
{ {
QDBusInterface interface(QStringLiteral("org.kde.ksmserver"), QStringLiteral("/KSMServer"), QStringLiteral("org.kde.KSMServerInterface"), QDBusConnection::sessionBus()); QDBusConnection::sessionBus().asyncCall(
interface.asyncCall(QStringLiteral("logout"), 1, 1, 2); // Options: confirm first | reboot | force QDBusMessage::createMethodCall(QStringLiteral("org.kde.LogoutPrompt"),
QStringLiteral("/LogoutPrompt"),
QStringLiteral("org.kde.LogoutPrompt"),
QStringLiteral("promptReboot"))
);
} }
void DiscoverNotifier::foundUpgradeAction(UpgradeAction* action) void DiscoverNotifier::foundUpgradeAction(UpgradeAction* action)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment