mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 15:33:39 +02:00
gsettings: Clarify that g_settings_get_child() inherits delay-apply
Previously, the delay-apply status of the parent `GSettings` object would be partially inherited: `settings->priv->backend` in the child `GSettings` object would point to a `GDelayedSettingsBackend`, but `settings->priv->delayed` would be `NULL`. The expectation from https://bugzilla.gnome.org/show_bug.cgi?id=720891 was that `get_child()` would fully inherit delay-apply status. So, ensure that `settings->priv->delayed` is correctly set to point to the delayed backend when constructing any `GSettings`. Update the tests to work again (presumably the inverted test was an oversight in the original changes). Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2426
This commit is contained in:
@@ -619,7 +619,7 @@ test_delay_child (void)
|
||||
g_assert_nonnull (child);
|
||||
|
||||
g_object_get (child, "delay-apply", &delay, NULL);
|
||||
g_assert_false (delay);
|
||||
g_assert_true (delay);
|
||||
|
||||
g_settings_get (child, "test-byte", "y", &byte);
|
||||
g_assert_cmpuint (byte, ==, 36);
|
||||
@@ -630,6 +630,11 @@ test_delay_child (void)
|
||||
g_settings_get (base, "test-byte", "y", &byte);
|
||||
g_assert_cmpuint (byte, ==, 36);
|
||||
|
||||
/* apply the child and the changes should be saved */
|
||||
g_settings_apply (child);
|
||||
g_settings_get (base, "test-byte", "y", &byte);
|
||||
g_assert_cmpuint (byte, ==, 42);
|
||||
|
||||
g_object_unref (child);
|
||||
g_object_unref (settings);
|
||||
g_object_unref (base);
|
||||
|
Reference in New Issue
Block a user