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 @@
#include <QSessionManager>
#include <QClipboard>
#include <QDBusConnection>
#include <QDBusInterface>
#include <QDBusMessage>
#include <QDBusPendingCall>
// KDE includes
......@@ -518,8 +518,12 @@ void DiscoverObject::showPassiveNotification(const QString& msg)
void DiscoverObject::reboot()
{
QDBusInterface interface(QStringLiteral("org.kde.ksmserver"), QStringLiteral("/KSMServer"), QStringLiteral("org.kde.KSMServerInterface"), QDBusConnection::sessionBus());
interface.asyncCall(QStringLiteral("logout"), 1, 1, 2); // Options: confirm first | reboot | force
QDBusConnection::sessionBus().asyncCall(
QDBusMessage::createMethodCall(QStringLiteral("org.kde.LogoutPrompt"),
QStringLiteral("/LogoutPrompt"),
QStringLiteral("org.kde.LogoutPrompt"),
QStringLiteral("promptReboot"))
);
}
QRect DiscoverObject::initialGeometry() const
......
......@@ -21,8 +21,9 @@
#include "DiscoverNotifier.h"
#include "BackendNotifierFactory.h"
#include <QDebug>
#include <QDBusInterface>
#include <QDBusPendingReply>
#include <QDBusConnection>
#include <QDBusPendingCall>
#include <QDBusMessage>
#include <QNetworkConfigurationManager>
#include <KLocalizedString>
#include <KNotification>
......@@ -206,8 +207,12 @@ void DiscoverNotifier::showRebootNotification()
void DiscoverNotifier::reboot()
{
QDBusInterface interface(QStringLiteral("org.kde.ksmserver"), QStringLiteral("/KSMServer"), QStringLiteral("org.kde.KSMServerInterface"), QDBusConnection::sessionBus());
interface.asyncCall(QStringLiteral("logout"), 1, 1, 2); // Options: confirm first | reboot | force
QDBusConnection::sessionBus().asyncCall(
QDBusMessage::createMethodCall(QStringLiteral("org.kde.LogoutPrompt"),
QStringLiteral("/LogoutPrompt"),
QStringLiteral("org.kde.LogoutPrompt"),
QStringLiteral("promptReboot"))
);
}
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