close notifications on deinitialize

This commit is contained in:
Patrick von Reth 2014-01-16 10:13:55 +01:00
parent 964dacce52
commit adfe9f3380
4 changed files with 9 additions and 4 deletions

View File

@ -52,7 +52,7 @@ NotificationData::NotificationData (const Snore::Application &application, const
NotificationData::~NotificationData()
{
notificationCount--;
qDebug() << "Deleting Notification: ActiveNotifications" << notificationCount << "id" << m_id;
qDebug() << "Deleting Notification: ActiveNotifications" << notificationCount << "id" << m_id << "Close Reason:" << m_closeReason;
}

View File

@ -51,6 +51,7 @@ bool SnoreBackend::initialize( SnoreCore *snore )
{
return false;
}
connect( snore->d(), SIGNAL(applicationRegistered(const Snore::Application&)), this, SLOT(slotRegisterApplication(const Snore::Application&)));
connect( snore->d(), SIGNAL(applicationDeregistered(const Snore::Application&)), this, SLOT(slotDeregisterApplication(const Snore::Application&)));
@ -147,6 +148,12 @@ bool SnoreBackend::deinitialize()
{
if(SnorePlugin::deinitialize())
{
foreach(Notification n,m_activeNotifications)
{
requestCloseNotification(n, NotificationEnums::CloseReasons::DISMISSED);
}
foreach(const Application &a,snore()->aplications())
{
slotDeregisterApplication(a);

View File

@ -243,7 +243,6 @@ void SnarlBackend::slotNotify(Notification notification){
snarlInterface->AddAction(id,a.name().toUtf8().constData(),QString("@").append(QString::number(a.id())).toUtf8().constData());
}
m_idMap[notification.id()] = id;
qDebug() << "snarl" << id << notification.id();
startTimeout(notification.id(),notification.timeout());
}
@ -259,7 +258,6 @@ void SnarlBackend::slotNotify(Notification notification){
!notification.icon().isLocalFile()?notification.icon().imageData().toBase64().constData():0,
priority);
m_idMap[notification.id()] = m_idMap[notification.updateID()];
qDebug() << "snarl update" << m_idMap[notification.updateID()] << notification.id();
startTimeout(notification.updateID(),notification.timeout());
}

View File

@ -91,6 +91,6 @@ void TrayIcon::slotTestNotification()
n.addAction(Action(1,"Test Action"));
m_snore->broadcastNotification(n);
m_snore->broadcastNotification(Notification(app, *app.alerts().begin(), "Hello World", "This is Snore, color test", Icon("http://jweatherwatch.googlecode.com/svn/trunk/iconset/04.png")));
m_snore->deregisterApplication(app);
// m_snore->deregisterApplication(app);
}