[evolution-rss] drop prebonobo cruft



commit ef45a9b5ec00a3d1cff732559bca48dec95b2de8
Author: Lucian Langa <lucilanga gnome org>
Date:   Sun Sep 2 18:35:44 2012 +0200

    drop prebonobo cruft

 src/notification.c       |  158 ++--------------------------------------------
 src/rss-config-factory.c |   27 +-------
 src/rss-image.c          |    4 -
 src/rss.c                |   62 +------------------
 src/rss.h                |    4 -
 5 files changed, 10 insertions(+), 245 deletions(-)
---
diff --git a/src/notification.c b/src/notification.c
index 897bbbd..bfc6da6 100644
--- a/src/notification.c
+++ b/src/notification.c
@@ -1,5 +1,5 @@
 /*  Evoution RSS Reader Plugin
- *  Copyright (C) 2007-2009 Lucian Langa <cooly gnome eu org>
+ *  Copyright (C) 2007-2012 Lucian Langa <cooly gnome eu org>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -22,17 +22,16 @@
 #include <glib/gi18n.h>
 
 #include <mail/em-utils.h>
-#if (EVOLUTION_VERSION >= 22900) //kb//
+
 #if (EVOLUTION_VERSION >= 30391) //kb//
 #include <libevolution-utils/e-alert-dialog.h>
 #else
 #include <e-util/e-alert-dialog.h>
 #endif
+
 #include <shell/e-shell-taskbar.h>
 #include <shell/e-shell-view.h>
-#else
-#include <e-util/e-error.h>
-#endif
+
 
 extern int rss_verbose_debug;
 
@@ -40,9 +39,7 @@ extern int rss_verbose_debug;
 #include "network-soup.h"
 #include "notification.h"
 
-#if (EVOLUTION_VERSION >= 22900) //kb//
 extern EShellView *rss_shell_view;
-#endif
 extern rssfeed *rf;
 
 #if (EVOLUTION_VERSION < 29102)
@@ -69,15 +66,10 @@ rss_error(gpointer key, gchar *name, gchar *error, gchar *emsg)
 #if (EVOLUTION_VERSION < 29102)
 	gpointer newkey;
 #endif
-#if (EVOLUTION_VERSION >= 22900) //kb//
 	EShell *shell;
 	EMailBackend *backend;
 	GtkWindow *parent;
 	GList *windows;
-#else
-	EActivityHandler *activity_handler;
-	guint id;
-#endif
 #if (EVOLUTION_VERSION >= 30101)
 	gpointer alert;
 #endif
@@ -92,7 +84,6 @@ rss_error(gpointer key, gchar *name, gchar *error, gchar *emsg)
 
 	if (key) {
 		if (!g_hash_table_lookup(rf->error_hash, key)) {
-#if (EVOLUTION_VERSION >= 22900) //kb//
 			shell = e_shell_get_default ();
 #if (EVOLUTION_VERSION >= 30101)
 			alert = e_alert_new ("org-gnome-evolution-rss:feederr",
@@ -126,10 +117,6 @@ rss_error(gpointer key, gchar *name, gchar *error, gchar *emsg)
 				"org-gnome-evolution-rss:feederr",
 				error, msg, NULL);
 #endif
-#else
-			ed = e_error_new(NULL, "org-gnome-evolution-rss:feederr",
-				error, msg, NULL);
-#endif
 #if (EVOLUTION_VERSION < 29102)
 			newkey = g_strdup(key);
 			g_signal_connect(
@@ -150,32 +137,17 @@ rss_error(gpointer key, gchar *name, gchar *error, gchar *emsg)
 #endif
 
 #if (EVOLUTION_VERSION < 29102)
-#if (EVOLUTION_VERSION >= 22900) //kb//
 		em_utils_show_error_silent(ed);
 		g_hash_table_insert(
 			rf->error_hash,
 			newkey,
 			GINT_TO_POINTER(1));
-
-#else
-		activity_handler =
-			mail_component_peek_activity_handler (mail_component_peek());
-		id = e_activity_handler_make_error (
-			activity_handler,
-			(char *)mail_component_peek(),
-			E_LOG_ERROR,
-			ed);
-		g_hash_table_insert(rf->error_hash,
-			newkey,
-			GINT_TO_POINTER(id));
-#endif
 #endif
 		}
 		goto out;
 	}
 
 	if (!rf->errdialog) {
-#if (EVOLUTION_VERSION >= 22900) //kb//
 		shell = e_shell_get_default ();
 #if (EVOLUTION_VERSION >= 30301)
 		application = GTK_APPLICATION(shell);
@@ -188,11 +160,6 @@ rss_error(gpointer key, gchar *name, gchar *error, gchar *emsg)
 		ed  = e_alert_dialog_new_for_args(parent,
 			"org-gnome-evolution-rss:feederr",
 			error, msg, NULL);
-#else
-		ed  = e_error_new(NULL,
-			"org-gnome-evolution-rss:feederr",
-			error, msg, NULL);
-#endif
 		g_signal_connect(
 			ed,
 			"response",
@@ -209,84 +176,41 @@ out:    g_free(msg);
 void
 taskbar_push_message(gchar *message)
 {
-#if EVOLUTION_VERSION < 22900 //kb//
-	EActivityHandler *activity_handler =
-		mail_component_peek_activity_handler (mail_component_peek ());
-	e_activity_handler_set_message(activity_handler, message);
-#else
 	EShellTaskbar *shell_taskbar;
 	g_return_if_fail(rss_shell_view != NULL);
 	shell_taskbar = e_shell_view_get_shell_taskbar (rss_shell_view);
 	e_shell_taskbar_set_message (shell_taskbar, message);
-#endif
 }
 
 void
 taskbar_pop_message(void)
 {
-#if EVOLUTION_VERSION < 22900 //kb//
-	EActivityHandler *activity_handler =
-		mail_component_peek_activity_handler (mail_component_peek ());
-	e_activity_handler_unset_message(activity_handler);
-#else
 	EShellTaskbar *shell_taskbar;
 	g_return_if_fail(rss_shell_view != NULL);
 	shell_taskbar = e_shell_view_get_shell_taskbar (rss_shell_view);
 	e_shell_taskbar_set_message (shell_taskbar, "");
-#endif
 }
 
 void
-#if EVOLUTION_VERSION > 29102
 taskbar_op_abort(CamelOperation *cancellable, gpointer key)
-#else
-taskbar_op_abort(gpointer key)
-#endif
 {
-#if EVOLUTION_VERSION < 22900 //kb//
-	EActivityHandler *activity_handler =
-		mail_component_peek_activity_handler (mail_component_peek ());
-	guint activity_key =
-		GPOINTER_TO_INT(g_hash_table_lookup(rf->activity, key));
-	if (activity_key)
-		e_activity_handler_operation_finished(
-				activity_handler,
-				activity_key);
-#else
 	EActivity *activity = g_hash_table_lookup(rf->activity, key);
 	e_activity_set_state (activity, E_ACTIVITY_CANCELLED);
 	g_hash_table_remove(rf->activity, key);
 	g_object_unref(activity);
 	abort_all_soup();
-#endif
 }
 
-#if EVOLUTION_VERSION >= 22900 //kb//
 EActivity *
-#else
-guint
-#endif
 taskbar_op_new(gchar *message, gpointer key);
 
-#if EVOLUTION_VERSION >= 22900 //kb//
 EActivity *
-#else
-guint
-#endif
 taskbar_op_new(gchar *message, gpointer key)
 {
-#if EVOLUTION_VERSION >= 22900 //kb//
 	EShell *shell;
 	EShellBackend *shell_backend;
 	EActivity *activity;
 	GCancellable *cancellable;
-#else
-	EActivityHandler *activity_handler;
-	char *mcp;
-	guint activity_id;
-#endif
-
-#if EVOLUTION_VERSION >= 22900 //kb//
 
 	shell = e_shell_get_default ();
 	shell_backend = e_shell_get_backend_by_name (shell, "mail");
@@ -313,123 +237,58 @@ taskbar_op_new(gchar *message, gpointer key)
 		key);
 	g_object_unref (cancellable);
 	return activity;
-#else
-	activity_handler =
-		mail_component_peek_activity_handler (mail_component_peek ());
-	mcp = g_strdup_printf("%p", mail_component_peek());
-	activity_id =
-		e_activity_handler_cancelable_operation_started(
-			activity_handler,
-			"evolution-mail",
-			message,
-			TRUE,
-			(void (*) (gpointer))taskbar_op_abort,
-			key);
-	g_free(mcp);
-	return activity_id;
-#endif //kb//
 }
 
 void
 taskbar_op_set_progress(gchar *key, gchar *msg, gdouble progress)
 {
-#if (EVOLUTION_VERSION < 22900) //kb//
-	EActivityHandler *activity_handler;
-	guint activity_id;
-#else
 	EActivity *activity_id;
-#endif
 
 	g_return_if_fail(key != NULL);
 
-#if (EVOLUTION_VERSION < 22900) //kb//
-	activity_handler = mail_component_peek_activity_handler
-				(mail_component_peek ());
-	activity_id = GPOINTER_TO_INT(
-				g_hash_table_lookup(rf->activity, key));
-#else
 	activity_id = g_hash_table_lookup(rf->activity, key);
-#endif
 
 	if (activity_id) {
-#if (EVOLUTION_VERSION < 22900) //kb//
-		e_activity_handler_operation_progressing(
-			activity_handler,
-			activity_id,
-			g_strdup(msg),
-			progress);
-#else
-	e_activity_set_percent (activity_id, progress);
-#endif
+		e_activity_set_percent (activity_id, progress);
 	}
 }
 
 void
 taskbar_op_finish(gchar *key)
 {
-#if (EVOLUTION_VERSION >= 22900) //kb//
 	EActivity *aid = NULL;
 	EActivity *activity_key;
-#else
-	guint aid = 0;
-	guint activity_key;
-	EActivityHandler *activity_handler = mail_component_peek_activity_handler (
-						mail_component_peek ());
-#endif
 	if (key) {
-#if (EVOLUTION_VERSION >= 22900) //kb//
 		aid = (EActivity *)g_hash_table_lookup(rf->activity, key);
-#else
-		aid = (guint)g_hash_table_lookup(rf->activity, key);
-#endif
 	}
 	if (aid == NULL) {
-#if (EVOLUTION_VERSION >= 22900) //kb//
 		activity_key = g_hash_table_lookup(rf->activity, "main");
-#else
-		activity_key = GPOINTER_TO_INT(g_hash_table_lookup(rf->activity, "main"));
-#endif
 		if (activity_key) {
 			d("activity_key:%p\n", (gpointer)activity_key);
-#if (EVOLUTION_VERSION >= 22900) //kb//
 #if (EVOLUTION_VERSION >= 29102)
 			e_activity_set_state (activity_key, E_ACTIVITY_COMPLETED);
 			g_object_unref(activity_key);
 #else
 			e_activity_complete (activity_key);
 #endif
-#else
-			e_activity_handler_operation_finished(activity_handler, activity_key);
-#endif
 			g_hash_table_remove(rf->activity, "main");
 		}
 	} else {
-#if (EVOLUTION_VERSION >= 22900) //kb//
 #if (EVOLUTION_VERSION >= 29102)
 		e_activity_set_state (aid, E_ACTIVITY_COMPLETED);
 		g_object_unref(aid);
 #else
 		e_activity_complete (aid);
 #endif
-#else
-		e_activity_handler_operation_finished(activity_handler, aid);
-#endif
 		g_hash_table_remove(rf->activity, key);
 	}
 }
 
-#if (EVOLUTION_VERSION >= 22900) //kb//
 EActivity*
-#else
-guint
-#endif
 taskbar_op_message(gchar *msg, gchar *unikey)
 {
 		gchar *tmsg;
-#if (EVOLUTION_VERSION >= 22900) //kb//
 		EActivity *activity_id;
-#else
-#endif
 		if (!msg) {
 			tmsg = g_strdup_printf(
 				_("Fetching Feeds (%d enabled)"),
@@ -438,7 +297,6 @@ taskbar_op_message(gchar *msg, gchar *unikey)
 		} else
 			tmsg = g_strdup(msg);
 
-#if (EVOLUTION_VERSION >= 22900) //kb//
 		if (!msg)
 			activity_id =
 				(EActivity *)taskbar_op_new(
@@ -447,12 +305,6 @@ taskbar_op_message(gchar *msg, gchar *unikey)
 		else
 			activity_id =
 				(EActivity *)taskbar_op_new(tmsg, msg);
-#else
-		if (!msg)
-			activity_id = taskbar_op_new(tmsg, unikey);
-		else
-			activity_id = taskbar_op_new(tmsg, msg);
-#endif
 		g_hash_table_insert(
 			rf->activity,
 			GUINT_TO_POINTER(unikey),
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index 4ed33e6..d7a6854 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -41,20 +41,18 @@
 
 #include <mail/em-config.h>
 
-#if EVOLUTION_VERSION < 22900 //kb//
-#include <bonobo/bonobo-shlib-factory.h>
-#include <e-util/e-error.h>
-#include <shell/evolution-config-control.h>
-#else
 #if (EVOLUTION_VERSION >= 30391)
 #include <libevolution-utils/e-alert-dialog.h>
 #else
 #include <e-util/e-alert-dialog.h>
 #endif
+
 #include <misc/e-preferences-window.h>
+
 #if EVOLUTION_VERSION <  30303
 #include <mail/e-mail-local.h>
 #endif
+
 #include <mail/em-folder-selector.h>
 #if EVOLUTION_VERSION >= 30305
 #include <libemail-engine/e-mail-folder-utils.h>
@@ -64,10 +62,10 @@
 #endif
 #endif
 
+
 #include <mail/em-utils.h>
 #include <shell/e-shell.h>
 #include <shell/e-shell-view.h>
-#endif
 
 
 #ifdef HAVE_LIBSOUP_GNOME
@@ -4008,27 +4006,14 @@ rss_folder_factory (EPlugin *epl, EConfigHookItemFactoryData *data)
 out:	return NULL;
 }
 
-/*=============*
- * BONOBO part *
- *=============*/
-
-#if EVOLUTION_VERSION < 22900
-EvolutionConfigControl *
-#else
 GtkWidget *
