remove traymanagerproxy
This commit is contained in:
@@ -4,10 +4,11 @@
|
||||
*/
|
||||
|
||||
#include "traymanager1.h"
|
||||
#include "traymanagerproxy.h"
|
||||
#include "debug.h"
|
||||
#include "traymanager1adaptor.h"
|
||||
|
||||
#include <KWindowInfo>
|
||||
#include <QGuiApplication>
|
||||
TrayManager1::TrayManager1(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_adaptor(new TrayManager1Adaptor(this))
|
||||
@@ -20,15 +21,15 @@ TrayManager1::~TrayManager1()
|
||||
qCDebug(SNIPROXY) << "TrayManager1 destroyed";
|
||||
}
|
||||
|
||||
void TrayManager1::registerIcon(xcb_window_t win, TrayManagerProxy *proxy)
|
||||
void TrayManager1::registerIcon(xcb_window_t win)
|
||||
{
|
||||
if (m_icons.contains(win)) {
|
||||
qCWarning(SNIPROXY) << "Icon already registered:" << win;
|
||||
return;
|
||||
}
|
||||
|
||||
m_icons[win] = proxy;
|
||||
qCDebug(SNIPROXY) << "Icon registered:" << win << "name:" << proxy->name();
|
||||
m_icons[win] = true;
|
||||
qCDebug(SNIPROXY) << "Icon registered:" << win ;//<< "name:" << proxy->name();
|
||||
|
||||
Q_EMIT Added(static_cast<uint32_t>(win));
|
||||
}
|
||||
@@ -66,9 +67,9 @@ TrayList TrayManager1::trayIcons() const
|
||||
return result;
|
||||
}
|
||||
|
||||
TrayManagerProxy *TrayManager1::iconProxy(xcb_window_t win) const
|
||||
bool TrayManager1::haveIcon(xcb_window_t win) const
|
||||
{
|
||||
return m_icons.value(win, nullptr);
|
||||
return m_icons.contains(win);
|
||||
}
|
||||
|
||||
// DBus method implementations
|
||||
@@ -80,17 +81,13 @@ bool TrayManager1::Manage()
|
||||
|
||||
QString TrayManager1::GetName(uint32_t win)
|
||||
{
|
||||
auto proxy = m_icons.value(static_cast<xcb_window_t>(win), nullptr);
|
||||
if (proxy) {
|
||||
return proxy->name();
|
||||
}
|
||||
return QString();
|
||||
auto connection = qGuiApp->nativeInterface<QNativeInterface::QX11Application>()->connection();
|
||||
KWindowInfo info(win, NET::WMName | NET::WMIconName);
|
||||
return info.name();
|
||||
}
|
||||
|
||||
void TrayManager1::EnableNotification(uint32_t win, bool enabled)
|
||||
{
|
||||
auto proxy = m_icons.value(static_cast<xcb_window_t>(win), nullptr);
|
||||
if (proxy) {
|
||||
qCDebug(SNIPROXY) << "EnableNotification for" << win << "=" << enabled;
|
||||
}
|
||||
// TODO: Implement
|
||||
qCDebug(SNIPROXY) << "TODO: EnableNotification for" << win << "=" << enabled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user