[evolution] Bug 584154 – custom icon folder hook does not work



commit b7d79d3a852746058de93dd0af9b2c13969d55c0
Author: Lucian Langa <lucilanga gnome org>
Date:   Thu May 28 23:39:37 2009 +0300

    Bug 584154 â?? custom icon folder hook does not work
---
 mail/em-event.c             |    5 +++--
 mail/em-event.h             |    5 +++--
 mail/em-folder-tree-model.c |    5 +++++
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/mail/em-event.c b/mail/em-event.c
index 852e319..b1bf7a7 100644
--- a/mail/em-event.c
+++ b/mail/em-event.c
@@ -199,11 +199,12 @@ em_event_target_new_send_receive(EMEvent *eme, GtkWidget *table, gpointer data,
 }
 
 EMEventTargetCustomIcon *
-em_event_target_new_custom_icon(EMEvent *eme, GtkCellRenderer *renderer, const gchar *folder_name, guint32 flags)
+em_event_target_new_custom_icon(EMEvent *eme, GtkTreeStore *store, GtkTreeIter *iter, const gchar *folder_name, guint32 flags)
 {
 	EMEventTargetCustomIcon *t = e_event_target_new(&eme->popup, EM_EVENT_TARGET_CUSTOM_ICON, sizeof(*t));
 
-	t->renderer = renderer;
+	t->store = store;
+	t->iter = iter;
 	t->folder_name = folder_name;
 	t->target.mask = ~flags;
 
diff --git a/mail/em-event.h b/mail/em-event.h
index 0af3208..5dc11bd 100644
--- a/mail/em-event.h
+++ b/mail/em-event.h
@@ -133,7 +133,8 @@ typedef struct _EMEventTargetCustomIcon EMEventTargetCustomIcon;
 struct _EMEventTargetCustomIcon {
 	EEventTarget target;
 
-	GtkCellRenderer *renderer;
+	GtkTreeStore	*store;
+	GtkTreeIter	*iter;
 	const gchar	*folder_name;
 };
 
@@ -159,7 +160,7 @@ EMEventTargetFolderBrowser *em_event_target_new_folder_browser (EMEvent *eme, EM
 EMEventTargetComposer *em_event_target_new_composer(EMEvent *emp, const struct _EMsgComposer *composer, guint32 flags);
 EMEventTargetMessage *em_event_target_new_message(EMEvent *emp, struct _CamelFolder *folder, struct _CamelMimeMessage *message, const gchar *uid, guint32 flags);
 EMEventTargetSendReceive * em_event_target_new_send_receive(EMEvent *eme, struct _GtkWidget *table, gpointer data, gint row, guint32 flags);
-EMEventTargetCustomIcon * em_event_target_new_custom_icon(EMEvent *eme, GtkCellRenderer *renderer, const gchar *uri, guint32 flags);
+EMEventTargetCustomIcon * em_event_target_new_custom_icon(EMEvent *eme, GtkTreeStore *store, GtkTreeIter *iter, const gchar *uri, guint32 flags);
 
 /* ********************************************************************** */
 
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 2fedce0..a12b453 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -55,6 +55,7 @@
 
 #include "em-utils.h"
 #include "em-folder-utils.h"
+#include "em-event.h"
 
 #include <camel/camel-folder.h>
 #include <camel/camel-vee-store.h>
@@ -453,6 +454,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
 	const gchar *name;
 	const gchar *icon_name;
 	guint32 flags;
+	EMEventTargetCustomIcon *target;
 
 	/* make sure we don't already know about it? */
 	if (g_hash_table_lookup (si->full_hash, fi->full_name))
@@ -540,6 +542,9 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
 		COL_BOOL_LOAD_SUBDIRS, load,
 		-1);
 
+	target = em_event_target_new_custom_icon (em_event_peek(), tree_store, iter, fi->full_name, EM_EVENT_CUSTOM_ICON);
+	e_event_emit ((EEvent *)em_event_peek (), "folder.customicon", (EEventTarget *) target);
+
 	if (unread != ~0)
 		gtk_tree_store_set (tree_store, iter, COL_UINT_UNREAD, unread, -1);
 



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