fixed linux build

This commit is contained in:
Patrick von Reth 2012-01-31 11:44:26 +01:00
parent e236763168
commit 1c109f1041
5 changed files with 29 additions and 25 deletions

View File

@ -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);

View File

@ -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;
}
}

View File

@ -1,5 +1,7 @@
#ifndef VERSION_H
#define VERSION_H
#undef major
#undef minor
#include "snore_exports.h"

View File

@ -6,8 +6,10 @@
#include <QtCore>
#include <QImage>
#include "fredesktopnotification.h"
#include "core/snoreserver.h"
#include <QtDBus>
#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 )

View File

@ -1,30 +1,30 @@
#ifndef FREEDESKTOPNOTIFICATION_H
#define FREEDESKTOPNOTIFICATION_H
#include "core/interface.h"
#include "core/plugins/snorebackend.h"
#include <QtDBus>
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) ;