mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-20 12:08:21 +00:00
fixed linux build
This commit is contained in:
parent
e236763168
commit
1c109f1041
@ -41,9 +41,9 @@ bool SnoreBackend::init( SnoreCore *snore )
|
|||||||
{
|
{
|
||||||
if(!SnorePlugin::init(snore))
|
if(!SnorePlugin::init(snore))
|
||||||
return false;
|
return false;
|
||||||
connect( snore,SIGNAL( closeNotify( SnoreCore::Notification ) ),this,SLOT( closeNotification( SnoreCore::Notification) ) );
|
connect( snore,SIGNAL( closeNotify( Snore::Notification ) ),this,SLOT( closeNotification( Snore::Notification) ) );
|
||||||
connect( snore,SIGNAL( applicationInitialized( SnoreCore::Application* ) ),this,SLOT( registerApplication( SnoreCore::Application* ) ) );
|
connect( snore,SIGNAL( applicationInitialized( Snore::Application* ) ),this,SLOT( registerApplication( Snore::Application* ) ) );
|
||||||
connect( snore,SIGNAL( applicationRemoved( SnoreCore::Application* ) ),this,SLOT( unregisterApplication( SnoreCore::Application* ) ) );
|
connect( snore,SIGNAL( applicationRemoved( Snore::Application* ) ),this,SLOT( unregisterApplication( Snore::Application* ) ) );
|
||||||
|
|
||||||
foreach(Application *a,snore->aplications()){
|
foreach(Application *a,snore->aplications()){
|
||||||
this->registerApplication(a);
|
this->registerApplication(a);
|
||||||
|
@ -39,7 +39,7 @@ bool SnoreFrontend::init( SnoreCore *snore )
|
|||||||
{
|
{
|
||||||
if(!SnorePlugin::init(snore))
|
if(!SnorePlugin::init(snore))
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#ifndef VERSION_H
|
#ifndef VERSION_H
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
#undef major
|
||||||
|
#undef minor
|
||||||
|
|
||||||
#include "snore_exports.h"
|
#include "snore_exports.h"
|
||||||
|
|
||||||
|
@ -6,8 +6,10 @@
|
|||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include "fredesktopnotification.h"
|
#include "fredesktopnotification.h"
|
||||||
#include "core/snoreserver.h"
|
#include "core/snore.h"
|
||||||
#include <QtDBus>
|
|
||||||
|
|
||||||
|
using namespace Snore;
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2 ( freedesktopnotificationbackend,FreedesktopNotification_Backend )
|
Q_EXPORT_PLUGIN2 ( freedesktopnotificationbackend,FreedesktopNotification_Backend )
|
||||||
|
|
||||||
@ -16,18 +18,18 @@ static const char dbusInterfaceName[] = "org.freedesktop.Notifications";
|
|||||||
static const char dbusPath[] = "/org/freedesktop/Notifications";
|
static const char dbusPath[] = "/org/freedesktop/Notifications";
|
||||||
|
|
||||||
|
|
||||||
FreedesktopNotification_Backend::FreedesktopNotification_Backend ( SnoreServer *snore ) :
|
FreedesktopNotification_Backend::FreedesktopNotification_Backend () :
|
||||||
Notification_Backend ( "FreedesktopNotification_Backend",snore )
|
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()
|
bool FreedesktopNotification_Backend::init(SnoreCore *snore){
|
||||||
{
|
QDBusConnection::sessionBus().connect ( "org.freedesktop.Notifications","/org/freedesktop/Notifications","org.freedesktop.Notifications","ActionInvoked",this,SLOT ( actionInvoked( uint,QString ) ) );
|
||||||
return true;
|
// 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 )
|
void FreedesktopNotification_Backend::registerApplication ( Application *application )
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#ifndef FREEDESKTOPNOTIFICATION_H
|
#ifndef FREEDESKTOPNOTIFICATION_H
|
||||||
#define FREEDESKTOPNOTIFICATION_H
|
#define FREEDESKTOPNOTIFICATION_H
|
||||||
#include "core/interface.h"
|
#include "core/plugins/snorebackend.h"
|
||||||
#include <QtDBus>
|
#include <QtDBus>
|
||||||
|
|
||||||
|
|
||||||
class fNotification;
|
class fNotification;
|
||||||
|
|
||||||
class FreedesktopNotification_Backend:public Notification_Backend
|
class FreedesktopNotification_Backend:public Snore::SnoreBackend
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES ( Notification_Backend )
|
Q_INTERFACES ( Snore::SnoreBackend )
|
||||||
public:
|
public:
|
||||||
FreedesktopNotification_Backend ( class SnoreServer *snore=0 );
|
FreedesktopNotification_Backend ();
|
||||||
bool isPrimaryNotificationBackend();
|
virtual bool init(Snore::SnoreCore *snore);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void registerApplication ( Application *application );
|
void registerApplication ( Snore::Application *application );
|
||||||
void unregisterApplication ( Application *application );
|
void unregisterApplication ( Snore::Application *application );
|
||||||
uint notify ( Notification notification );
|
uint notify ( Snore::Notification notification );
|
||||||
void closeNotification ( Notification notification );
|
void closeNotification ( Snore::Notification notification );
|
||||||
void actionInvoked(const uint &id,const QString &actionID);
|
void actionInvoked(const uint &id,const QString &actionID);
|
||||||
void closed ( const uint &id,const uint &reason );
|
void closed ( const uint &id,const uint &reason );
|
||||||
|
|
||||||
};
|
};
|
||||||
QDBusArgument &operator<<(QDBusArgument &a,const Notification &i);
|
QDBusArgument &operator<<(QDBusArgument &a,const Snore::Notification &i);
|
||||||
const QDBusArgument & operator >>(const QDBusArgument &a, Notification &i) ;
|
const QDBusArgument & operator >>(const QDBusArgument &a, Snore::Notification &i) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user