[evolution] Bug #644107 - Local addressbooks created without relative_uri set



commit 6ad4de8a4ef6139d48bf13e9c817002bf1591e53
Author: Milan Crha <mcrha redhat com>
Date:   Mon Mar 7 12:32:32 2011 +0100

    Bug #644107 - Local addressbooks created without relative_uri set

 modules/addressbook/addressbook-config.c |    4 +++-
 shell/e-shell-migrate.c                  |   22 ++++++++++++++++++----
 2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/modules/addressbook/addressbook-config.c b/modules/addressbook/addressbook-config.c
index 805cfe4..c7f1db5 100644
--- a/modules/addressbook/addressbook-config.c
+++ b/modules/addressbook/addressbook-config.c
@@ -1232,8 +1232,10 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source)
 		sdialog->window = e_config_create_window((EConfig *)ec, NULL, _("New Address Book"));
 
 	/* forces initial validation */
-	if (!sdialog->original_source)
+	if (!sdialog->original_source) {
+		e_source_set_relative_uri (sdialog->source, e_source_peek_uid (sdialog->source));
 		e_config_target_changed ((EConfig *)ec, E_CONFIG_TARGET_CHANGED_STATE);
+	}
 
 	return sdialog->window;
 }
diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c
index dbed197..41d829b 100644
--- a/shell/e-shell-migrate.c
+++ b/shell/e-shell-migrate.c
@@ -819,16 +819,14 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key)
 		}
 
 		/* merging respective sources */
-		for (sources = e_source_group_peek_sources (group);
-				sources != NULL; sources = sources->next) {
+		for (sources = e_source_group_peek_sources (group); sources != NULL; sources = sources->next) {
 			GSList *liter;
 			ESource *dupe_source = sources->data;
 
 			if (!dupe_source)
 				continue;
 
-			for (liter = e_source_group_peek_sources (first_local);
-					liter != NULL; liter = liter->next) {
+			for (liter = e_source_group_peek_sources (first_local); liter != NULL; liter = liter->next) {
 				ESource *my_source = liter->data;
 				const gchar *val1, *val2;
 
@@ -861,6 +859,22 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key)
 		to_remove = g_slist_prepend (to_remove, group);
 	}
 
+	if (first_local) {
+		GSList *sources;
+
+		for (sources = e_source_group_peek_sources (first_local); sources != NULL; sources = sources->next) {
+			ESource *source = sources->data;
+			const gchar *relative_uri;
+
+			if (!source)
+				continue;
+
+			relative_uri = e_source_peek_relative_uri (source);
+			if (!relative_uri || !*relative_uri)
+				e_source_set_relative_uri (source, e_source_peek_uid (source));
+		}
+	}
+
 	if (!to_remove) {
 		g_object_unref (source_list);
 		return;



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