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 757506 - gsettings: schema_list should use the passed schema's source
gsettings: schema_list should use the passed schema's source
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gsettings
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-11-03 01:52 UTC by Cole Robinson
Modified: 2016-02-16 16:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
settings: schema_list should use the passed schema's source (1.24 KB, patch)
2015-11-03 01:53 UTC, Cole Robinson
committed Details | Review

Description Cole Robinson 2015-11-03 01:52:16 UTC
currently schema_list will iterate over the default SchemaSource
list, and not the one associated with the passed in Schema. This
means schema_list can give incorrect results for a Schema fetched
from a non-default SchemaSource, like via new_from_directory.

I was just trying some code via pygobject and hit this. I was basically doing:

   schema_source = Gio.SettingsSchemaSource.new_from_directory(
           "/my/test/dir", None, True)
   schema = schema_source.lookup(app_id, True)
   settings = Gio.Settings.new_full(schema, None, None)
   print settings.list_children()

Which didn't list expected results, the list was empty. However if I added this before the code:

   os.environ["GSETTINGS_SCHEMA_DIR"] = "/my/test/dir"

list_children() would return the expected results
Comment 1 Cole Robinson 2015-11-03 01:53:24 UTC
Created attachment 314695 [details] [review]
settings: schema_list should use the passed schema's source
Comment 2 Cole Robinson 2016-01-12 21:54:55 UTC
ping, can someone review this?
Comment 3 Allison Karlitskaya (desrt) 2016-01-13 15:12:19 UTC
Review of attachment 314695 [details] [review]:

Nice spot!

Thanks for the detailed commit message.
Comment 4 Cole Robinson 2016-02-16 13:56:33 UTC
Thanks for the review. How to get this committed then?