Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QDBusInterface>
- #include <QDebug>
- int main()
- {
- QDBusInterface kde("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface", QDBusConnection::systemBus());
- kde.call("logout", 0, 3, 3);
- qDebug() << "KDE: " << kde.isValid();
- QDBusInterface gnome("org.gnome.SessionManager", "/org/gnome/SessionManager", "org.gnome.SessionManager", QDBusConnection::systemBus());
- gnome.call("Logout", 1);
- qDebug() << "Gnome: " << gnome.isValid();
- QDBusInterface xfce("org.xfce.SessionManager", "/org/xfce/SessionManager", "org.xfce.Session.Manager", QDBusConnection::systemBus());
- xfce.call("Logout", false, true);
- qDebug() << "XFCE: " << xfce.isValid();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement