Browse Source

Migrate launcher category icons from 4.4 panels (bug #5067).

(Old svn revision: 29666)
tags/xfce4-panel-4.10.0
Nick Schermer 12 years ago
parent
commit
b770e9eb93
2 changed files with 40 additions and 0 deletions
  1. +6
    -0
      NEWS
  2. +34
    -0
      plugins/launcher/launcher.c

+ 6
- 0
NEWS View File

@@ -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).


+ 34
- 0
plugins/launcher/launcher.c View File

@@ -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 @@ launcher_plugin_read (LauncherPlugin *launcher)
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 @@ launcher_plugin_read (LauncherPlugin *launcher)
#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);
}


Loading…
Cancel
Save