[evolution-rss/evolution-rss-0-2-0] init rss folder hooks later



commit 4d372225a7b3d3b882a7704f9a343cc33f0d98ea
Author: Lucian Langa <lucilanga gnome org>
Date:   Thu Jan 20 10:35:49 2011 +0200

    init rss folder hooks later

 src/rss.c |   35 +++++++++++++++++++----------------
 src/rss.h |    1 +
 2 files changed, 20 insertions(+), 16 deletions(-)
---
diff --git a/src/rss.c b/src/rss.c
index 9989225..d99e34a 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -4591,7 +4591,6 @@ void org_gnome_cooly_rss_startup(void *ep, ESEventTargetUpgrade *t)
 #endif
 {
 	gdouble timeout;
-	CamelStore *store;
 
 	if (gconf_client_get_bool (rss_gconf, GCONF_KEY_START_CHECK, NULL)) {
 		//as I don't know how to set this I'll setup a 10 secs timeout
@@ -4612,21 +4611,6 @@ void org_gnome_cooly_rss_startup(void *ep, ESEventTargetUpgrade *t)
 	custom_feed_timeout();
 
 	rss_load_images();
-
-
-	/* hook in rename event to catch feeds folder rename */
-	store = rss_component_peek_local_store();
-#if (DATASERVER_VERSION >= 2031002)
-	g_signal_connect(store, "folder_renamed",
-		G_CALLBACK(store_folder_renamed), NULL);
-	g_signal_connect(store, "folder_deleted",
-		G_CALLBACK(store_folder_deleted), NULL);
-#else
-	camel_object_hook_event(store, "folder_renamed",
-		(CamelObjectEventHookFunc)store_folder_renamed, NULL);
-	camel_object_hook_event(store, "folder_deleted",
-		(CamelObjectEventHookFunc)store_folder_deleted, NULL);
-#endif
 }
 
 /* check if rss folders exists and create'em otherwise */
@@ -5030,6 +5014,24 @@ void quit_cb(void *ep, EShellView *shell_view)
 	rf->cancel_all=1;
 }
 
+void rss_hooks_init(void)
+{
+	CamelStore *store;
+	/* hook in rename event to catch feeds folder rename */
+	store = rss_component_peek_local_store();
+#if (DATASERVER_VERSION >= 2031002)
+	g_signal_connect(store, "folder_renamed",
+		G_CALLBACK(store_folder_renamed), NULL);
+	g_signal_connect(store, "folder_deleted",
+		G_CALLBACK(store_folder_deleted), NULL);
+#else
+	camel_object_hook_event(store, "folder_renamed",
+		(CamelObjectEventHookFunc)store_folder_renamed, NULL);
+	camel_object_hook_event(store, "folder_deleted",
+		(CamelObjectEventHookFunc)store_folder_deleted, NULL);
+#endif
+}
+
 gboolean e_plugin_ui_init (GtkUIManager *ui_manager,
 	EShellView *shell_view);
 
@@ -5061,6 +5063,7 @@ e_plugin_ui_init (GtkUIManager *ui_manager,
 	webkit_hook_actions();
 #endif
 #endif
+	rss_hooks_init();
 	return TRUE;
 }
 #endif
diff --git a/src/rss.h b/src/rss.h
index 854efbd..6e82bc1 100644
--- a/src/rss.h
+++ b/src/rss.h
@@ -403,6 +403,7 @@ void rss_error(
 	gchar *name,
 	gchar *error,
 	gchar *emsg);
+void rss_hooks_init(void);
 void rss_select_folder(gchar *folder_name);
 gchar *lookup_chn_name_by_url(gchar *url);
 gboolean update_articles(gboolean disabler);



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