After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791290 - GSettings object stops emitting "changed" signal on g_settings_reset after call to g_settings_delay
GSettings object stops emitting "changed" signal on g_settings_reset after ca...
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gsettings
2.54.x
Other Linux
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-12-06 00:54 UTC by Davi
Modified: 2018-05-24 19:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (2.20 KB, text/x-csrc)
2017-12-06 16:12 UTC, Davi
  Details
gsettings: Add missing changed() call to delayed settings backend (1.05 KB, patch)
2018-02-02 10:14 UTC, Philip Withnall
accepted-commit_now Details | Review

Description Davi 2017-12-06 00:54:30 UTC
Analyzing the code on gsettings.c, I found that when g_settings_delay is called, the backend is permanently "wrapped" in a GDelayedSettingsBackend object. Also, by looking at gdelayedsettingsbackend.c, I could notice that the implementation of g_delayed_settings_backend_reset [1] seems to be missing a call to g_settings_backend_changed, especially if compared to g_delayed_settings_backend_write [2]. Am I missing something?

[1] https://git.gnome.org/browse/glib/tree/gio/gdelayedsettingsbackend.c#n195
[2] https://git.gnome.org/browse/glib/tree/gio/gdelayedsettingsbackend.c#n132

Thanks!
Comment 1 Philip Withnall 2017-12-06 10:31:13 UTC
(In reply to Davi from comment #0)
> I found that when g_settings_delay is
> called, the backend is permanently "wrapped" in a GDelayedSettingsBackend
> object.

That’s expected. There’s no way to exit delay-apply mode.

> Also, by looking at gdelayedsettingsbackend.c, I could notice that
> the implementation of g_delayed_settings_backend_reset [1] seems to be
> missing a call to g_settings_backend_changed, especially if compared to
> g_delayed_settings_backend_write [2]. Am I missing something?

Yes, it looks like that could be missing. Can you come up with a minimal test case to demonstrate this please?
Comment 2 Davi 2017-12-06 16:12:44 UTC
Created attachment 365123 [details]
Test case

I think the test-case demonstrates the issue. It is showing a warning that I don't know how to fix, but that doesn't seem to interfere with the test.
Comment 3 Philip Withnall 2018-02-02 10:14:24 UTC
Created attachment 367799 [details] [review]
gsettings: Add missing changed() call to delayed settings backend

When resetting a key in the delayed settings backend,
g_settings_backend_changed() was not called to notify the backend of
the change.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 4 Allison Karlitskaya (desrt) 2018-02-02 10:22:34 UTC
Review of attachment 367799 [details] [review]:

Looks good, but some tests would certainly be nice.
Comment 5 GNOME Infrastructure Team 2018-05-24 19:57:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1309.