diff --git a/src/core/interface.h b/src/core/interface.h index f1c0b6f..83df5dd 100644 --- a/src/core/interface.h +++ b/src/core/interface.h @@ -20,6 +20,7 @@ #include "notification/notification.h" namespace Snore{ +class Application; class SNORE_EXPORT SnorePlugin:public QObject { @@ -32,10 +33,10 @@ public: const QString &name() const; protected: - QHash activeNotifications; - void startTimeout(uint id,int timeout); + QHash activeNotifications; + void startTimeout(uint id,int timeout); private slots: - void notificationTimedOut(); + void notificationTimedOut(); private: SnorePlugin() {} @@ -65,12 +66,12 @@ public: public slots: - virtual void registerApplication ( class Application *application ) =0; - virtual void unregisterApplication ( class Application *application ) =0; - virtual uint notify ( Notification notification ) =0; - virtual void closeNotification (Notification notification ) =0; + virtual void registerApplication ( Snore::Application *application ) =0; + virtual void unregisterApplication ( Snore::Application *application ) =0; + virtual uint notify ( Snore::Notification notification ) =0; + virtual void closeNotification ( Snore::Notification notification ) =0; + - // virtual void update }; @@ -84,8 +85,8 @@ public: virtual ~Notification_Frontend(); public slots: - virtual void actionInvoked (Notification notification )=0; - virtual void notificationClosed ( Notification notification )=0; + virtual void actionInvoked( Snore::Notification notification )=0; + virtual void notificationClosed( Snore::Notification notification )=0; }; diff --git a/src/core/notification/icon.cpp b/src/core/notification/icon.cpp index 7686562..372157d 100644 --- a/src/core/notification/icon.cpp +++ b/src/core/notification/icon.cpp @@ -24,8 +24,9 @@ #include namespace Snore{ -class SnoreIcon::SnoreIconData +class SnoreIcon::SnoreIconData : public QObject { + Q_OBJECT public: SnoreIconData(): _isLocalFile(false) @@ -132,4 +133,5 @@ bool SnoreIcon::isEmpty() const{ } } + #include "icon.moc" diff --git a/src/core/notification/notification.cpp b/src/core/notification/notification.cpp index a820afb..1d9638c 100644 --- a/src/core/notification/notification.cpp +++ b/src/core/notification/notification.cpp @@ -29,11 +29,10 @@ static int metaid = qRegisterMetaType(); static int count = 0; -class Notification::NotificationData +class Notification::NotificationData : public QObject { + Q_OBJECT public: - - NotificationData ( uint id=0 ): _id ( id ), _timeout ( 10 ), @@ -248,3 +247,4 @@ QDataStream & operator<< ( QDataStream &stream, const Notification::Action &a) } +#include \ No newline at end of file diff --git a/src/core/snoreserver.cpp b/src/core/snoreserver.cpp index 3be144e..fb21bc8 100644 --- a/src/core/snoreserver.cpp +++ b/src/core/snoreserver.cpp @@ -98,17 +98,17 @@ void SnoreServer::publicatePlugin ( SnorePlugin *plugin ) } else { - connect ( this,SIGNAL ( notify (Notification) ),nb,SLOT ( notify ( Notification ) ) ); + connect ( this,SIGNAL ( notify(Snore::Notification) ),nb,SLOT( notify( Snore::Notification ) ) ); } _notyfier.insert ( pluginName,nb ); - connect ( this,SIGNAL ( closeNotify ( Notification ) ),nb,SLOT ( closeNotification ( Notification) ) ); - connect ( this,SIGNAL ( applicationInitialized ( Application* ) ),nb,SLOT ( registerApplication ( Application* ) ) ); - connect ( this,SIGNAL ( applicationRemoved ( Application* ) ),nb,SLOT ( unregisterApplication ( Application* ) ) ); + connect ( this,SIGNAL( closeNotify( Snore::Notification ) ),nb,SLOT ( closeNotification( Snore::Notification) ) ); + connect ( this,SIGNAL( applicationInitialized( Snore::Application* ) ),nb,SLOT ( registerApplication( Snore::Application* ) ) ); + connect ( this,SIGNAL( applicationRemoved( Snore::Application* ) ),nb,SLOT ( unregisterApplication( Snore::Application* ) ) ); }else{ Notification_Frontend * nf=qobject_cast ( plugin ); if(nf != NULL){ - connect ( this,SIGNAL ( closeNotify ( Notification ) ),nf,SLOT ( notificationClosed( Notification) ) ); + connect ( this,SIGNAL ( closeNotify( Snore::Notification ) ),nf,SLOT ( notificationClosed( Snore::Notification) ) ); } } } @@ -119,7 +119,7 @@ uint SnoreServer::broadcastNotification ( Notification notification ) emit notify ( notification ); if ( _notificationBackend != NULL ) { - notification.setId(_notificationBackend->notify ( notification )); + notification.setId(_notificationBackend->notify( notification )); return notification.id(); } return -1; diff --git a/src/core/snoreserver.h b/src/core/snoreserver.h index b90fdb4..97c9853 100644 --- a/src/core/snoreserver.h +++ b/src/core/snoreserver.h @@ -18,7 +18,6 @@ #define SNORESERVER_H #include "snore_exports.h" -#include "application.h" #include "interface.h" #include @@ -35,7 +34,7 @@ public: static const QString snoreTMP(); public: - SnoreServer (QSystemTrayIcon *trayIcon=0 ); + SnoreServer (QSystemTrayIcon *trayIcon=0 ); void publicatePlugin ( const QString &fileName ); void publicatePlugin ( SnorePlugin *plugin ); @@ -68,11 +67,11 @@ private: signals: - void applicationInitialized ( Application* ); - void applicationRemoved ( Application* ); - void notify ( Notification noti ); - void actionInvoked( Notification ); - void closeNotify ( Notification ); + void applicationInitialized ( Snore::Application* ); + void applicationRemoved ( Snore::Application* ); + void notify ( Snore::Notification noti ); + void actionInvoked( Snore::Notification ); + void closeNotify ( Snore::Notification ); }; diff --git a/src/plugins/freedesktopfrontend/freedesktopnotificationfrontend.cpp b/src/plugins/freedesktopfrontend/freedesktopnotificationfrontend.cpp index 1e32696..4b1ac1e 100644 --- a/src/plugins/freedesktopfrontend/freedesktopnotificationfrontend.cpp +++ b/src/plugins/freedesktopfrontend/freedesktopnotificationfrontend.cpp @@ -25,7 +25,7 @@ #include #ifdef HAVE_KDE -#include +#include #endif using namespace Snore; @@ -70,13 +70,11 @@ uint FreedesktopNotification_Frontend::Notify(const QString &app_name, uint repl hints["image_data"].value()>>image; icon = SnoreIcon(image.toQImage()); } - if(!snore()->aplications().contains(app_name)){ - SnoreIcon appIcon; + if(!snore()->aplications().contains(app_name)){ #ifdef HAVE_KDE - KIcon kicon(app_icon); - appIcon = SnoreIcon(kicon.pixmap(100,100).toImage()); + SnoreIcon appIcon = SnoreIcon(KIconLoader::global()->iconPath(app_icon, KIconLoader::Desktop)); #else - appIcon = SnoreIcon(":/root/images/freedesktop-dbus.png"); + SnoreIcon appIcon = SnoreIcon(":/root/images/freedesktop-dbus.png"); #endif Application *a = new Application(app_name,appIcon); a->addAlert(new Alert("DBus Alert","DBus Alert",appIcon));