diff --git a/src/core/plugins/snorebackend.cpp b/src/core/plugins/snorebackend.cpp index d910563..11742bd 100644 --- a/src/core/plugins/snorebackend.cpp +++ b/src/core/plugins/snorebackend.cpp @@ -41,9 +41,9 @@ bool SnoreBackend::init( SnoreCore *snore ) { if(!SnorePlugin::init(snore)) return false; - connect( snore,SIGNAL( closeNotify( SnoreCore::Notification ) ),this,SLOT( closeNotification( SnoreCore::Notification) ) ); - connect( snore,SIGNAL( applicationInitialized( SnoreCore::Application* ) ),this,SLOT( registerApplication( SnoreCore::Application* ) ) ); - connect( snore,SIGNAL( applicationRemoved( SnoreCore::Application* ) ),this,SLOT( unregisterApplication( SnoreCore::Application* ) ) ); + connect( snore,SIGNAL( closeNotify( Snore::Notification ) ),this,SLOT( closeNotification( Snore::Notification) ) ); + connect( snore,SIGNAL( applicationInitialized( Snore::Application* ) ),this,SLOT( registerApplication( Snore::Application* ) ) ); + connect( snore,SIGNAL( applicationRemoved( Snore::Application* ) ),this,SLOT( unregisterApplication( Snore::Application* ) ) ); foreach(Application *a,snore->aplications()){ this->registerApplication(a); diff --git a/src/core/plugins/snorefrontend.cpp b/src/core/plugins/snorefrontend.cpp index cdfe0ef..2fe696a 100644 --- a/src/core/plugins/snorefrontend.cpp +++ b/src/core/plugins/snorefrontend.cpp @@ -39,7 +39,7 @@ bool SnoreFrontend::init( SnoreCore *snore ) { if(!SnorePlugin::init(snore)) return false; - connect( snore,SIGNAL ( closeNotify( SnoreCore::Notification ) ),this,SLOT ( notificationClosed( SnoreCore::Notification) ) ); + connect( snore,SIGNAL ( closeNotify( Snore::Notification ) ),this,SLOT ( notificationClosed( Snore::Notification) ) ); return true; } } diff --git a/src/core/version.h b/src/core/version.h index 6ef1132..fd66d2a 100644 --- a/src/core/version.h +++ b/src/core/version.h @@ -1,5 +1,7 @@ #ifndef VERSION_H #define VERSION_H +#undef major +#undef minor #include "snore_exports.h" diff --git a/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp b/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp index 2df28ce..6c760a1 100644 --- a/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp +++ b/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp @@ -6,8 +6,10 @@ #include #include #include "fredesktopnotification.h" -#include "core/snoreserver.h" -#include +#include "core/snore.h" + + +using namespace Snore; Q_EXPORT_PLUGIN2 ( freedesktopnotificationbackend,FreedesktopNotification_Backend ) @@ -16,18 +18,18 @@ static const char dbusInterfaceName[] = "org.freedesktop.Notifications"; static const char dbusPath[] = "/org/freedesktop/Notifications"; -FreedesktopNotification_Backend::FreedesktopNotification_Backend ( SnoreServer *snore ) : - Notification_Backend ( "FreedesktopNotification_Backend",snore ) +FreedesktopNotification_Backend::FreedesktopNotification_Backend () : + SnoreBackend ( "FreedesktopNotification_Backend") { - QDBusConnection::sessionBus().connect ( "org.freedesktop.Notifications","/org/freedesktop/Notifications","org.freedesktop.Notifications","ActionInvoked",this,SLOT ( actionInvoked( uint,QString ) ) ); - // if ( getVendor() =="GNOME" ) - QDBusConnection::sessionBus().connect ( "org.freedesktop.Notifications","/org/freedesktop/Notifications","org.freedesktop.Notifications","NotificationClosed",this,SLOT ( closed ( uint,uint ) ) ); + } -bool FreedesktopNotification_Backend::isPrimaryNotificationBackend() -{ - return true; +bool FreedesktopNotification_Backend::init(SnoreCore *snore){ + QDBusConnection::sessionBus().connect ( "org.freedesktop.Notifications","/org/freedesktop/Notifications","org.freedesktop.Notifications","ActionInvoked",this,SLOT ( actionInvoked( uint,QString ) ) ); + // if ( getVendor() =="GNOME" ) + QDBusConnection::sessionBus().connect ( "org.freedesktop.Notifications","/org/freedesktop/Notifications","org.freedesktop.Notifications","NotificationClosed",this,SLOT ( closed ( uint,uint ) ) ); + return SnoreBackend::init(snore); } void FreedesktopNotification_Backend::registerApplication ( Application *application ) diff --git a/src/plugins/backends/freedesktop/freedesktopnotification_backend.h b/src/plugins/backends/freedesktop/freedesktopnotification_backend.h index e12ddc7..6b99431 100644 --- a/src/plugins/backends/freedesktop/freedesktopnotification_backend.h +++ b/src/plugins/backends/freedesktop/freedesktopnotification_backend.h @@ -1,30 +1,30 @@ #ifndef FREEDESKTOPNOTIFICATION_H #define FREEDESKTOPNOTIFICATION_H -#include "core/interface.h" +#include "core/plugins/snorebackend.h" #include class fNotification; -class FreedesktopNotification_Backend:public Notification_Backend +class FreedesktopNotification_Backend:public Snore::SnoreBackend { Q_OBJECT - Q_INTERFACES ( Notification_Backend ) + Q_INTERFACES ( Snore::SnoreBackend ) public: - FreedesktopNotification_Backend ( class SnoreServer *snore=0 ); - bool isPrimaryNotificationBackend(); + FreedesktopNotification_Backend (); + virtual bool init(Snore::SnoreCore *snore); public slots: - void registerApplication ( Application *application ); - void unregisterApplication ( Application *application ); - uint notify ( Notification notification ); - void closeNotification ( Notification notification ); + void registerApplication ( Snore::Application *application ); + void unregisterApplication ( Snore::Application *application ); + uint notify ( Snore::Notification notification ); + void closeNotification ( Snore::Notification notification ); void actionInvoked(const uint &id,const QString &actionID); void closed ( const uint &id,const uint &reason ); }; -QDBusArgument &operator<<(QDBusArgument &a,const Notification &i); -const QDBusArgument & operator >>(const QDBusArgument &a, Notification &i) ; +QDBusArgument &operator<<(QDBusArgument &a,const Snore::Notification &i); +const QDBusArgument & operator >>(const QDBusArgument &a, Snore::Notification &i) ;