Author: nick
Date: 2007-08-12 14:16:49 +0000 (Sun, 12 Aug 2007)
New Revision: 25975
Modified:
xfce4-panel/trunk/libxfce4panel/xfce-panel-plugin-iface.c
xfce4-panel/trunk/plugins/clock/clock.c
xfce4-panel/trunk/plugins/launcher/launcher.c
xfce4-panel/trunk/plugins/windowlist/windowlist.c
Log:
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.
Modified: xfce4-panel/trunk/libxfce4panel/xfce-panel-plugin-iface.c
===================================================================
--- xfce4-panel/trunk/libxfce4panel/xfce-panel-plugin-iface.c 2007-08-12
13:19:37 UTC (rev 25974)
+++ xfce4-panel/trunk/libxfce4panel/xfce-panel-plugin-iface.c 2007-08-12
14:16:49 UTC (rev 25975)
@@ -1161,12 +1161,14 @@
* @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).
*
+ * See also: xfce_panel_plugin_save_location() and #xfce_resource_lookup ()
+ *
* 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()
+ * returned string must be freed using g_free ().
**/
gchar *
xfce_panel_plugin_lookup_rc_file (XfcePanelPlugin *plugin)
@@ -1194,13 +1196,14 @@
* @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.
*
+ * See also xfce_panel_plugin_lookup_rc_file() and
#xfce_resource_save_location().
+ *
* 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()
+ * created. The returned string must be freed using g_free ().
**/
gchar *
xfce_panel_plugin_save_location (XfcePanelPlugin *plugin,
Modified: xfce4-panel/trunk/plugins/clock/clock.c
===================================================================
--- xfce4-panel/trunk/plugins/clock/clock.c 2007-08-12 13:19:37 UTC (rev
25974)
+++ xfce4-panel/trunk/plugins/clock/clock.c 2007-08-12 14:16:49 UTC (rev
25975)
@@ -492,7 +492,7 @@
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))
{
Modified: xfce4-panel/trunk/plugins/launcher/launcher.c
===================================================================
--- xfce4-panel/trunk/plugins/launcher/launcher.c 2007-08-12 13:19:37 UTC
(rev 25974)
+++ xfce4-panel/trunk/plugins/launcher/launcher.c 2007-08-12 14:16:49 UTC
(rev 25975)
@@ -785,7 +785,7 @@
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;
Modified: xfce4-panel/trunk/plugins/windowlist/windowlist.c
===================================================================
--- xfce4-panel/trunk/plugins/windowlist/windowlist.c 2007-08-12 13:19:37 UTC
(rev 25974)
+++ xfce4-panel/trunk/plugins/windowlist/windowlist.c 2007-08-12 14:16:49 UTC
(rev 25975)
@@ -1110,7 +1110,7 @@
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);
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits