From f59500bfe360dce317af6b3c24c9a71206e9011a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 19 Nov 2021 09:16:00 +0100 Subject: GSettings: Use org.ayatana.display.gschema.xml for non-Lomiri sessions and unit tests. Additionally, internationalize the org.ayatana.display GSettings schema. Fixes https://github.com/AyatanaIndicators/ayatana-indicator-display/issues/39 --- src/rotation-lock.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/rotation-lock.cpp b/src/rotation-lock.cpp index ad89e10..cb864af 100644 --- a/src/rotation-lock.cpp +++ b/src/rotation-lock.cpp @@ -38,16 +38,24 @@ public: if (pSource != NULL) { - GSettingsSchema *pSchema = g_settings_schema_source_lookup(pSource, "com.lomiri.touch.system", FALSE); + if (ayatana_common_utils_is_lomiri()) { + + GSettingsSchema *pSchema = g_settings_schema_source_lookup(pSource, "com.lomiri.touch.system", FALSE); + + if (pSchema != NULL) + { + g_settings_schema_unref(pSchema); + m_settings = g_settings_new("com.lomiri.touch.system"); + } + else + { + g_error("No schema could be found"); + } - if (pSchema != NULL) - { - g_settings_schema_unref(pSchema); - m_settings = g_settings_new("com.lomiri.touch.system"); } - else - { - pSchema = g_settings_schema_source_lookup(pSource, "org.ayatana.indicator.display", FALSE); + else { + + GSettingsSchema *pSchema = g_settings_schema_source_lookup(pSource, "org.ayatana.indicator.display", FALSE); if (pSchema != NULL) { @@ -58,6 +66,7 @@ public: { g_error("No schema could be found"); } + } } -- cgit v1.2.3