a real fix
This commit is contained in:
parent
cbe10a3619
commit
aea46dc42a
|
@ -214,7 +214,6 @@ void Notification::setDefaultTimeout(int defaultTimeout)
|
|||
m_defaultTimeout = defaultTimeout;
|
||||
}
|
||||
|
||||
|
||||
QDataStream &operator<< ( QDataStream &stream, const Notification ¬i )
|
||||
{
|
||||
stream << "Title: " << noti.title() << " Text: " << noti.text() << " ID: " << noti.id() ;
|
||||
|
|
|
@ -98,6 +98,7 @@ public:
|
|||
static void setDefaultTimeout(int defaultTimeout);
|
||||
|
||||
private:
|
||||
Notification(const QString &,const QString &,const QString &,const QString &,const Icon &,int, NotificationEnums::Prioritys::prioritys );
|
||||
QExplicitlySharedDataPointer<NotificationData> d;
|
||||
|
||||
static int m_defaultTimeout;
|
||||
|
|
|
@ -39,11 +39,6 @@ SnoreFrontend::~SnoreFrontend()
|
|||
|
||||
bool SnoreFrontend::init( SnoreCore *snore )
|
||||
{
|
||||
if(!SnorePlugin::init(snore))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
connect(snore, SIGNAL(notificationClosed(Snore::Notification)), this, SLOT(notificationClosed(Snore::Notification)));
|
||||
return true;
|
||||
return SnorePlugin::init(snore);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ public:
|
|||
virtual ~SnoreFrontend();
|
||||
virtual bool init(SnoreCore *snore);
|
||||
|
||||
public slots:
|
||||
virtual void actionInvoked( Snore::Notification notification )=0;
|
||||
virtual void notificationClosed( Snore::Notification notification )=0;
|
||||
};
|
||||
|
|
|
@ -63,10 +63,9 @@ void SnoreCorePrivate::notificationActionInvoked(Notification notification) cons
|
|||
{
|
||||
Q_Q(const SnoreCore);
|
||||
emit const_cast<SnoreCore*>(q)->actionInvoked(notification);
|
||||
SnoreFrontend *nf = notification.source();
|
||||
if ( nf != NULL )
|
||||
if ( notification.source() )
|
||||
{
|
||||
nf->actionInvoked ( notification );
|
||||
notification.source()->actionInvoked ( notification );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,5 +73,9 @@ void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
|||
{
|
||||
Q_Q(SnoreCore);
|
||||
emit q->notificationClosed(n);
|
||||
if(n.source())
|
||||
{
|
||||
n.source()->notificationClosed(n);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -62,9 +62,8 @@ void FreedesktopFrontend::actionInvoked(Notification notification) {
|
|||
}
|
||||
}
|
||||
|
||||
void FreedesktopFrontend::notificationClosed(Notification notification) {
|
||||
|
||||
qDebug()<<"Closing Dbus notification"<<notification<<"reason:"<<(int)notification.closeReason();
|
||||
void FreedesktopFrontend::notificationClosed(Notification notification)
|
||||
{
|
||||
emit NotificationClosed(notification.id(),notification.closeReason());
|
||||
}
|
||||
|
||||
|
|
|
@ -56,8 +56,6 @@ bool SnarlNetworkFrontend::init(SnoreCore *snore){
|
|||
void SnarlNetworkFrontend::actionInvoked(Notification notification)
|
||||
{
|
||||
//TODO:fix callback
|
||||
if(notification.source() == this)
|
||||
{
|
||||
SnarlNotification sn=notifications.value(notification.id());
|
||||
if(notification.actionInvoked().id() == 1 )
|
||||
{
|
||||
|
@ -68,10 +66,7 @@ void SnarlNetworkFrontend::actionInvoked(Notification notification)
|
|||
callback(sn,"SNP/1.1/302/Notification cancelled/");
|
||||
}
|
||||
}
|
||||
}
|
||||
void SnarlNetworkFrontend::notificationClosed(Notification notification)
|
||||
{
|
||||
if(notification.source() == this)
|
||||
{
|
||||
SnarlNotification sn=notifications.value(notification.id());
|
||||
if(notification.closeReason() == NotificationEnums::CloseReasons::TIMED_OUT)
|
||||
|
@ -83,7 +78,6 @@ void SnarlNetworkFrontend::notificationClosed(Notification notification)
|
|||
callback(sn,"SNP/1.1/307/Notification closed/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SnarlNetworkFrontend::handleConnection(){
|
||||
QTcpSocket *client = tcpServer->nextPendingConnection();
|
||||
|
|
Loading…
Reference in New Issue