GNOME Bugzilla – Bug 669803
Port to GSettings
Last modified: 2014-09-20 22:23:43 UTC
Created attachment 207246 [details] [review] migration of geyes Hi, I started to convert gnome-applets to use GSettings instead of GConf as stated here: https://live.gnome.org/GnomeGoals/GSettingsMigration I have 3 applets migrated so far. But unfortunately I wasn't able to test them under gnome-shell (tell me if you know how to test them please :) ). Regards Marek
Created attachment 207247 [details] [review] migration of multiload
Created attachment 207248 [details] [review] migration of stickynotes
Created attachment 207441 [details] [review] migration of battstat Some of those files in battstat still uses GConf. It uses GConf for getting values of "no_hal" and "inhibit_command_line": panel_applet_gconf_get_bool( applet, "no_hal", NULL ) gconf_client_get_bool (client, "/desktop/gnome/lockdown/inhibit_command_line", NULL) I'm not sure what to do here. It seems that "no_hal" is an optional key. Shouldn't we make it part of the new GSettings schema? Also, I haven't found where the "inhibit_command_line" comes from, it is not contained in libgnome schemas. Moreover, its value is not used.
Created attachment 207447 [details] [review] migration of cpufreq
+ <schema id="org.gnome.geyes.prefs"> + <key name="theme-path" type="s"> + <default>''</default> + <summary>Directory in which the theme is located</summary> + </key> + </schema> Filename and directory names are not strings ("s") since they may not be UTF-8. Does this really need to expose a path instead of just hardcoding something like $HOME/.config/gnome-applets/geyes/themes ? + <schema id="org.gnome.multiload.prefs"> + <key name="speed" type="i"> + <default>500</default> + <summary>Applet refresh rate in milliseconds</summary> + </key> Should have a <range /> with sensible limits. + <key name="size" type="i"> + <default>40</default> Same. Also, instead of exposing endless keys for all the foo-colorN colours, how about just using one "as" key for each "foo-palette" ? + <schema id="org.gnome.stickynotes-applet.defaults" path="/apps/stickynotes-applet/defaults/"> + <key name="width" type="i"> + <default>100</default> Needs a range. + <key name="height" type="i"> + <default>100</default> + <summary>Default height for new notes</summary> + <description>Default height for new sticky notes in pixels.</description> + </key> Too. + <key name="font" type="s"> + <default>'Sans 10'</default> + <summary>Default font for new notes</summary> + <description>Default font for new sticky notes. This should be a Pango Font Name, for example "Sans Italic 10".</description> + </key> Does this need to be configurable, or can it just use the document-font from the desktop schemas? BTW: this applies to all instances, just demonstrating here: + color_str = g_settings_get_string ( + stickynotes->settings_defaults, + KEY_FONT_COLOR); Here, color_str is *never* NULL, so all those NULL checks below it can go away. + <schema id="org.gnome.battstat-applet.prefs"> + <key name="red-value" type="i"> + <default>15</default> Range. + <key name="show-text" type="i"> + <default>0</default> + <summary>Show the time/percent label</summary> + <description>0 for no label, 1 for percentage and 2 for time remaining.</description> + </key> This should be an enum key, not an integer. + <schema id="org.gnome.cpufreq-applet.prefs"> + <key name="show-mode" type="i"> + <default>2</default> + <summary>Mode to show cpu usage</summary> + <description>A 0 value means to show the applet in graphic mode (pixmap only), 1 to show the applet in text mode (not to show the pixmap) and 2 to show the applet in graphic and text mode.</description> Enum too. + <key name="show-text-mode" type="i"> + <default>1</default> + <summary>The type of text to display (if the text is enabled).</summary> + <description>A 0 value means to show cpu frequency, 1 to show frequency and units, and 2 to show percentage instead of frequency.</description> And here too.