aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-06-16 10:16:11 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-06-16 10:16:11 +0200
commit94b43138a0e8b5051bcdb29656aabeaab13bd734 (patch)
tree39e0c2af460bc47826047e440338dbc5a429aa90
parent0d5437ad2b025beb204b42af475c3bf2a49ec37b (diff)
downloadarctica-greeter-94b43138a0e8b5051bcdb29656aabeaab13bd734.tar.gz
arctica-greeter-94b43138a0e8b5051bcdb29656aabeaab13bd734.tar.bz2
arctica-greeter-94b43138a0e8b5051bcdb29656aabeaab13bd734.zip
src/session-list.vala: Present list of available sessions in case-insensitive order.
-rw-r--r--src/session-list.vala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/session-list.vala b/src/session-list.vala
index d213d53..ffb50f4 100644
--- a/src/session-list.vala
+++ b/src/session-list.vala
@@ -27,6 +27,13 @@ public class SessionPrompt : PromptBox
Object (id: id, session: session, default_session: default_session);
}
+ private GLib.List<LightDM.Session> sessions_sorted_ci (GLib.List<LightDM.Session> sessions)
+ {
+ var ci_sorted_sessions = sessions.copy();
+ ci_sorted_sessions.sort_with_data((a, b) => GLib.strcmp (a.name.casefold(), b.name.casefold()));
+ return ci_sorted_sessions;
+ }
+
private ToggleBox box;
construct
@@ -44,7 +51,7 @@ public class SessionPrompt : PromptBox
}
else
{
- foreach (var session in LightDM.get_sessions ())
+ foreach (var session in sessions_sorted_ci( LightDM.get_sessions() ) )
{
debug ("Adding session %s (%s)", session.key, session.name);
box.add_item (session.key, session.name, SessionList.get_badge (session.key));