From 1d25d0dbfc2c58cdfd8fbf4f7f7cd2b20cb9d083 Mon Sep 17 00:00:00 2001 From: Thomas Uhle Date: Sat, 6 Jun 2020 18:55:36 +0200 Subject: [PATCH] Use QGuiApplication::applicationDisplayName() as application name Using a consistent spelling of the application name (w.r.t. case-sensitivity) whenever communicating with the desktop environment is common practice to always have the same name displayed (as window title, in a window switcher dialog, etc.). That is also what already has been done in Notify::show(). --- dbus/powermanagement.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dbus/powermanagement.cpp b/dbus/powermanagement.cpp index 8da653017..6b873be41 100644 --- a/dbus/powermanagement.cpp +++ b/dbus/powermanagement.cpp @@ -28,6 +28,7 @@ #include "upowerinterface.h" #include "login1interface.h" #include "mpd-interface/mpdstatus.h" +#include #include GLOBAL_STATIC(PowerManagement, instance) @@ -77,17 +78,17 @@ void PowerManagement::beginSuppressingSleep() QString reason=tr("Cantata is playing a track"); QDBusReply reply; if (policy->isValid()) { - reply = policy->AddInhibition((uint)1, QCoreApplication::applicationName(), reason); + reply = policy->AddInhibition((uint)1, QGuiApplication::applicationDisplayName(), reason); } else { // Fallback to the fd.o Inhibit interface - reply = inhibit->Inhibit(QCoreApplication::applicationName(), reason); + reply = inhibit->Inhibit(QGuiApplication::applicationDisplayName(), reason); } cookie=reply.isValid() ? reply : -1; QString types=QStringLiteral("sleep"); QString mode=QStringLiteral("block"); QDBusPendingReply futureReply; - futureReply = login1->Inhibit(types, QCoreApplication::applicationName(), reason, mode); + futureReply = login1->Inhibit(types, QGuiApplication::applicationDisplayName(), reason, mode); futureReply.waitForFinished(); if (futureReply.isValid()) { descriptor=futureReply.value();