From 2f83cb6d01ff68131528797020637887fe0e77b7 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Fri, 4 Jul 2008 01:20:53 +0200 Subject: [PATCH] Move dbus interface definition to interfaces/ and generate dbus files automagically --- .../org.freedesktop.Notifications.xml | 0 src/client/CMakeLists.txt | 2 - src/client/desktopnotifications.cpp | 26 ------ src/client/desktopnotifications.h | 80 ------------------- src/qtui/CMakeLists.txt | 3 +- 5 files changed, 2 insertions(+), 109 deletions(-) rename {src/client => interfaces}/org.freedesktop.Notifications.xml (100%) delete mode 100644 src/client/desktopnotifications.cpp delete mode 100644 src/client/desktopnotifications.h diff --git a/src/client/org.freedesktop.Notifications.xml b/interfaces/org.freedesktop.Notifications.xml similarity index 100% rename from src/client/org.freedesktop.Notifications.xml rename to interfaces/org.freedesktop.Notifications.xml diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index db788800..41721bde 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -15,7 +15,6 @@ set(SOURCES clientirclisthelper.cpp clientsettings.cpp clientsyncer.cpp - desktopnotifications.cpp irclistmodel.cpp mappedselectionmodel.cpp networkmodel.cpp @@ -30,7 +29,6 @@ set(MOC_HDRS clientcoreinfo.h clientirclisthelper.h clientsyncer.h - desktopnotifications.h irclistmodel.h networkmodel.h mappedselectionmodel.h diff --git a/src/client/desktopnotifications.cpp b/src/client/desktopnotifications.cpp deleted file mode 100644 index ddbc7529..00000000 --- a/src/client/desktopnotifications.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file was generated by dbusxml2cpp version 0.6 - * Command line was: dbusxml2cpp -p desktopnotifications org.freedesktop.Notifications.xml - * - * dbusxml2cpp is Copyright (C) 2006 Trolltech ASA. All rights reserved. - * - * This is an auto-generated file. - * This file may have been hand-edited. Look for HAND-EDIT comments - * before re-generating it. - */ - -#include "desktopnotifications.h" - -/* - * Implementation of interface class OrgFreedesktopNotificationsInterface - */ - -OrgFreedesktopNotificationsInterface::OrgFreedesktopNotificationsInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) - : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) -{ -} - -OrgFreedesktopNotificationsInterface::~OrgFreedesktopNotificationsInterface() -{ -} - diff --git a/src/client/desktopnotifications.h b/src/client/desktopnotifications.h deleted file mode 100644 index ec26b5fe..00000000 --- a/src/client/desktopnotifications.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * This file was generated by dbusxml2cpp version 0.6 - * Command line was: dbusxml2cpp -p desktopnotifications org.freedesktop.Notifications.xml - * - * dbusxml2cpp is Copyright (C) 2006 Trolltech ASA. All rights reserved. - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#ifndef DESKTOPNOTIFICATIONS_H_1211193208 -#define DESKTOPNOTIFICATIONS_H_1211193208 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface org.freedesktop.Notifications - */ -class OrgFreedesktopNotificationsInterface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "org.freedesktop.Notifications"; } - -public: - OrgFreedesktopNotificationsInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); - - ~OrgFreedesktopNotificationsInterface(); - -public Q_SLOTS: // METHODS - inline QDBusReply CloseNotification(uint id) - { - QList argumentList; - argumentList << qVariantFromValue(id); - return callWithArgumentList(QDBus::Block, QLatin1String("CloseNotification"), argumentList); - } - - inline QDBusReply GetCapabilities() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("GetCapabilities"), argumentList); - } - - inline QDBusReply GetServerInformation(QString &vendor, QString &version) - { - QList argumentList; - QDBusMessage reply = callWithArgumentList(QDBus::Block, QLatin1String("GetServerInformation"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) { - vendor = qdbus_cast(reply.arguments().at(1)); - version = qdbus_cast(reply.arguments().at(2)); - } - return reply; - } - - inline QDBusReply Notify(const QString &app_name, uint replaces_id, const QString &app_icon, const QString &summary, const QString &body, const QStringList &actions, const QVariantMap &hints, int expire_timeout) - { - QList argumentList; - argumentList << qVariantFromValue(app_name) << qVariantFromValue(replaces_id) << qVariantFromValue(app_icon) << qVariantFromValue(summary) << qVariantFromValue(body) << qVariantFromValue(actions) << qVariantFromValue(hints) << qVariantFromValue(expire_timeout); - return callWithArgumentList(QDBus::Block, QLatin1String("Notify"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void ActionInvoked(uint id, const QString &action); - void NotificationClosed(uint id, uint reason); -}; - -namespace org { - namespace freedesktop { - typedef ::OrgFreedesktopNotificationsInterface Notifications; - } -} -#endif diff --git a/src/qtui/CMakeLists.txt b/src/qtui/CMakeLists.txt index 8605c746..a636eb20 100644 --- a/src/qtui/CMakeLists.txt +++ b/src/qtui/CMakeLists.txt @@ -105,6 +105,7 @@ endforeach(FRM ${SP_FORMS}) qt4_wrap_cpp(MOC ${MOC_HDRS} ${SPHDR}) qt4_wrap_ui(UI ${FORMPATH} ${SPFRM}) +qt4_add_dbus_interface(DBUS ../../interfaces/org.freedesktop.Notifications.xml desktopnotifications) include_directories(${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/src/client @@ -112,5 +113,5 @@ include_directories(${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/src/uisupport ${CMAKE_CURRENT_BINARY_DIR}) -add_library(mod_qtui STATIC ${SOURCES} ${SPSRC} ${MOC} ${UI} ${HEADERS}) +add_library(mod_qtui STATIC ${SOURCES} ${SPSRC} ${MOC} ${DBUS} ${UI} ${HEADERS}) add_dependencies(mod_qtui mod_common mod_client mod_uisupport) -- 2.20.1