[evolution-groupwise] Adapt to CamelFolderInfo changes.



commit e48a155180fe676d897bbb5bc4148e9e9c17e7e8
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri May 6 19:00:55 2011 -0400

    Adapt to CamelFolderInfo changes.

 src/camel/camel-groupwise-store.c |   36 +++++-------------------------------
 1 files changed, 5 insertions(+), 31 deletions(-)
---
diff --git a/src/camel/camel-groupwise-store.c b/src/camel/camel-groupwise-store.c
index a440b09..9064b74 100644
--- a/src/camel/camel-groupwise-store.c
+++ b/src/camel/camel-groupwise-store.c
@@ -74,7 +74,7 @@ extern CamelServiceAuthType camel_groupwise_password_authtype; /*for the query_a
 
 static GInitableIface *parent_initable_interface;
 
-static CamelFolderInfo *convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, const gchar *url, GCancellable *cancellable, GError **error);
+static CamelFolderInfo *convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, GCancellable *cancellable, GError **error);
 static gboolean groupwise_folders_sync (CamelGroupwiseStore *store, GCancellable *cancellable, GError **error);
 static gint match_path (const gchar *path, const gchar *name);
 static void camel_groupwise_store_initable_init (GInitableIface *interface);
@@ -390,10 +390,8 @@ groupwise_is_system_folder (const gchar *folder_name)
 static CamelFolderInfo *
 groupwise_build_folder_info (CamelGroupwiseStore *gw_store, const gchar *parent_name, const gchar *folder_name)
 {
-	CamelURL *url;
 	const gchar *name;
 	CamelFolderInfo *fi;
-	CamelGroupwiseStorePrivate *priv = gw_store->priv;
 
 	fi = camel_folder_info_new ();
 
@@ -408,12 +406,6 @@ groupwise_build_folder_info (CamelGroupwiseStore *gw_store, const gchar *parent_
 	} else
 		fi->full_name = g_strdup (folder_name);
 
-	url = camel_url_new (priv->base_url,NULL);
-	g_free (url->path);
-	url->path = g_strdup_printf("/%s", fi->full_name);
-	fi->uri = camel_url_to_string (url,CAMEL_URL_HIDE_ALL);
-	camel_url_free (url);
-
 	name = strrchr (fi->full_name,'/');
 	if (name == NULL)
 		name = fi->full_name;
@@ -431,7 +423,7 @@ groupwise_build_folder_info (CamelGroupwiseStore *gw_store, const gchar *parent_
 	if (groupwise_is_system_folder (folder_name))
 		fi->flags |= CAMEL_FOLDER_SYSTEM;
 
-	fi->name = g_strdup (name);
+	fi->display_name = g_strdup (name);
 	return fi;
 }
 
@@ -809,7 +801,6 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store,
 static CamelFolderInfo *
 convert_to_folder_info (CamelGroupwiseStore *store,
                         EGwContainer *container,
-                        const gchar *url,
                         GCancellable *cancellable,
                         GError **error)
 {
@@ -856,7 +847,7 @@ convert_to_folder_info (CamelGroupwiseStore *store,
 		gchar *temp_parent = NULL, *temp = NULL;
 		gchar *str = g_strconcat (par_name, "/", name, NULL);
 
-		fi->name = g_strdup (name);
+		fi->display_name = g_strdup (name);
 
 		temp_parent = g_hash_table_lookup (priv->parent_hash, parent);
 		while (temp_parent) {
@@ -870,13 +861,11 @@ convert_to_folder_info (CamelGroupwiseStore *store,
 
 		}
 		fi->full_name = g_strdup (str);
-		fi->uri = g_strconcat (url, str, NULL);
 		g_free (str);
 	}
 	else {
-		fi->name =  g_strdup (name);
 		fi->full_name = g_strdup (name);
-		fi->uri = g_strconcat (url, "", name, NULL);
+		fi->display_name =  g_strdup (name);
 	}
 
 	si = camel_groupwise_store_summary_add_from_full (store->summary, fi->full_name, '/');
@@ -923,11 +912,9 @@ groupwise_folders_sync (CamelGroupwiseStore *store,
 	CamelGroupwiseStorePrivate  *priv = store->priv;
 	gint status;
 	GList *folder_list = NULL, *temp_list = NULL, *list = NULL;
-	gchar *url, *temp_url;
 	CamelFolderInfo *info = NULL, *hfi = NULL;
 	GHashTable *present;
 	CamelStoreInfo *si = NULL;
-	CamelURL *service_url;
 	gint count, i;
 
 	status = e_gw_connection_get_container_list (priv->cnc, "folders", &folder_list);
@@ -941,18 +928,6 @@ groupwise_folders_sync (CamelGroupwiseStore *store,
 	temp_list = folder_list;
 	list = folder_list;
 
-	service_url = camel_service_get_camel_url (CAMEL_SERVICE (store));
-
-	url = camel_url_to_string (
-		service_url, CAMEL_URL_HIDE_PASSWORD |
-		CAMEL_URL_HIDE_PARAMS | CAMEL_URL_HIDE_AUTH);
-
-	if (url[strlen (url) - 1] != '/') {
-		temp_url = g_strconcat (url, "/", NULL);
-		g_free ((gchar *)url);
-		url = temp_url;
-	}
-
 	/*populate the hash table for finding the mapping from container id <-> folder name*/
 	for (;temp_list != NULL; temp_list = g_list_next (temp_list) ) {
 		const gchar *name, *id, *parent;
@@ -986,7 +961,7 @@ groupwise_folders_sync (CamelGroupwiseStore *store,
 		if ((type == E_GW_CONTAINER_TYPE_CALENDAR) || (type == E_GW_CONTAINER_TYPE_CONTACTS))
 			continue;
 
-		info = convert_to_folder_info (store, E_GW_CONTAINER (folder_list->data), (const gchar *)url, cancellable, error);
+		info = convert_to_folder_info (store, E_GW_CONTAINER (folder_list->data), cancellable, error);
 		if (info) {
 			hfi = g_hash_table_lookup (present, info->full_name);
 			if (hfi == NULL)
@@ -998,7 +973,6 @@ groupwise_folders_sync (CamelGroupwiseStore *store,
 		}
 	}
 
-	g_free ((gchar *)url);
 	e_gw_connection_free_container_list (list);
 	count = camel_store_summary_count ((CamelStoreSummary *)store->summary);
 



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