[vinagre] Use the new vinagre_plugin_get_icon_name() in the applet menu



commit 61e020dcdb01c50bd703ff1b238f22bc81bf6a88
Author: Jonh Wendell <jwendell gnome org>
Date:   Fri Jul 31 21:17:06 2009 -0300

    Use the new vinagre_plugin_get_icon_name() in the applet menu

 vinagre/vinagre-applet.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/vinagre/vinagre-applet.c b/vinagre/vinagre-applet.c
index d172b24..f6b3184 100644
--- a/vinagre/vinagre-applet.c
+++ b/vinagre/vinagre-applet.c
@@ -27,6 +27,8 @@
 #include "vinagre-utils.h"
 #include "vinagre-connection.h"
 #include "vinagre-commands.h"
+#include "vinagre-plugin.h"
+#include "vinagre-plugins-engine.h"
 #include <config.h>
 
 #ifdef VINAGRE_ENABLE_AVAHI
@@ -280,12 +282,12 @@ fill_recursive_menu (GSList *entries, GtkWidget *menu)
 {
   GSList    *l;
   GtkWidget *item, *image, *child;
-  gchar     *icon_name;
 
   for (l = entries; l; l = l->next)
     {
       VinagreBookmarksEntry *entry = VINAGRE_BOOKMARKS_ENTRY (l->data);
       VinagreConnection     *conn;
+      VinagrePlugin         *plugin;
 
       switch (vinagre_bookmarks_entry_get_node (entry))
 	{
@@ -306,9 +308,11 @@ fill_recursive_menu (GSList *entries, GtkWidget *menu)
 
 	  case VINAGRE_BOOKMARKS_ENTRY_NODE_CONN:
 	    conn = vinagre_bookmarks_entry_get_conn (entry);
-	    icon_name = g_strdup_printf ("application-x-%s", vinagre_connection_get_protocol (conn));
-	    image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
-	    g_free (icon_name);
+	    plugin = vinagre_plugins_engine_get_plugin_by_protocol (vinagre_plugins_engine_get_default (),
+								    vinagre_connection_get_protocol (conn));
+
+	    image = gtk_image_new_from_icon_name (vinagre_plugin_get_icon_name (plugin),
+						  GTK_ICON_SIZE_MENU);
 	    item = gtk_image_menu_item_new_with_label (vinagre_connection_get_name (conn));
 	    gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item),
 					   image);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]