Re: GSettings are not saved




On 27/08/12 07:37, Vincent Untz wrote:
Le lundi 27 août 2012, à 01:37 +0200, Lanoxx a écrit :
The reason was also that my schema did not have a path set. But for
some reason panel_applet_settings_new() does not warn about this,
when I switched to g_settings_new() i got a Gtk-Critical exception,
thats when I noticed my schema needs a path.
As I said, panel_applet_settings_new() is a wrapper around
g_settings_new_with_path(). That's why you don't need a path in the
schema -- the path is defined by gnome-panel for your applet.

Vincent
In that case, there is probably a bug in that function, see my following patch here, these few lines completely fixed it for me:

diff --git a/data/org.gnome.window-picker-applet.gschema.xml.in.in b/data/org.gnome.window-picker-applet.gschema.xml.in.in
index 19a622b..1dc78bb 100644
--- a/data/org.gnome.window-picker-applet.gschema.xml.in.in
+++ b/data/org.gnome.window-picker-applet.gschema.xml.in.in
@@ -1,5 +1,5 @@
 <schemalist>
-    <schema id="org.gnome.window-picker-applet">
+ <schema id="org.gnome.window-picker-applet" path="/org/gtk/window-picker-applet/">
         <key name="show-all-windows" type="b">
             <default>true</default>
             <summary>Show windows from all workspaces.</summary>
diff --git a/src/applet.c b/src/applet.c
index f0284f7..d0a61ff 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -124,8 +124,7 @@ static gboolean load_window_picker (
     textdomain (GETTEXT_PACKAGE);
     wnck_set_client_type (WNCK_CLIENT_TYPE_PAGER);
     mainapp = app = g_slice_new0 (WinPickerApp);
-    GSettings* settings = panel_applet_settings_new(
-        PANEL_APPLET(applet),
+    GSettings* settings = g_settings_new(
         "org.gnome.window-picker-applet"
     );
     mainapp->settings = settings;




On 26/08/12 20:21, Vincent Untz wrote:
Le dimanche 26 août 2012, à 19:15 +0200, Lanoxx a écrit :
Maybe panel_applet_settings_new should get the comment in the docs,
that it does not retain the settings.
Not sure what you mean -- the settings should definitely be saved.
panel_applet_settings_new() is simply a wrapper around
g_settings_new_with_path(), with a path provided by gnome-panel.

Vincent

_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]