Commit f5b90922 authored by Dominik Haumann's avatar Dominik Haumann
Browse files

Sort Kate Session Menu alphabetically

BUG: 364089
REVIEW: 128165
parent 36105bd7
......@@ -122,9 +122,3 @@ bool KateSession::compareByName(const KateSession::Ptr &s1, const KateSession::P
{
return QCollator().compare(s1->name(), s2->name()) == -1;
}
bool KateSession::compareByTimeDesc(const KateSession::Ptr &s1, const KateSession::Ptr &s2)
{
return s1->timestamp() > s2->timestamp();
}
......@@ -99,7 +99,6 @@ public:
static KateSession::Ptr createAnonymousFrom(const KateSession::Ptr &session, const QString &file);
static bool compareByName(const KateSession::Ptr &s1, const KateSession::Ptr &s2);
static bool compareByTimeDesc(const KateSession::Ptr &s1, const KateSession::Ptr &s2);
private:
friend class KateSessionManager;
......
......@@ -23,6 +23,7 @@
#include "kateapp.h"
#include "katesessionmanager.h"
#include <algorithm>
#include <QMenu>
KateSessionsAction::KateSessionsAction(const QString &text, QObject *parent, KateSessionManager *manager)
......@@ -50,7 +51,7 @@ 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::compareByName);
slist = slist.mid(0, 10); // take first 10
......
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