From 9c7bca0188a37d9a1b39e0f985ae8edb7eefbbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 21 Feb 2023 10:48:50 -0800 Subject: [PATCH 1/2] Init: add ensure type --- lib/Init.vala | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Init.vala b/lib/Init.vala index d201e7443..d51e0f088 100644 --- a/lib/Init.vala +++ b/lib/Init.vala @@ -4,13 +4,20 @@ */ namespace Granite { - static bool initialized = false; + private static bool initialized = false; - internal void init () { + /* + * Initializes Granite. + * If Granite has already been initialized, the function will return. + * Makes sure translations and types for Granite are set up properly. + */ + public void init () { if (initialized) { return; } + typeof (Granite.Settings).ensure (); + GLib.Intl.bindtextdomain (Granite.GETTEXT_PACKAGE, Granite.LOCALEDIR); GLib.Intl.bind_textdomain_codeset (Granite.GETTEXT_PACKAGE, "UTF-8"); initialized = true; From f02b48e7d4140f14ec2ee85d92be701d113f0aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 21 Feb 2023 11:00:32 -0800 Subject: [PATCH 2/2] Add Since --- lib/Init.vala | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Init.vala b/lib/Init.vala index d51e0f088..a95793497 100644 --- a/lib/Init.vala +++ b/lib/Init.vala @@ -10,6 +10,7 @@ namespace Granite { * Initializes Granite. * If Granite has already been initialized, the function will return. * Makes sure translations and types for Granite are set up properly. + * @since 7.2.0 */ public void init () { if (initialized) {