Move dbus interface definition to interfaces/ and generate dbus files automagically
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 3 Jul 2008 23:20:53 +0000 (01:20 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 22 Jul 2008 19:42:35 +0000 (21:42 +0200)
interfaces/org.freedesktop.Notifications.xml [moved from src/client/org.freedesktop.Notifications.xml with 100% similarity]
src/client/CMakeLists.txt
src/client/desktopnotifications.cpp [deleted file]
src/client/desktopnotifications.h [deleted file]
src/qtui/CMakeLists.txt

index db78880..41721bd 100644 (file)
@@ -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 (file)
index ddbc752..0000000
+++ /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 (file)
index ec26b5f..0000000
+++ /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 <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-
-/*
- * 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<void> CloseNotification(uint id)
-    {
-        QList<QVariant> argumentList;
-        argumentList << qVariantFromValue(id);
-        return callWithArgumentList(QDBus::Block, QLatin1String("CloseNotification"), argumentList);
-    }
-
-    inline QDBusReply<QStringList> GetCapabilities()
-    {
-        QList<QVariant> argumentList;
-        return callWithArgumentList(QDBus::Block, QLatin1String("GetCapabilities"), argumentList);
-    }
-
-    inline QDBusReply<QString> GetServerInformation(QString &vendor, QString &version)
-    {
-        QList<QVariant> argumentList;
-        QDBusMessage reply = callWithArgumentList(QDBus::Block, QLatin1String("GetServerInformation"), argumentList);
-        if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) {
-            vendor = qdbus_cast<QString>(reply.arguments().at(1));
-            version = qdbus_cast<QString>(reply.arguments().at(2));
-        }
-        return reply;
-    }
-
-    inline QDBusReply<uint> 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<QVariant> 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
index 8605c74..a636eb2 100644 (file)
@@ -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)