hide soem functions
This commit is contained in:
parent
f8df055192
commit
345f63a793
|
@ -122,15 +122,6 @@ const Notification::Action &Notification::actionInvoked() const
|
|||
return d->m_actionInvoked;
|
||||
}
|
||||
|
||||
void Notification::setSource(SnoreFrontend *source){
|
||||
d->m_source = source;
|
||||
}
|
||||
|
||||
SnoreFrontend *Notification::source() const
|
||||
{
|
||||
return d->m_source;
|
||||
}
|
||||
|
||||
Application Notification::application() const
|
||||
{
|
||||
return d->m_application;
|
||||
|
@ -181,10 +172,6 @@ const NotificationEnums::CloseReasons::closeReasons &Notification::closeReason()
|
|||
return d->m_closeReason;
|
||||
}
|
||||
|
||||
void Notification::setCloseReason(const NotificationEnums::CloseReasons::closeReasons &r){
|
||||
d->m_closeReason = r;
|
||||
}
|
||||
|
||||
Hint &Notification::hints()
|
||||
{
|
||||
return d->m_hints;
|
||||
|
|
|
@ -71,8 +71,6 @@ public:
|
|||
const uint &updateID() const;
|
||||
|
||||
const Action &actionInvoked() const;
|
||||
void setSource(class SnoreFrontend *source);
|
||||
class SnoreFrontend *source() const;
|
||||
Application application() const;
|
||||
QString title() const;
|
||||
QString text() const;
|
||||
|
@ -84,7 +82,6 @@ public:
|
|||
const QHash<int, Action> &actions() const;
|
||||
void addAction(const Action &a);
|
||||
const NotificationEnums::CloseReasons::closeReasons &closeReason();
|
||||
void setCloseReason(const NotificationEnums::CloseReasons::closeReasons &r);
|
||||
Hint &hints();
|
||||
|
||||
void setSilent(bool silent);
|
||||
|
|
|
@ -65,3 +65,19 @@ void NotificationData::setActionInvoked ( const int &id)
|
|||
{
|
||||
m_actionInvoked = m_actions[id];
|
||||
}
|
||||
|
||||
void NotificationData::setSource(SnoreFrontend *source)
|
||||
{
|
||||
m_source = source;
|
||||
}
|
||||
|
||||
SnoreFrontend *NotificationData::source() const
|
||||
{
|
||||
return m_source;
|
||||
}
|
||||
|
||||
void NotificationData::setCloseReason(const NotificationEnums::CloseReasons::closeReasons &r)
|
||||
{
|
||||
m_closeReason = r;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,9 +38,16 @@ public:
|
|||
int timeout,NotificationEnums::Prioritys::prioritys priority );
|
||||
|
||||
~NotificationData();
|
||||
|
||||
void setSource(class SnoreFrontend *source);
|
||||
class SnoreFrontend *source() const;
|
||||
|
||||
void setActionInvoked( const Notification::Action &action );
|
||||
void setActionInvoked( const int &actionID);
|
||||
|
||||
|
||||
void setCloseReason(const NotificationEnums::CloseReasons::closeReasons &r);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(NotificationData)
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "../snore_p.h"
|
||||
#include "../application.h"
|
||||
#include "../notification/notification.h"
|
||||
#include "../notification/notification_p.h"
|
||||
|
||||
#include <QTimer>
|
||||
#include <QDir>
|
||||
|
@ -86,7 +87,7 @@ void SnoreBackend::closeNotification(Notification n, NotificationEnums::CloseRea
|
|||
{
|
||||
m_activeNotifications.remove(n.id());
|
||||
}
|
||||
n.setCloseReason(reason);
|
||||
n.data()->setCloseReason(reason);
|
||||
slotCloseNotification(n);
|
||||
emit notificationClosed(n);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "plugins/plugins.h"
|
||||
#include "plugins/snorebackend.h"
|
||||
#include "plugins/snorefrontend.h"
|
||||
#include "notification/notification_p.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
|
@ -63,9 +64,9 @@ void SnoreCorePrivate::notificationActionInvoked(Notification notification) cons
|
|||
{
|
||||
Q_Q(const SnoreCore);
|
||||
emit const_cast<SnoreCore*>(q)->actionInvoked(notification);
|
||||
if ( notification.source() )
|
||||
if ( notification.data()->source() )
|
||||
{
|
||||
notification.source()->actionInvoked ( notification );
|
||||
notification.data()->source()->actionInvoked ( notification );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,9 +74,9 @@ void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
|||
{
|
||||
Q_Q(SnoreCore);
|
||||
emit q->notificationClosed(n);
|
||||
if(n.source())
|
||||
if(n.data()->source())
|
||||
{
|
||||
n.source()->notificationClosed(n);
|
||||
n.data()->source()->notificationClosed(n);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "plugins/backends/freedesktop/fredesktopnotification.h"
|
||||
#include "core/snore.h"
|
||||
#include "core/version.h"
|
||||
#include "core/notification/notification_p.h"
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtDBus>
|
||||
|
@ -111,7 +112,7 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id,
|
|||
{
|
||||
noti.setUpdateID(replaces_id);
|
||||
}
|
||||
noti.setSource(this);
|
||||
noti.data()->setSource(this);
|
||||
for(int i = 0;i < actions.length(); i+=2)
|
||||
{
|
||||
noti.addAction(Notification::Action(actions.at(i).toInt(),actions.at(i+1)));
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "core/snore.h"
|
||||
#include "core/notification/notification.h"
|
||||
#include "core/notification/notification_p.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -142,8 +144,7 @@ SnarlNotification Parser::parse(QString &msg,QTcpSocket* client){
|
|||
}
|
||||
|
||||
sNotification.notification = Notification(app,alert,title,text,icon,timeout);
|
||||
qDebug() << sNotification.notification.title() << sNotification.notification.icon() << sNotification.notification.icon().isValid();
|
||||
sNotification.notification.setSource(snarl);
|
||||
sNotification.notification.data()->setSource(snarl);
|
||||
|
||||
|
||||
switch(action)
|
||||
|
|
Loading…
Reference in New Issue