Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
f5b90922
Commit
f5b90922
authored
Jun 13, 2016
by
Dominik Haumann
Browse files
Sort Kate Session Menu alphabetically
BUG: 364089
REVIEW: 128165
parent
36105bd7
Changes
3
Hide whitespace changes
Inline
Side-by-side
kate/session/katesession.cpp
View file @
f5b90922
...
...
@@ -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
();
}
kate/session/katesession.h
View file @
f5b90922
...
...
@@ -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
;
...
...
kate/session/katesessionsaction.cpp
View file @
f5b90922
...
...
@@ -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
();
qS
ort
(
slist
.
begin
(),
slist
.
end
(),
KateSession
::
compareBy
TimeDesc
);
std
::
s
ort
(
slist
.
begin
(),
slist
.
end
(),
KateSession
::
compareBy
Name
);
slist
=
slist
.
mid
(
0
,
10
);
// take first 10
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment