[evolution-ews/gnome-3-6] Bug #687228 - Master's ESource change causes rewrite of GAL ESource ][



commit 4ced31b3310a89a04727d11db80b6479ecfb7315
Author: Milan Crha <mcrha redhat com>
Date:   Fri Nov 2 09:19:24 2012 +0100

    Bug #687228 - Master's ESource change causes rewrite of GAL ESource ][
    
    Take two on the issue, offline caching of GAL was broken by
    the previous patch, due to comparing GUID with "GUID:Name".

 src/configuration/e-mail-config-ews-gal.c          |    3 +++
 .../e-mail-config-ews-oal-combo-box.c              |   14 ++++++++++++--
 src/server/e-ews-connection.c                      |    6 ++++++
 3 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/src/configuration/e-mail-config-ews-gal.c b/src/configuration/e-mail-config-ews-gal.c
index 82177f7..5204842 100644
--- a/src/configuration/e-mail-config-ews-gal.c
+++ b/src/configuration/e-mail-config-ews-gal.c
@@ -110,6 +110,8 @@ mail_config_ews_gal_oal_selected_to_active_id (GBinding *binding,
 
 	if (active_text != NULL) {
 		*active_text++ = '\0';
+		while (*active_text == '\\')
+			active_text++;
 	} else {
 		g_free (active_id);
 		return FALSE;
@@ -128,6 +130,7 @@ mail_config_ews_gal_oal_selected_to_active_id (GBinding *binding,
 		gtk_combo_box_set_active_id (combo_box, active_id);
 	}
 
+	g_value_set_string (target_value, active_id);
 	g_free (active_id);
 
 	return TRUE;
diff --git a/src/configuration/e-mail-config-ews-oal-combo-box.c b/src/configuration/e-mail-config-ews-oal-combo-box.c
index 015a325..2eb06ae 100644
--- a/src/configuration/e-mail-config-ews-oal-combo-box.c
+++ b/src/configuration/e-mail-config-ews-oal-combo-box.c
@@ -322,6 +322,7 @@ e_mail_config_ews_oal_combo_box_update_finish (EMailConfigEwsOalComboBox *combo_
 	GSimpleAsyncResult *simple;
 	GtkComboBoxText *combo_box_text;
 	GSList *list, *link;
+	gchar *active_id;
 
 	g_return_val_if_fail (
 		g_simple_async_result_is_valid (
@@ -340,19 +341,28 @@ e_mail_config_ews_oal_combo_box_update_finish (EMailConfigEwsOalComboBox *combo_
 	combo_box->priv->oal_items = NULL;
 	g_mutex_unlock (combo_box->priv->oal_items_lock);
 
+	active_id = g_strdup (gtk_combo_box_get_active_id (GTK_COMBO_BOX (combo_box)));
 	combo_box_text = GTK_COMBO_BOX_TEXT (combo_box);
 	gtk_combo_box_text_remove_all (combo_box_text);
 
 	for (link = list; link != NULL; link = g_slist_next (link)) {
 		EwsOAL *oal = link->data;
+		const gchar *name = oal->name;
+
+		while (name && *name == '\\')
+			name++;
 
 		gtk_combo_box_text_append (
-			combo_box_text, oal->id, oal->name);
+			combo_box_text, oal->id, name);
 	}
 
 	g_slist_free_full (list, (GDestroyNotify) ews_oal_free);
 
-	gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
+	if (active_id && *active_id)
+		gtk_combo_box_set_active_id (GTK_COMBO_BOX (combo_box), active_id);
+	else
+		gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
+	g_free (active_id);
 
 	return TRUE;
 }
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 6ce4526..a31d78f 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -2608,6 +2608,7 @@ e_ews_connection_get_oal_detail (EEwsConnection *cnc,
 	GSimpleAsyncResult *simple;
 	SoupMessage *soup_message;
 	struct _oal_req_data *data;
+	gchar *sep;
 	GError *error = NULL;
 
 	g_return_if_fail (E_IS_EWS_CONNECTION (cnc));
@@ -2630,6 +2631,11 @@ e_ews_connection_get_oal_detail (EEwsConnection *cnc,
 	data->oal_id = g_strdup (oal_id);
 	data->oal_element = g_strdup (oal_element);
 
+	/* oal_id can be of form "GUID:name", but here is compared only GUID */
+	sep = strchr (data->oal_id, ':');
+	if (sep)
+		*sep = '\0';
+
 	if (G_IS_CANCELLABLE (cancellable)) {
 		data->cancellable = g_object_ref (cancellable);
 		data->cancel_id = g_cancellable_connect (



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