Commit 87bad168 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

React when item is removed

parent b2dea34d
......@@ -157,6 +157,32 @@ bool NewMailNotifierAgent::excludeSpecialCollection(const Akonadi::Collection &c
}
}
void NewMailNotifierAgent::itemRemoved( const Akonadi::Item &item )
{
if (!NewMailNotifierAgentSettings::enabled())
return;
QHash< Akonadi::Collection, QList<Akonadi::Item::Id> >::iterator end(mNewMails.end());
for ( QHash< Akonadi::Collection, QList<Akonadi::Item::Id> >::iterator it = mNewMails.begin(); it != end; ++it ) {
QList<Akonadi::Item::Id> idList = it.value();
if (idList.contains(item.id())) {
idList.removeAll( item.id() );
mNewMails[it.key()] = idList;
if (mNewMails[it.key()].isEmpty()) {
mNewMails.remove( it.key() );
break;
}
}
}
}
void NewMailNotifierAgent::itemChanged(const Akonadi::Item &/*item*/, const QSet< QByteArray > &/*partIdentifiers*/)
{
if (!NewMailNotifierAgentSettings::enabled())
return;
//qDebug()<<" partIdentifiers"<<partIdentifiers;
//TODO need to implement it.
}
void NewMailNotifierAgent::itemMoved( const Akonadi::Item &item, const Akonadi::Collection &collectionSource, const Akonadi::Collection &collectionDestination )
{
if (!NewMailNotifierAgentSettings::enabled())
......
......@@ -54,6 +54,8 @@ public:
protected:
void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
void itemMoved( const Akonadi::Item &item, const Akonadi::Collection &collectionSource, const Akonadi::Collection &collectionDestination );
void itemRemoved( const Akonadi::Item &item );
void itemChanged( const Akonadi::Item &, const QSet< QByteArray > &);
private slots:
void slotShowNotifications();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment