summary refs log tree commit diff
path: root/src/dock
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-06-05 16:26:31 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-06-05 16:26:31 +0200
commit9649c20fc68b39772608010ce291160b0eb7a521 (patch)
tree963d6540006714681f112acbbe4871d382b912d1 /src/dock
parentUnread messages count as an Unity compatible badge (#1085) (diff)
downloadnheko-9649c20fc68b39772608010ce291160b0eb7a521.tar.xz
Add some logging to dock
Diffstat (limited to 'src/dock')
-rw-r--r--src/dock/Dock.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/dock/Dock.cpp b/src/dock/Dock.cpp

index 04c7507d..4dedf94f 100644 --- a/src/dock/Dock.cpp +++ b/src/dock/Dock.cpp
@@ -3,8 +3,11 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include "dock/Dock.h" + #include <QApplication> -#include <QObject> + +#include "Logging.h" + #if defined(NHEKO_DBUS_SYS) #include <qdbusconnectioninterface.h> Dock::Dock(QObject *parent) @@ -21,6 +24,7 @@ Dock::Dock(QObject *parent) [this](const QString &service) { Q_UNUSED(service); unityServiceAvailable = true; + nhlog::ui()->info("Unity service available: {}", unityServiceAvailable); }); connect(unityServiceWatcher, &QDBusServiceWatcher::serviceUnregistered, @@ -28,6 +32,7 @@ Dock::Dock(QObject *parent) [this](const QString &service) { Q_UNUSED(service); unityServiceAvailable = false; + nhlog::ui()->info("Unity service available: {}", unityServiceAvailable); }); QDBusPendingCall listNamesCall = QDBusConnection::sessionBus().interface()->asyncCall(QStringLiteral("ListNames")); @@ -40,12 +45,14 @@ Dock::Dock(QObject *parent) watcher->deleteLater(); if (reply.isError()) { + nhlog::ui()->error("Failed to list dbus names"); return; } const QStringList &services = reply.value(); unityServiceAvailable = services.contains(QLatin1String("com.canonical.Unity")); + nhlog::ui()->info("Unity service available: {}", unityServiceAvailable); }); } @@ -58,7 +65,8 @@ void Dock::unitySetNotificationCount(const int count) { if (unityServiceAvailable) { - const QString launcherId = qApp->desktopFileName() + QLatin1String(".desktop"); + const QString launcherId = + QLatin1String("application://%1.desktop").arg(qApp->desktopFileName()); const QVariantMap properties{{QStringLiteral("count-visible"), count > 0}, {QStringLiteral("count"), count}};