Fix stuff in ScreensaverPlugin

This commit is contained in:
Nicolas Fella 2019-05-13 22:35:44 +00:00
parent 2b7026fc10
commit 38c743fcd8

View file

@ -20,11 +20,9 @@
#include "screensaverinhibitplugin.h" #include "screensaverinhibitplugin.h"
#include <QDebug>
#include <KLocalizedString> #include <KLocalizedString>
#include <KPluginFactory> #include <KPluginFactory>
#include <QLoggingCategory> #include <QLoggingCategory>
#include <core/device.h>
#include <QDBusConnection> #include <QDBusConnection>
#include <QDBusInterface> #include <QDBusInterface>
@ -44,7 +42,7 @@ ScreensaverInhibitPlugin::ScreensaverInhibitPlugin(QObject* parent, const QVaria
{ {
QDBusInterface inhibitInterface(INHIBIT_SERVICE, INHIBIT_PATH, INHIBIT_INTERFACE); QDBusInterface inhibitInterface(INHIBIT_SERVICE, INHIBIT_PATH, INHIBIT_INTERFACE);
QDBusMessage reply = inhibitInterface.call(INHIBIT_METHOD, "kdeconnect", "Phone is connected"); QDBusMessage reply = inhibitInterface.call(INHIBIT_METHOD, QStringLiteral("org.kde.kdeconnect.daemon"), i18n("Phone is connected"));
if (reply.errorMessage() != nullptr) { if (reply.errorMessage() != nullptr) {
qCDebug(KDECONNECT_PLUGIN_SCREENSAVERINHIBIT) << "Unable to inhibit the screensaver: " << reply.errorMessage(); qCDebug(KDECONNECT_PLUGIN_SCREENSAVERINHIBIT) << "Unable to inhibit the screensaver: " << reply.errorMessage();
@ -73,7 +71,6 @@ ScreensaverInhibitPlugin::~ScreensaverInhibitPlugin()
void ScreensaverInhibitPlugin::connected() void ScreensaverInhibitPlugin::connected()
{ {
} }
bool ScreensaverInhibitPlugin::receivePacket(const NetworkPacket& np) bool ScreensaverInhibitPlugin::receivePacket(const NetworkPacket& np)
@ -82,5 +79,4 @@ bool ScreensaverInhibitPlugin::receivePacket(const NetworkPacket& np)
return false; return false;
} }
#include "screensaverinhibitplugin.moc" #include "screensaverinhibitplugin.moc"