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 645254 - Load settings schemas from ~/.local/share
Load settings schemas from ~/.local/share
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: gsettings
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
: 663139 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-03-19 19:37 UTC by Giovanni Campagna
Modified: 2011-11-01 10:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GSettings: load schemas from $XDG_DATA_HOME as well (1.83 KB, patch)
2011-03-19 19:38 UTC, Giovanni Campagna
none Details | Review
add g_get_all_data_dirs() and g_get_all_config_dirs() (17.19 KB, patch)
2011-08-02 08:54 UTC, Alexandre Rostovtsev
none Details | Review

Description Giovanni Campagna 2011-03-19 19:37:06 UTC
Plugins and extensions installed in the home directory, as well as locally built applications, want to use GSettings, but cannot use /usr or /usr/local for schemas, and it is very impratical to set GSETTINGS_SCHEMA_DIR at all times, in particular when it comes to gnome-shell extensions.
I think it makes sense to look in ~/.local/share/glib-2.0/schemas (or actually, $XDG_DATA_HOME/glib-2.0/schemas) as well.

Patch coming...
Comment 1 Giovanni Campagna 2011-03-19 19:38:43 UTC
Created attachment 183811 [details] [review]
GSettings: load schemas from $XDG_DATA_HOME as well

Add $XDG_DATA_HOME/glib-2.0/schemas (~/.local/share/glib-2.0/schemas)
to the default set of directories that are searched for GSettings
schemas.
Comment 2 Steev Klimaszewski 2011-08-02 05:55:43 UTC
Any chance someone could re-visit this?  Just ran into this issue on my box while following the instructions on http://live.gnome.org/GnomeShell/Extensions 

Based on those instructions, Gnome will just crash over and over.  

.xsession-errors shows:

GLib-GIO-ERROR **: Settings schema 'org.gnome.shell.extensions.user-theme' is not installed

aborting...

(nautilus:1480): libnotify-WARNING **: Failed to connect to proxy

(nm-applet:1478): libnotify-WARNING **: Failed to connect to proxy
gnome-shell-calendar-server[1522]: Got HUP on stdin - exiting
gnome-session[1402]: WARNING: Application 'gnome-shell.desktop' killed by signal
Done!
Comment 3 Alexandre Rostovtsev 2011-08-02 08:54:51 UTC
Created attachment 193039 [details] [review]
add g_get_all_data_dirs() and g_get_all_config_dirs()

I believe that this bug is deserves a more fundamental treatment.

Both in glib and gio, and in external applications, one typically wants to look at g_get_user_data_dir() (or g_get_user_config_dir()) followed by g_get_system_data_dirs() (or g_get_system_config_dirs()). Providing a single function that returns such a list would be, therefore, greatly convenient. In addition, the existence of such function would hopefully decrease the frequency of errors when an application entirely forgets to look in g_get_user_data_dir().
Such an error is present in glib-2.29.14 in two places: in initialise_schema_sources() in gio/gsettingsschema.c (as pointed out by Giovanni Campagna), but also in tree_magic_init() in gio/gcontenttype.c.

This patch adds g_get_all_data_dirs() and g_get_all_config_dirs(); uses them to implement g_get_user_{data,config}_dir() and g_get_system_{config,data}_dirs(); and replaces a hodge-podge of code for making a list of all data dirs with a simple function call.
Comment 4 Allison Karlitskaya (desrt) 2011-10-06 20:39:59 UTC
I don't think this is the correct way to handle this.

I'd prefer the approach in bug 649717
Comment 5 Milan Bouchet-Valat 2011-11-01 10:09:00 UTC
*** Bug 663139 has been marked as a duplicate of this bug. ***