-#endif
 #if EVOLUTION_VERSION >= 23106
 rss_config_control_new (EShell *shell);
 #else
 rss_config_control_new (void);
 #endif
 
-//kb//
-#if EVOLUTION_VERSION < 22900
-EvolutionConfigControl *
-#else
 GtkWidget *
-#endif
 #if EVOLUTION_VERSION >= 23106
 rss_config_control_new (EShell *shell)
 #else
@@ -4413,11 +4398,7 @@ rss_config_control_new (void)
 #endif
 	g_object_unref (gui);
 
-#if EVOLUTION_VERSION < 22900 //kb//
-	return evolution_config_control_new (control_widget);
-#else
 	return control_widget;
-#endif
 }
 
 #if EVOLUTION_VERSION < 22900
diff --git a/src/rss-image.c b/src/rss-image.c
index f2854cc..df308b1 100644
--- a/src/rss-image.c
+++ b/src/rss-image.c
@@ -494,12 +494,8 @@ display_folder_icon(GtkTreeStore *tree_store, gchar *key)
 				icon);
 		g_free(sizes);
 
-#if EVOLUTION_VERSION < 22900 //kb//
-		si = g_hash_table_lookup (mod->store_hash, store);
-#else
 		si = em_folder_tree_model_lookup_store_info (
 			EM_FOLDER_TREE_MODEL (mod), store);
