[evolution-data-server] Remove camel_filter_driver_filter_mbox()



commit b7d2775b9b2f91d390f1436094304c00cc156059
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri May 6 10:36:15 2011 -0400

    Remove camel_filter_driver_filter_mbox()
    
    Function is no longer needed since the switch to Maildir.

 camel/camel-filter-driver.c                        |  128 --------------------
 camel/camel-filter-driver.h                        |    5 -
 docs/reference/camel/camel-sections.txt            |    1 -
 docs/reference/camel/tmpl/camel-filter-driver.sgml |   13 --
 docs/reference/camel/tmpl/camel-unused.sgml        |   12 ++
 5 files changed, 12 insertions(+), 147 deletions(-)
---
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index eeac594..8791780 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -1217,134 +1217,6 @@ decode_flags_from_xev (const gchar *xev, CamelMessageInfoBase *mi)
 }
 
 /**
- * camel_filter_driver_filter_mbox:
- * @driver: CamelFilterDriver
- * @mbox: mbox filename to be filtered
- * @original_source_url:
- * @cancellable: optional #GCancellable object, or %NULL
- * @error: return location for a #GError, or %NULL
- *
- * Filters an mbox file based on rules defined in the FilterDriver
- * object. Is more efficient as it doesn't need to open the folder
- * through Camel directly.
- *
- * Returns: -1 if errors were encountered during filtering,
- * otherwise returns 0.
- *
- **/
-gint
-camel_filter_driver_filter_mbox (CamelFilterDriver *driver,
-                                 const gchar *mbox,
-                                 const gchar *original_source_url,
-                                 GCancellable *cancellable,
-                                 GError **error)
-{
-	CamelFilterDriverPrivate *p = driver->priv;
-	CamelMimeParser *mp = NULL;
-	gchar *source_url = NULL;
-	gint fd = -1;
-	gint i = 0;
-	struct stat st;
-	gint status;
-	goffset last = 0;
-	gint ret = -1;
-
-	fd = g_open (mbox, O_RDONLY|O_BINARY, 0);
-	if (fd == -1) {
-		g_set_error (
-			error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
-			_("Unable to open spool folder"));
-		goto fail;
-	}
-	/* to get the filesize */
-	fstat (fd, &st);
-
-	mp = camel_mime_parser_new ();
-	camel_mime_parser_scan_from (mp, TRUE);
-	if (camel_mime_parser_init_with_fd (mp, fd) == -1) {
-		g_set_error (
-			error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
-			_("Unable to process spool folder"));
-		goto fail;
-	}
-	fd = -1;
-
-	source_url = g_filename_to_uri (mbox, NULL, NULL);
-
-	while (camel_mime_parser_step (mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) {
-		CamelMessageInfo *info;
-		CamelMimeMessage *message;
-		CamelMimePart *mime_part;
-		gint pc = 0;
-		const gchar *xev;
-		GError *local_error = NULL;
-
-		if (st.st_size > 0)
-			pc = (gint)(100.0 * ((double)camel_mime_parser_tell (mp) / (double)st.st_size));
-
-		report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d (%d%%)"), i, pc);
-
-		message = camel_mime_message_new ();
-		mime_part = CAMEL_MIME_PART (message);
-
-		if (!camel_mime_part_construct_from_parser_sync (
-			mime_part, mp, cancellable, error)) {
-			report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Failed on message %d"), i);
-			g_object_unref (message);
-			goto fail;
-		}
-
-		info = camel_message_info_new_from_header (NULL, mime_part->headers);
-		/* Try and see if it has X-Evolution headers */
-		xev = camel_header_raw_find(&mime_part->headers, "X-Evolution", NULL);
-		if (xev)
-			decode_flags_from_xev (xev, (CamelMessageInfoBase *)info);
-
-		((CamelMessageInfoBase *)info)->size = camel_mime_parser_tell (mp) - last;
-
-		last = camel_mime_parser_tell (mp);
-		status = camel_filter_driver_filter_message (
-			driver, message, info, NULL, NULL, source_url,
-			original_source_url ? original_source_url :
-			source_url, cancellable, &local_error);
-		g_object_unref (message);
-		if (local_error != NULL || status == -1) {
-			report_status (
-				driver, CAMEL_FILTER_STATUS_END, 100,
-				_("Failed on message %d"), i);
-			camel_message_info_free (info);
-			g_propagate_error (error, local_error);
-			goto fail;
-		}
-
-		i++;
-
-		/* skip over the FROM_END state */
-		camel_mime_parser_step (mp, NULL, NULL);
-
-		camel_message_info_free (info);
-	}
-
-	if (p->defaultfolder) {
-		report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, 100, _("Syncing folder"));
-		camel_folder_synchronize_sync (
-			p->defaultfolder, FALSE, cancellable, NULL);
-	}
-
-	report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Complete"));
-
-	ret = 0;
-fail:
-	g_free (source_url);
-	if (fd != -1)
-		close (fd);
-	if (mp)
-		g_object_unref (mp);
-
-	return ret;
-}
-
-/**
  * camel_filter_driver_filter_folder:
  * @driver: CamelFilterDriver
  * @folder: CamelFolder to be filtered
diff --git a/camel/camel-filter-driver.h b/camel/camel-filter-driver.h
index c509126..68e4919 100644
--- a/camel/camel-filter-driver.h
+++ b/camel/camel-filter-driver.h
@@ -117,11 +117,6 @@ gint		camel_filter_driver_filter_message
 						 const gchar *original_source_url,
 						 GCancellable *cancellable,
 						 GError **error);
-gint		camel_filter_driver_filter_mbox	(CamelFilterDriver *driver,
-						 const gchar *mbox,
-						 const gchar *original_source_url,
-						 GCancellable *cancellable,
-						 GError **error);
 gint		camel_filter_driver_filter_folder
 						(CamelFilterDriver *driver,
 						 CamelFolder *folder,
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index e67d705..c8cb495 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -403,7 +403,6 @@ camel_filter_driver_add_rule
 camel_filter_driver_remove_rule_by_name
 camel_filter_driver_flush
 camel_filter_driver_filter_message
-camel_filter_driver_filter_mbox
 camel_filter_driver_filter_folder
 <SUBSECTION Standard>
 CAMEL_FILTER_DRIVER
diff --git a/docs/reference/camel/tmpl/camel-filter-driver.sgml b/docs/reference/camel/tmpl/camel-filter-driver.sgml
index d46023b..9efc59d 100644
--- a/docs/reference/camel/tmpl/camel-filter-driver.sgml
+++ b/docs/reference/camel/tmpl/camel-filter-driver.sgml
@@ -162,19 +162,6 @@ CamelFilterDriver
 @Returns: 
 
 
-<!-- ##### FUNCTION camel_filter_driver_filter_mbox ##### -->
-<para>
-
-</para>
-
- driver: 
- mbox: 
- original_source_url: 
- cancellable: 
- error: 
- Returns: 
-
-
 <!-- ##### FUNCTION camel_filter_driver_filter_folder ##### -->
 <para>
 
diff --git a/docs/reference/camel/tmpl/camel-unused.sgml b/docs/reference/camel/tmpl/camel-unused.sgml
index 35181b3..2573270 100644
--- a/docs/reference/camel/tmpl/camel-unused.sgml
+++ b/docs/reference/camel/tmpl/camel-unused.sgml
@@ -5401,6 +5401,18 @@ streams
 @action: 
 @op: 
 
+<!-- ##### FUNCTION camel_filter_driver_filter_mbox ##### -->
+<para>
+
+</para>
+
+ driver: 
+ mbox: 
+ original_source_url: 
+ cancellable: 
+ error: 
+ Returns: 
+
 <!-- ##### FUNCTION camel_filter_driver_rule_count ##### -->
 <para>
 



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