[Xfce4-commits] r29666 - in xfce4-panel/trunk: . plugins/launcher
Nick Schermer
nick at xfce.org
Sun Mar 15 12:34:48 CET 2009
Author: nick
Date: 2009-03-15 11:34:48 +0000 (Sun, 15 Mar 2009)
New Revision: 29666
Modified:
xfce4-panel/trunk/NEWS
xfce4-panel/trunk/plugins/launcher/launcher.c
Log:
Migrate launcher category icons from 4.4 panels (bug #5067).
Modified: xfce4-panel/trunk/NEWS
===================================================================
--- xfce4-panel/trunk/NEWS 2009-03-15 11:25:50 UTC (rev 29665)
+++ xfce4-panel/trunk/NEWS 2009-03-15 11:34:48 UTC (rev 29666)
@@ -1,3 +1,8 @@
+4.6.1
+=====
+- Migrate launcher category icons from 4.4 panels (bug #5067).
+
+
4.6.0
======
- Block panel autohide if the widget is grabbed (bug #4597).
@@ -8,6 +13,7 @@
- Don't escape the command when dropping a .desktop file in the
launcher dialog (bug #4818).
+
4.5.99.1
========
- Fixed extern char** environ is not defined on BSD platforms (bug #4834).
Modified: xfce4-panel/trunk/plugins/launcher/launcher.c
===================================================================
--- xfce4-panel/trunk/plugins/launcher/launcher.c 2009-03-15 11:25:50 UTC (rev 29665)
+++ xfce4-panel/trunk/plugins/launcher/launcher.c 2009-03-15 11:34:48 UTC (rev 29666)
@@ -37,6 +37,29 @@
#include "launcher-exec.h"
#include "launcher-dialog.h"
+/* for 4.4 settings migration */
+static const gchar *icon_category_map[] = {
+ "applications-other",
+ "accessories-text-editor",
+ "system-file-manager",
+ "applications-accessories",
+ "applications-games",
+ "help-browser",
+ "applications-multimedia",
+ "applications-internet",
+ "applications-graphics",
+ "printer",
+ "office-calendar",
+ "applications-office",
+ "audio-card",
+ "utilities-terminal",
+ "applications-development",
+ "preferences-desktop",
+ "applications-system",
+ "applications-other",
+ "applications-accessories"
+};
+
/* prototypes */
static void launcher_utility_icon_theme_changed (GtkIconTheme *icon_theme,
LauncherPlugin *launcher);
@@ -1178,6 +1201,7 @@
XfceRc *rc;
guint i;
LauncherEntry *entry;
+ gint icon_category;
/* get rc file name, create it if needed */
file = xfce_panel_plugin_lookup_rc_file ( launcher->panel_plugin);
@@ -1223,6 +1247,16 @@
#ifdef HAVE_LIBSTARTUP_NOTIFICATION
entry->startup = xfce_rc_read_bool_entry (rc, "StartupNotify", FALSE);
#endif
+
+ /* 4.4 category icon migration */
+ if (G_UNLIKELY (entry->icon == NULL))
+ {
+ icon_category = xfce_rc_read_int_entry (rc, "X-XFCE-IconCategory", -1);
+ if (icon_category >= 0
+ && icon_category <= (gint) G_N_ELEMENTS (icon_category_map) - 1)
+ entry->icon = g_strdup (icon_category_map[icon_category]);
+ }
+
/* prepend the entry */
launcher->entries = g_list_prepend (launcher->entries, entry);
}
More information about the Xfce4-commits
mailing list