-#endif
 		row = g_hash_table_lookup (si->full_hash, full_name);
 		if (!row) goto out;
 		path = gtk_tree_row_reference_get_path (row);
diff --git a/src/rss.c b/src/rss.c
index 069d915..d1b94ce 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -52,19 +52,8 @@ int rss_verbose_debug = 0;
 #include <mail/em-utils.h>
 #include <mail/em-folder-tree.h>
 
-#if EVOLUTION_VERSION < 22900 //kb//
-#include <e-util/e-error.h>
-#include <mail/em-popup.h>
-#include <mail/em-folder-view.h>
-#include <mail/em-format.h>
-#include <mail/mail-component.h>
-#include <misc/e-activity-handler.h>
-#include <bonobo/bonobo-shlib-factory.h>
-#else
-#if (EVOLUTION_VERSION >= 30391) //kb//
+#if (EVOLUTION_VERSION >= 30391)
 #include <libevolution-utils/e-alert-dialog.h>
-#else
-#include <e-util/e-alert-dialog.h> //remove//
 #endif
 #include <glib/gi18n.h>
 #if EVOLUTION_VERSION < 30303
@@ -78,7 +67,6 @@ int rss_verbose_debug = 0;
 #if EVOLUTION_VERSION < 30101
 #include <misc/e-popup-menu.h>
 #endif
