[evolution-data-server] CamelLocalStore: Simplify detection of main local store.



commit 4e1841ca0fa5c90bcd5ebac3fbe6d446b2e8bfb3
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Sep 3 15:31:42 2011 -0400

    CamelLocalStore: Simplify detection of main local store.
    
    Just check if UID == "local".  However this is Evolution-specific
    policy, so Evolution should be setting this explicitly as it does
    for the "need-summary-check" property.

 camel/providers/local/camel-local-store.c |   28 ++++------------------------
 1 files changed, 4 insertions(+), 24 deletions(-)
---
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index aaf5913..1b7bc9a 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -150,8 +150,7 @@ local_store_constructed (GObject *object)
 	CamelLocalStore *local_store;
 	CamelService *service;
 	CamelURL *url;
-	gchar *local_store_path;
-	gchar *local_store_uri;
+	const gchar *uid;
 	gint len;
 
 	local_store = CAMEL_LOCAL_STORE (object);
@@ -160,6 +159,7 @@ local_store_constructed (GObject *object)
 	G_OBJECT_CLASS (camel_local_store_parent_class)->constructed (object);
 
 	service = CAMEL_SERVICE (object);
+	uid = camel_service_get_uid (service);
 	url = camel_service_get_camel_url (service);
 
 	len = strlen (url->path);
@@ -168,28 +168,8 @@ local_store_constructed (GObject *object)
 	else
 		local_store->toplevel_dir = g_strdup (url->path);
 
-	local_store->is_main_store = FALSE;
-
-	local_store_path = g_build_filename (
-		e_get_user_data_dir (), "mail", "local", NULL);
-	local_store_uri = g_filename_to_uri (local_store_path, NULL, NULL);
-	if (local_store_uri) {
-		CamelProvider *provider;
-		CamelURL *local_store_url = camel_url_new (local_store_uri, NULL);
-
-		provider = camel_service_get_provider (service);
-		camel_url_set_protocol (local_store_url, url->protocol);
-		camel_url_set_host (local_store_url, url->host);
-
-		local_store->is_main_store =
-			provider && provider->url_equal ?
-			provider->url_equal (url, local_store_url) :
-			camel_url_equal (url, local_store_url);
-		camel_url_free (local_store_url);
-	}
-
-	g_free (local_store_uri);
-	g_free (local_store_path);
+	/* XXX This is Evolution-specific policy. */
+	local_store->is_main_store = (g_strcmp0 (uid, "local") == 0);
 }
 
 static gchar *



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