[evolution-data-server] CamelFolderSearch: Hack to deal with "message-location".



commit 199a4f1b88c83cb5a8bff14cfdf34d653f75154d
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri May 6 13:07:16 2011 -0400

    CamelFolderSearch: Hack to deal with "message-location".
    
    This is the one place in Camel that needs to know about Evolution folder
    URI formats.  It's fine for now; it's marked with a FIXME comment and I'll
    clean it up properly later.

 camel/camel-folder-search.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 0c1a575..c4dc3df 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -1833,9 +1833,20 @@ search_message_location (struct _ESExp *f, gint argc, struct _ESExpResult **argv
 
 	if (argc == 1 && argv[0]->type == ESEXP_RES_STRING) {
 		if (argv[0]->value.string && search->folder) {
-			const gchar *furi = camel_folder_get_uri (search->folder);
+			CamelStore *store;
+			const gchar *name;
+			const gchar *uid;
+			gchar *uri;
+
+			/* FIXME Folder URI formats are Evolution-specific
+			 *       knowledge and doesn't belong here! */
+			store = camel_folder_get_parent_store (search->folder);
+			name = camel_folder_get_full_name (search->folder);
+			uid = camel_service_get_uid (CAMEL_SERVICE (store));
 
-			same = g_str_equal (furi ? furi : "", argv[0]->value.string);
+			uri = g_strdup_printf ("folder://%s/%s", uid, name);
+			same = g_str_equal (uri, argv[0]->value.string);
+			g_free (uri);
 		}
 	}
 



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