mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
Merge branch '1309-delayed-settings-changed' into 'master'
gsettings: Add missing changed() call to delayed settings backend Closes #1309 See merge request GNOME/glib!1046
This commit is contained in:
commit
a0cbb32680
@ -204,6 +204,8 @@ g_delayed_settings_backend_reset (GSettingsBackend *backend,
|
||||
g_tree_insert (delayed->priv->delayed, g_strdup (key), NULL);
|
||||
g_mutex_unlock (&delayed->priv->lock);
|
||||
|
||||
g_settings_backend_changed (backend, key, origin_tag);
|
||||
|
||||
if (was_empty)
|
||||
g_delayed_settings_backend_notify_unapplied (delayed);
|
||||
}
|
||||
|
@ -509,6 +509,24 @@ test_delay_apply (void)
|
||||
g_assert_true (changed_cb_called);
|
||||
g_assert_false (changed_cb_called2);
|
||||
|
||||
/* Try resetting the key and ensure a notification is emitted on the delayed #GSettings object. */
|
||||
changed_cb_called = FALSE;
|
||||
changed_cb_called2 = FALSE;
|
||||
|
||||
g_settings_reset (settings, "greeting");
|
||||
|
||||
g_assert_true (changed_cb_called);
|
||||
g_assert_false (changed_cb_called2);
|
||||
|
||||
/* Locally change the greeting again. */
|
||||
changed_cb_called = FALSE;
|
||||
changed_cb_called2 = FALSE;
|
||||
|
||||
g_settings_set (settings, "greeting", "s", "greetings from test_delay_apply");
|
||||
|
||||
g_assert_true (changed_cb_called);
|
||||
g_assert_false (changed_cb_called2);
|
||||
|
||||
writable = g_settings_is_writable (settings, "greeting");
|
||||
g_assert_true (writable);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user