Handle close on qued notification
This commit is contained in:
parent
f5fbb6a7ed
commit
9adfebd339
|
@ -280,12 +280,18 @@ public:
|
|||
bool isActiveIn(const QObject *o) const;
|
||||
bool removeActiveIn(const QObject *o);
|
||||
|
||||
inline bool operator ==(const Notification &other);
|
||||
|
||||
private:
|
||||
QExplicitlySharedDataPointer<NotificationData> d;
|
||||
|
||||
friend class NotificationData;
|
||||
};
|
||||
|
||||
inline bool Notification::operator ==(const Notification &other){
|
||||
return id() == other.id();
|
||||
}
|
||||
|
||||
}
|
||||
Q_DECLARE_METATYPE(Snore::Notification)
|
||||
|
||||
|
|
|
@ -116,7 +116,6 @@ void SnoreCore::broadcastNotification(Notification notification)
|
|||
{
|
||||
Q_D(SnoreCore);
|
||||
if (d->m_activeNotifications.size() > d->maxNumberOfActiveNotifications()) {
|
||||
#pragma message "TODO: handle updates in queue"
|
||||
snoreDebug(SNORE_DEBUG) << "queue size:" << d->m_notificationQue.size() << "active size:" << d->m_activeNotifications.size();
|
||||
d->m_notificationQue.append(notification);
|
||||
return;
|
||||
|
@ -189,8 +188,11 @@ bool SnoreCore::setPrimaryNotificationBackend(const QString &backend)
|
|||
void SnoreCore::requestCloseNotification(Notification n, Notification::CloseReasons r)
|
||||
{
|
||||
Q_D(SnoreCore);
|
||||
|
||||
if (d->m_notificationBackend) {
|
||||
bool wasQued = d->m_notificationQue.removeOne(n);
|
||||
if(wasQued){
|
||||
snoreDebug(SNORE_DEBUG) << n << " was qued.";
|
||||
}
|
||||
if (!wasQued && d->m_notificationBackend) {
|
||||
d->m_notificationBackend->requestCloseNotification(n, r);
|
||||
} else {
|
||||
if (n.isValid()) {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
using namespace Snore;
|
||||
|
||||
SnoreNotifier::SnoreNotifier():
|
||||
m_widgets(1),
|
||||
m_widgets(3),
|
||||
m_timer(new QTimer(this))
|
||||
{
|
||||
for (int i = 0; i < m_widgets.size(); ++i) {
|
||||
|
|
Loading…
Reference in New Issue