From 32d28d7bf2646fc7a0008937034246fcc96dbc8a Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Tue, 6 Dec 2022 02:49:19 +0100 Subject: misc src/: make ArcticaGreeter a proper vala SingleInstance class. This allows us to drop the rather awkward self-referencing static singleton member and use a standard vala/glib feature. --- tests/arctica-greeter.vala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/arctica-greeter.vala') diff --git a/tests/arctica-greeter.vala b/tests/arctica-greeter.vala index 2a6581b..3bcfeb8 100644 --- a/tests/arctica-greeter.vala +++ b/tests/arctica-greeter.vala @@ -19,7 +19,8 @@ public const int grid_size = 40; -public class ArcticaGreeter +[SingleInstance] +public class ArcticaGreeter : Object { public static ArcticaGreeter singleton; @@ -27,11 +28,16 @@ public class ArcticaGreeter public signal void show_prompt (string text, LightDM.PromptType type); public signal void authentication_complete (); - public bool test_mode = false; + public bool test_mode { get; construct; default = false; } public bool session_started = false; public string last_respond_response; public bool orca_needs_kick; + public ArcticaGreeter (bool test_mode_ = false) + { + Object (test_mode: test_mode_); + } + public bool is_authenticated () { return false; -- cgit v1.2.3