X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fstatusnotifieritemdbus.cpp;h=893b24dd7a9023082ab908cd2f2a5907ea7a3f22;hb=dd8d82a90c136fa1e56d7f72781881cd5099574f;hp=28f5ddabbfc92bb68599e3e66488de59c7ac49c0;hpb=9337b0bdce0bff71a9ea08cc630ce065028fe389;p=quassel.git diff --git a/src/qtui/statusnotifieritemdbus.cpp b/src/qtui/statusnotifieritemdbus.cpp index 28f5ddab..893b24dd 100644 --- a/src/qtui/statusnotifieritemdbus.cpp +++ b/src/qtui/statusnotifieritemdbus.cpp @@ -4,9 +4,9 @@ * Quasselfied 2010 by Manuel Nickschas * * * * This file is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * it under the terms of the GNU Library General Public License (LGPL) * + * as published by the Free Software Foundation; either version 2 of the * + * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -39,18 +39,18 @@ #include "statusnotifierwatcher.h" #include "statusnotifieritemadaptor.h" -#ifdef Q_OS_WIN64 -__inline int toInt(WId wid) +#ifdef Q_OS_WIN64 +__inline int toInt(WId wid) { return (int)((__int64)wid); } #else -__inline int toInt(WId wid) +__inline int toInt(WId wid) { return (int)wid; } -#endif +#endif // Marshall the ImageStruct data into a D-BUS argument const QDBusArgument &operator<<(QDBusArgument &argument, const DBusImageStruct &icon) @@ -162,7 +162,6 @@ StatusNotifierItemDBus::StatusNotifierItemDBus(StatusNotifierItem *parent) new StatusNotifierItemAdaptor(this); //qDebug() << "service is" << m_service; registerService(); - m_dbus.registerObject("/StatusNotifierItem", this); } StatusNotifierItemDBus::~StatusNotifierItemDBus() @@ -170,12 +169,18 @@ StatusNotifierItemDBus::~StatusNotifierItemDBus() unregisterService(); } +QDBusConnection StatusNotifierItemDBus::dbusConnection() const +{ + return m_dbus; +} + // FIXME: prevent double registrations, also test this on platforms != KDE // void StatusNotifierItemDBus::registerService() { //qDebug() << "registering to" << m_service; m_dbus.registerService(m_service); + m_dbus.registerObject("/StatusNotifierItem", this); } // FIXME: see above @@ -183,6 +188,7 @@ void StatusNotifierItemDBus::unregisterService() { //qDebug() << "unregistering from" << m_service; if(m_dbus.isConnected()) { + m_dbus.unregisterObject("/StatusNotifierItem"); m_dbus.unregisterService(m_service); } } @@ -275,6 +281,19 @@ DBusToolTipStruct StatusNotifierItemDBus::ToolTip() const return toolTip; } +QString StatusNotifierItemDBus::IconThemePath() const +{ + return m_statusNotifierItem->iconThemePath(); +} + +//Menu + +QDBusObjectPath StatusNotifierItemDBus::Menu() const +{ + return QDBusObjectPath(m_statusNotifierItem->menuObjectPath()); +} + + //Interaction void StatusNotifierItemDBus::ContextMenu(int x, int y)