summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-11-16 21:43:05 +0100
committerMontel Laurent <[email protected]>2015-11-16 21:43:05 +0100
commita7b61779d6f462d40f06320000ec0afe846c31d5 (patch)
tree94851e41f8a635fd780e7dd0dd45cc2e62fef422
parent787dbad46c20dc16e7d7d1222f0e910aa41e4ed2 (diff)
order list of account
-rw-r--r--kmail/widgets/kactionmenuaccount.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/kmail/widgets/kactionmenuaccount.cpp b/kmail/widgets/kactionmenuaccount.cpp
index 570f05f..fe46c18 100644
--- a/kmail/widgets/kactionmenuaccount.cpp
+++ b/kmail/widgets/kactionmenuaccount.cpp
@@ -69,11 +69,17 @@ void KActionMenuAccount::updateAccountMenu()
if (mInitialized) {
menu()->clear();
const Akonadi::AgentInstance::List lst = MailCommon::Util::agentInstances();
+ QMap<QString, QString> listAgent;
Q_FOREACH (const Akonadi::AgentInstance &type, lst) {
// Explicitly make a copy, as we're not changing values of the list but only
// the local copy which is passed to action.
- QAction *action = menu()->addAction(QString(type.name()).replace(QLatin1Char('&'), QStringLiteral("&&")));
- action->setData(type.identifier());
+ listAgent.insert(QString(type.name()).replace(QLatin1Char('&'), QStringLiteral("&&")), type.identifier());
+ }
+ QMapIterator<QString, QString> i(listAgent);
+ while (i.hasNext()) {
+ i.next();
+ QAction *action = menu()->addAction(i.key());
+ action->setData(i.value());
}
}
}