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();