From c22126d54f0cf0637e3d5ddd5d78b3ff5d111582 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 17 Jan 2009 20:06:17 +0000 Subject: Hack GtkIconTheme so we can reference category icons as named icons. Necessary for EActionComboBox, since GtkActions can only handle named or stock icons. Hopefully this is just a temporary hack. Eventually we should make the category icons themeable. Kill the "mail-account-disable" plugin and integrate it properly. More dead plugins to follow... Don't show disabled menu items in pop-up context menus. It does the user no good to see things he CAN'T do with the object he clicked on. svn path=/branches/kill-bonobo/; revision=37093 --- plugins/calendar-weather/calendar-weather.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'plugins/calendar-weather/calendar-weather.c') diff --git a/plugins/calendar-weather/calendar-weather.c b/plugins/calendar-weather/calendar-weather.c index a6dce31326..c16883ae23 100644 --- a/plugins/calendar-weather/calendar-weather.c +++ b/plugins/calendar-weather/calendar-weather.c @@ -51,8 +51,8 @@ int e_plugin_lib_enable (EPluginLib *epl, int enable) { GList *l; - gboolean found = FALSE; - const char *tmp; + const gchar *tmp; + gint ii; static struct { const char *description; @@ -74,24 +74,21 @@ e_plugin_lib_enable (EPluginLib *epl, int enable) /* Add the categories icons if we don't have them. */ for (l = e_categories_get_list (); l; l = g_list_next (l)) { - if (!strcmp ((const char *)l->data, tmp)) { - found = TRUE; - break; - } + if (!strcmp ((const char *)l->data, tmp)) + goto exit; } - if (!found) { - int i; - - for (i = 0; categories[i].description; i++) { - char *filename; + for (ii = 0; categories[ii].description; ii++) { + char *filename; - filename = e_icon_factory_get_icon_filename (categories[i].icon_name, E_ICON_SIZE_MENU); - e_categories_add (_(categories[i].description), NULL, filename, FALSE); - g_free (filename); - } + filename = e_icon_factory_get_icon_filename ( + categories[ii].icon_name, E_ICON_SIZE_MENU); + e_categories_add ( + _(categories[ii].description), NULL, filename, FALSE); + g_free (filename); } +exit: return 0; } -- cgit v1.2.3