Skip to content

Commit

Permalink
gpm-control: avoid deprecated 'g_settings_list_schemas'
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0w committed Nov 29, 2018
1 parent 79fe889 commit 1514a0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gpm-control.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ gpm_control_get_lock_policy (GpmControl *control, const gchar *policy)
{
gboolean do_lock;
gboolean use_ss_setting;
const char * const *schemas;
gchar **schemas = NULL;
gboolean schema_exists;
gint i;

/* Check if the mate-screensaver schema exists before trying to read
the lock setting to prevent crashing. See GNOME bug #651225. */
schemas = g_settings_list_schemas ();
g_settings_schema_source_list_schemas (g_settings_schema_source_get_default (), TRUE, &schemas, NULL);
schema_exists = FALSE;
for (i = 0; schemas[i] != NULL; i++) {
if (g_strcmp0 (schemas[i], GS_SETTINGS_SCHEMA) == 0) {
Expand All @@ -181,6 +181,8 @@ gpm_control_get_lock_policy (GpmControl *control, const gchar *policy)
}
}

g_strfreev (schemas);

/* This allows us to over-ride the custom lock settings set
with a system default set in mate-screensaver.
See bug #331164 for all the juicy details. :-) */
Expand Down

0 comments on commit 1514a0f

Please sign in to comment.