Skip to content

Commit

Permalink
readability enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
nickylivardo committed Aug 18, 2024
1 parent 66c5f1d commit 8c282b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/optimusmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,12 @@ int OptimusManager::sessionsCountWithoutGdm(const QVector<Session> &sessions)

void OptimusManager::logout()
{
QDBusInterface kde5(QStringLiteral("org.kde.ksmserver"), QStringLiteral("/KSMServer"), QStringLiteral("org.kde.KSMServerInterface"));
QDBusInterface kde6(QStringLiteral("org.kde.Shutdown"), QStringLiteral("/Shutdown"));
if (kde6.call(QStringLiteral("logout")).type() == QDBusMessage::ReplyMessage || kde5.call(QStringLiteral("logout"), 0, 3, 3).type() == QDBusMessage::ReplyMessage)
if (kde6.call(QStringLiteral("logout")).type() == QDBusMessage::ReplyMessage)
return;

QDBusInterface kde5(QStringLiteral("org.kde.ksmserver"), QStringLiteral("/KSMServer"), QStringLiteral("org.kde.KSMServerInterface"));
if (kde5.call(QStringLiteral("logout"), 0, 3, 3).type() == QDBusMessage::ReplyMessage)
return;

QDBusInterface gnome(QStringLiteral("org.gnome.SessionManager"), QStringLiteral("/org/gnome/SessionManager"), QStringLiteral("org.gnome.SessionManager"));
Expand Down

0 comments on commit 8c282b6

Please sign in to comment.