diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-02-24 23:55:20 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-02-24 23:55:20 +0100 |
commit | 537442f28135bdb08e16430ffdda17bec038a25e (patch) | |
tree | 335eafe2aa86fe42e65b1d2cd80f8e651a52fb16 /src | |
parent | c99e78a2de7c1be629fb0c343e43d0c98ab1ebe0 (diff) | |
download | arctica-greeter-537442f28135bdb08e16430ffdda17bec038a25e.tar.gz arctica-greeter-537442f28135bdb08e16430ffdda17bec038a25e.tar.bz2 arctica-greeter-537442f28135bdb08e16430ffdda17bec038a25e.zip |
src/arctica-greeter.vala: Turn get_default_session() and validate_session() into non-static methods.
Diffstat (limited to 'src')
-rw-r--r-- | src/arctica-greeter.vala | 6 | ||||
-rw-r--r-- | src/greeter-list.vala | 4 | ||||
-rw-r--r-- | src/user-list.vala | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 68c8887..5de14dc 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -203,7 +203,7 @@ public class ArcticaGreeter : Object ctx.add_class ("lightdm"); } - public static string? get_default_session () + public string? get_default_session () { var sessions = new List<string> (); sessions.append ("lightdm-xsession"); @@ -237,7 +237,7 @@ public class ArcticaGreeter : Object return null; } - public static string validate_session (string? session) + public string validate_session (string? session) { /* Make sure the given session actually exists. Return it if it does. * otherwise, return the default session. @@ -252,7 +252,7 @@ public class ArcticaGreeter : Object } if (session == null) { - var default_session = ArcticaGreeter.get_default_session (); + var default_session = get_default_session (); debug ("Invalid session: '%s'. Using session '%s' instead.", session, default_session); return default_session; } diff --git a/src/greeter-list.vala b/src/greeter-list.vala index c574778..5d943ee 100644 --- a/src/greeter-list.vala +++ b/src/greeter-list.vala @@ -61,6 +61,7 @@ public abstract class GreeterList : FadableBox public bool start_scrolling { get; set; default = true; } protected string greeter_authenticating_user; + protected ArcticaGreeter greeter; protected bool _always_show_manual = false; public bool always_show_manual @@ -964,7 +965,8 @@ public abstract class GreeterList : FadableBox protected virtual string get_lightdm_session () { - return ArcticaGreeter.get_default_session (); + greeter = new ArcticaGreeter(); + return greeter.get_default_session (); } /* Testing code below this */ diff --git a/src/user-list.vala b/src/user-list.vala index 2f16924..39ed7ae 100644 --- a/src/user-list.vala +++ b/src/user-list.vala @@ -118,7 +118,7 @@ public class UserList : GreeterList { if (_default_session == "") { var greeter = new ArcticaGreeter (); - _default_session = ArcticaGreeter.get_default_session(); + _default_session = greeter.get_default_session(); debug ("Setting UserList._default_session to '%s'.", _default_session); } return _default_session; @@ -900,7 +900,8 @@ public class UserList : GreeterList { session = default_session; } - e.session = ArcticaGreeter.validate_session(session); + greeter = new ArcticaGreeter(); + e.session = greeter.validate_session(session); e.label = label; e.set_show_message_icon (has_messages); e.set_is_active (is_active); |