no longer rely on ecm_qt_declare_logging_category

This commit is contained in:
2025-12-25 15:13:46 +08:00
parent faf5b43e2b
commit 866b81a3dc
6 changed files with 38 additions and 43 deletions

View File

@@ -4,32 +4,35 @@
*/
#include "traymanager1.h"
#include "debug.h"
#include "traymanager1adaptor.h"
#include <KWindowInfo>
#include <QGuiApplication>
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(TRAYMGR, "org.deepin.dde.trayloader.traymgr")
TrayManager1::TrayManager1(QObject *parent)
: QObject(parent)
, m_adaptor(new TrayManager1Adaptor(this))
{
qCDebug(SNIPROXY) << "TrayManager1 created";
qCDebug(TRAYMGR) << "TrayManager1 created";
}
TrayManager1::~TrayManager1()
{
qCDebug(SNIPROXY) << "TrayManager1 destroyed";
qCDebug(TRAYMGR) << "TrayManager1 destroyed";
}
void TrayManager1::registerIcon(xcb_window_t win)
{
if (m_icons.contains(win)) {
qCWarning(SNIPROXY) << "Icon already registered:" << win;
qCWarning(TRAYMGR) << "Icon already registered:" << win;
return;
}
m_icons[win] = true;
qCDebug(SNIPROXY) << "Icon registered:" << win ;//<< "name:" << proxy->name();
qCDebug(TRAYMGR) << "Icon registered:" << win ;//<< "name:" << proxy->name();
Q_EMIT Added(static_cast<uint32_t>(win));
}
@@ -37,12 +40,12 @@ void TrayManager1::registerIcon(xcb_window_t win)
void TrayManager1::unregisterIcon(xcb_window_t win)
{
if (!m_icons.contains(win)) {
qCWarning(SNIPROXY) << "Icon not found for removal:" << win;
qCWarning(TRAYMGR) << "Icon not found for removal:" << win;
return;
}
m_icons.remove(win);
qCDebug(SNIPROXY) << "Icon unregistered:" << win;
qCDebug(TRAYMGR) << "Icon unregistered:" << win;
Q_EMIT Removed(static_cast<uint32_t>(win));
}
@@ -54,11 +57,11 @@ void TrayManager1::notifyIconChanged(xcb_window_t win)
}
if (!m_icons[win]) {
qCDebug(SNIPROXY) << "EnableNotification is false, not sending changed signal for:" << win;
qCDebug(TRAYMGR) << "EnableNotification is false, not sending changed signal for:" << win;
return;
}
qCDebug(SNIPROXY) << "Icon changed:" << win;
qCDebug(TRAYMGR) << "Icon changed:" << win;
Q_EMIT Changed(static_cast<uint32_t>(win));
}
@@ -80,7 +83,7 @@ bool TrayManager1::haveIcon(xcb_window_t win) const
// DBus method implementations
bool TrayManager1::Manage()
{
qCDebug(SNIPROXY) << "Manage() called via DBus";
qCDebug(TRAYMGR) << "Manage() called via DBus";
return true;
}
@@ -99,5 +102,5 @@ void TrayManager1::EnableNotification(uint32_t win, bool enabled)
m_icons[win] = enabled;
qCDebug(SNIPROXY) << "EnableNotification for" << win << "=" << enabled;
qCDebug(TRAYMGR) << "EnableNotification for" << win << "=" << enabled;
}