mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-06 18:57:01 +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,10 +178,13 @@ 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;
|
||||||
|
|
||||||
|
had_key = g_hash_table_lookup_extended (memory->priv->table, key, NULL, NULL);
|
||||||
|
if (had_key)
|
||||||
g_hash_table_remove (memory->priv->table, key);
|
g_hash_table_remove (memory->priv->table, key);
|
||||||
|
|
||||||
slash = strrchr (key, '/');
|
slash = strrchr (key, '/');
|
||||||
@ -194,6 +197,7 @@ g_memory_settings_backend_reset_key (GMemorySettingsBackend *memory,
|
|||||||
|
|
||||||
g_free (path);
|
g_free (path);
|
||||||
|
|
||||||
|
if (had_key)
|
||||||
g_settings_backend_changed (G_SETTINGS_BACKEND (memory), key, origin_tag);
|
g_settings_backend_changed (G_SETTINGS_BACKEND (memory), key, origin_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user