mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-05 18:27:00 +02:00
Do not send a changed signal when a non-existing key is reset
This commit is contained in:
parent
93a54a2d07
commit
8f23a01b5d
@ -178,11 +178,14 @@ g_memory_settings_backend_reset_key (GMemorySettingsBackend *memory,
|
|||||||
const gchar *key,
|
const gchar *key,
|
||||||
gpointer origin_tag)
|
gpointer origin_tag)
|
||||||
{
|
{
|
||||||
|
gboolean had_key;
|
||||||
const gchar *slash;
|
const gchar *slash;
|
||||||
const gchar *base_key;
|
const gchar *base_key;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
g_hash_table_remove (memory->priv->table, key);
|
had_key = g_hash_table_lookup_extended (memory->priv->table, key, NULL, NULL);
|
||||||
|
if (had_key)
|
||||||
|
g_hash_table_remove (memory->priv->table, key);
|
||||||
|
|
||||||
slash = strrchr (key, '/');
|
slash = strrchr (key, '/');
|
||||||
g_assert (slash != NULL);
|
g_assert (slash != NULL);
|
||||||
@ -194,7 +197,8 @@ g_memory_settings_backend_reset_key (GMemorySettingsBackend *memory,
|
|||||||
|
|
||||||
g_free (path);
|
g_free (path);
|
||||||
|
|
||||||
g_settings_backend_changed (G_SETTINGS_BACKEND (memory), key, origin_tag);
|
if (had_key)
|
||||||
|
g_settings_backend_changed (G_SETTINGS_BACKEND (memory), key, origin_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user