fixed tray icon

This commit is contained in:
Patrick von Reth 2014-01-16 09:55:56 +01:00
parent 2171ed455b
commit 964dacce52
1 changed files with 10 additions and 9 deletions

View File

@ -43,6 +43,7 @@ bool TrayIconNotifer::deinitialize()
{
disconnect(m_trayIcon,SIGNAL(messageClicked()),this,SLOT(actionInvoked()));
m_trayIcon = NULL;
m_currentlyDisplaying = false;
}
return true;
}
@ -52,16 +53,15 @@ bool TrayIconNotifer::deinitialize()
void TrayIconNotifer::slotNotify( Notification notification )
{
m_notificationQue.append(notification);
qDebug() << notification << m_currentlyDisplaying;
if(!m_currentlyDisplaying)
{
m_currentlyDisplaying = true;
displayNotification();
}
}
void TrayIconNotifer::displayNotification()
{
if(m_currentlyDisplaying)
{
return;
}
if(m_notificationQue.isEmpty())
{
m_currentlyDisplaying = false;
@ -80,19 +80,20 @@ void TrayIconNotifer::slotCloseNotificationByTimeout()
if(n.isValid())
{
closeNotification(n,NotificationEnums::CloseReasons::TIMED_OUT);
}
m_currentlyDisplaying = false;
displayNotification();
}
}
void TrayIconNotifer::actionInvoked()
{
qDebug()<<"Traicon invoked"<<m_displayed;
Notification n = getActiveNotificationByID(m_displayed);
if(n.isValid())
{
snore()->d()->notificationActionInvoked(n);
closeNotification(n,NotificationEnums::CloseReasons::CLOSED);
m_currentlyDisplaying = false;
displayNotification();
}
}