Browse Source

Fix some issues with config file loading and make the api docs a bit more clear about this. This should also fix the default setup load problems with plugins.

(Old svn revision: 25975)
upstream/xfce4-panel-4.10.1
Nick Schermer 15 years ago
parent
commit
c080c1f30e
  1. 21
      libxfce4panel/xfce-panel-plugin-iface.c
  2. 2
      plugins/clock/clock.c
  3. 2
      plugins/launcher/launcher.c
  4. 2
      plugins/windowlist/windowlist.c

21
libxfce4panel/xfce-panel-plugin-iface.c

@ -1161,12 +1161,14 @@ xfce_panel_plugin_unblock_menu (XfcePanelPlugin *plugin)
* @plugin : a #XfcePanelPlugin
*
* Looks up unique filename associated with @plugin in standard configuration
* locations. Uses xfce_resource_lookup() ginternally.
* locations. Only use this function when you want the read location of the
* configuration file, since the path might point to a not writable file (for
* example the default- or kiosk-configuration).
*
* Returns: path to configuration file or %NULL if none was found. The
* returned string must be freed using g_free().
* See also: xfce_panel_plugin_save_location() and #xfce_resource_lookup ()
*
* See also: xfce_panel_plugin_save_location()
* Returns: path to configuration file or %NULL if none was found. The
* returned string must be freed using g_free ().
**/
gchar *
xfce_panel_plugin_lookup_rc_file (XfcePanelPlugin *plugin)
@ -1194,13 +1196,14 @@ xfce_panel_plugin_lookup_rc_file (XfcePanelPlugin *plugin)
* @plugin : a #XfcePanelPlugin
* @create : whether the file should be created
*
* Unique file location that can be used to store configuration information.
* Uses xfce_resource_save_location() ginternally.
* Returns the path that can be used to store configuration information. Don't use
* this function when you want to read the configuration file, then use
* #xfce_panel_plugin_lookup_rc_file.
*
* Returns: path to configuration file or %NULL is the file could not be
* created. The returned string must be freed using g_free().
* See also xfce_panel_plugin_lookup_rc_file() and #xfce_resource_save_location().
*
* See also: xfce_panel_plugin_lookup_rc_file()
* Returns: path to configuration file or %NULL is the file could not be
* created. The returned string must be freed using g_free ().
**/
gchar *
xfce_panel_plugin_save_location (XfcePanelPlugin *plugin,

2
plugins/clock/clock.c

@ -492,7 +492,7 @@ xfce_clock_plugin_read (ClockPlugin *clock)
XfceRc *rc;
/* config filename */
filename = xfce_panel_plugin_save_location (clock->plugin, TRUE);
filename = xfce_panel_plugin_lookup_rc_file (clock->plugin);
if (G_LIKELY (filename))
{

2
plugins/launcher/launcher.c

@ -785,7 +785,7 @@ launcher_read (LauncherPlugin *launcher)
LauncherEntry *entry;
/* get rc file name, create it if needed */
file = xfce_panel_plugin_save_location (launcher->plugin, TRUE);
file = xfce_panel_plugin_lookup_rc_file (launcher->plugin);
if (G_UNLIKELY (file == NULL))
return;

2
plugins/windowlist/windowlist.c

@ -1110,7 +1110,7 @@ windowlist_read (Windowlist * wl)
XfceRc *rc;
gchar *file;
if (!(file = xfce_panel_plugin_save_location (wl->plugin, TRUE)))
if (!(file = xfce_panel_plugin_lookup_rc_file (wl->plugin)))
return;
DBG("Read from file: %s", file);

Loading…
Cancel
Save