Commit 7e0339c2 authored by Dominik Haumann's avatar Dominik Haumann
Browse files

Sort session menu alphabeticaly

parent 03c0be31
......@@ -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()
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("&&"));
Supports Markdown
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