-#endif
 
 #if EVOLUTION_VERSION >= 30505
 #include <mail/e-mail-reader-utils.h>
@@ -1385,17 +1373,9 @@ write_rss_error (EMFormat *emf,
 #endif
 
 
-#if EVOLUTION_VERSION < 22900 //kb//
-void org_gnome_cooly_folder_refresh(void *ep, EMEventTargetFolder *t);
-#else
 void org_gnome_cooly_folder_refresh(void *ep, EShellView *shell_view);
-#endif
 
-#if EVOLUTION_VERSION < 22900 //kb//
-void org_gnome_cooly_folder_refresh(void *ep, EMEventTargetFolder *t)
-#else
 void org_gnome_cooly_folder_refresh(void *ep, EShellView *shell_view)
-#endif
 {
 	gchar *folder_name;
 	gchar *main_folder = get_main_folder();
@@ -2111,19 +2091,6 @@ finish_feed (SoupSession *soup_sess, SoupMessage *msg, gpointer user_data)
 	g_free(rfmsg);
 }
 
-#if EVOLUTION_VERSION < 22900 //kb//
-struct _MailComponentPrivate {
-	GMutex *lock;
-
-	/* states/data used during shutdown */
-#if EVOLUTION_VERSION >= 22801
-	enum { MC_QUIT_NOT_START, MC_QUIT_START, MC_QUIT_SYNC, MC_QUIT_THREADS } quit_state;
-#else
-	enum { MC_QUIT_START, MC_QUIT_SYNC, MC_QUIT_THREADS } quit_state;
-#endif
-};
-#endif
-
 void
 generic_finish_feed(rfMessage *msg, gpointer user_data)
 {
@@ -2144,16 +2111,6 @@ generic_finish_feed(rfMessage *msg, gpointer user_data)
 	if (!key)
 		deleted = 1;
 
-#if EVOLUTION_VERSION < 22900 //kb//
-#if EVOLUTION_VERSION > 22801
-	if (mc->priv->quit_state != MC_QUIT_NOT_START) {
-#else
-	if (mc->priv->quit_state != -1) {
-#endif
-		rf->cancel_all=1;
-	}
-#endif
-
 	d("taskbar_op_finish() queue:%d\n", rf->feed_queue);
 
 	if (rf->feed_queue) {
@@ -2655,15 +2612,6 @@ update_articles(gboolean disabler)
 	gboolean online =  camel_session_is_online (session);
 #endif
 #endif
-#if EVOLUTION_VERSION < 22900 //kb//
-	MailComponent *mc = mail_component_peek ();
-#if EVOLUTION_VERSION > 22801
-	if (mc->priv->quit_state != MC_QUIT_NOT_START)
-#else
-	if (mc->priv->quit_state != -1)
-#endif
-		rf->cancel=1;
-#endif
 
 	if (!rf->pending && !rf->feed_queue && !rf->cancel_all && online) {
 		g_print("Reading RSS articles...\n");
@@ -2683,16 +2631,8 @@ update_articles(gboolean disabler)
 gchar *
 rss_component_peek_base_directory(void)
 {
-#if (EVOLUTION_VERSION >= 22900) //kb//
 	return g_strdup_printf("%s" G_DIR_SEPARATOR_S "rss",
-//		em_utils_get_data_dir());
 		mail_session_get_data_dir ());
-#else
-	MailComponent *component = mail_component_peek();
-/* http://bugzilla.gnome.org/show_bug.cgi?id=513951 */
-	return g_strdup_printf("%s" G_DIR_SEPARATOR_S "rss",
-		mail_component_peek_base_directory (component));
-#endif
 }
 
 CamelStore *
diff --git a/src/rss.h b/src/rss.h
index bbd9a4c..8dd336f 100644
--- a/src/rss.h
+++ b/src/rss.h
@@ -30,12 +30,8 @@
 
 #include <gtk/gtk.h>
 #include <libsoup/soup.h>
-#if EVOLUTION_VERSION < 22900 //kb//
-#include <mail/mail-component.h>
-#else
 #include <shell/e-shell.h>
 #include <shell/e-shell-view.h>
-#endif
 #include <shell/es-event.h>
 
 #if (DATASERVER_VERSION >= 2031001)



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