aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Haumann <[email protected]>2016-06-25 22:23:05 +0200
committerDominik Haumann <[email protected]>2016-06-25 22:23:05 +0200
commit7e0339c22b5e40e2bcf2dc5705857d613188c809 (patch)
tree69a071a1ccb1352bdbd3894b1891d7ce6600eec1
parent03c0be31ab04e56be4c831733a4cf44c0248001a (diff)
Sort session menu alphabeticaly
-rw-r--r--kate/session/katesessionsaction.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/kate/session/katesessionsaction.cpp b/kate/session/katesessionsaction.cpp
index af455f1..3925313 100644
--- a/kate/session/katesessionsaction.cpp
+++ b/kate/session/katesessionsaction.cpp
@@ -23,6 +23,7 @@
#include "kateapp.h"
#include "katesessionmanager.h"
+#include <algorithm>
#include <QMenu>
KateSessionsAction::KateSessionsAction(const QString &text, QObject *parent, KateSessionManager *manager)
@@ -50,10 +51,13 @@ void KateSessionsAction::slotAboutToShow()
qDeleteAll(sessionsGroup->actions());
KateSessionList slist = m_manager->sessionList();
- qSort(slist.begin(), slist.end(), KateSession::compareByTimeDesc);
+ std::sort(slist.begin(), slist.end(), KateSession::compareByTimeDesc);
slist = slist.mid(0, 10); // take first 10
+ // sort the reduced list alphabetically (#364089)
+ std::sort(slist.begin(), slist.end(), KateSession::compareByName);
+
foreach(const KateSession::Ptr & session, slist) {
QString sessionName = session->name();
sessionName.replace(QStringLiteral("&"), QStringLiteral("&&"));