Commit 2f8b2f41 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Update name when instance name changed

parent 405e2b4d
......@@ -76,6 +76,9 @@ NewMailNotifierAgent::NewMailNotifierAgent( const QString &id )
this, SLOT(slotInstanceRemoved(Akonadi::AgentInstance)) );
connect( Akonadi::AgentManager::self(), SIGNAL(instanceAdded(Akonadi::AgentInstance)),
this, SLOT(slotInstanceAdded(Akonadi::AgentInstance)) );
connect( Akonadi::AgentManager::self(), SIGNAL(instanceNameChanged(Akonadi::AgentInstance)),
this, SLOT(slotInstanceNameChanged(Akonadi::AgentInstance)) );
changeRecorder()->setMimeTypeMonitored( KMime::Message::mimeType() );
changeRecorder()->itemFetchScope().setCacheOnly( true );
......@@ -467,6 +470,18 @@ void NewMailNotifierAgent::slotDisplayNotification(const QPixmap &pixmap, const
}
}
void NewMailNotifierAgent::slotInstanceNameChanged(const Akonadi::AgentInstance &instance)
{
if (!isActive())
return;
const QString identifier(instance.identifier());
if (mCacheResourceName.contains(identifier)) {
mCacheResourceName.remove(identifier);
mCacheResourceName.insert(identifier, instance.name());
}
}
void NewMailNotifierAgent::slotInstanceStatusChanged(const Akonadi::AgentInstance &instance)
{
if (!isActive())
......
......@@ -92,6 +92,7 @@ private slots:
void slotInstanceAdded(const Akonadi::AgentInstance &instance);
void slotDisplayNotification(const QPixmap &pixmap, const QString &message);
void slotIdentitiesChanged();
void slotInstanceNameChanged(const Akonadi::AgentInstance &instance);
private:
bool isActive() const;
......
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