diff options
Diffstat (limited to 'src/xsettings.c')
| -rw-r--r-- | src/xsettings.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/xsettings.c b/src/xsettings.c index 844da19f638..5f4275df545 100644 --- a/src/xsettings.c +++ b/src/xsettings.c | |||
| @@ -795,17 +795,29 @@ init_gsettings (void) | |||
| 795 | { | 795 | { |
| 796 | #ifdef HAVE_GSETTINGS | 796 | #ifdef HAVE_GSETTINGS |
| 797 | GVariant *val; | 797 | GVariant *val; |
| 798 | const gchar *const *schemas; | ||
| 799 | int schema_found = 0; | 798 | int schema_found = 0; |
| 800 | 799 | ||
| 801 | #if ! GLIB_CHECK_VERSION (2, 36, 0) | 800 | #if ! GLIB_CHECK_VERSION (2, 36, 0) |
| 802 | g_type_init (); | 801 | g_type_init (); |
| 803 | #endif | 802 | #endif |
| 804 | 803 | ||
| 805 | schemas = g_settings_list_schemas (); | 804 | #if GLIB_CHECK_VERSION (2, 32, 0) |
| 806 | if (schemas == NULL) return; | 805 | { |
| 807 | while (! schema_found && *schemas != NULL) | 806 | GSettingsSchema *sc = g_settings_schema_source_lookup |
| 808 | schema_found = strcmp (*schemas++, GSETTINGS_SCHEMA) == 0; | 807 | (g_settings_schema_source_get_default (), |
| 808 | GSETTINGS_SCHEMA, | ||
| 809 | TRUE); | ||
| 810 | schema_found = sc != NULL; | ||
| 811 | if (sc) g_settings_schema_unref (sc); | ||
| 812 | } | ||
| 813 | #else | ||
| 814 | { | ||
| 815 | const gchar *const *schemas = g_settings_list_schemas (); | ||
| 816 | if (schemas == NULL) return; | ||
| 817 | while (! schema_found && *schemas != NULL) | ||
| 818 | schema_found = strcmp (*schemas++, GSETTINGS_SCHEMA) == 0; | ||
| 819 | } | ||
| 820 | #endif | ||
| 809 | if (!schema_found) return; | 821 | if (!schema_found) return; |
| 810 | 822 | ||
| 811 | gsettings_client = g_settings_new (GSETTINGS_SCHEMA); | 823 | gsettings_client = g_settings_new (GSETTINGS_SCHEMA); |