aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog9
-rw-r--r--addressbook/gui/component/addressbook-component.c18
2 files changed, 25 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 030ae85cec..80d96b4418 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,12 @@
+2005-02-19 Sivaiah Nallagatla <snallagatla@novell.com>
+
+ * gui/component/addressbook-component.c
+ (ensure_sources) : update the base uri
+ of the "On This Computer" group when user home dir
+ changes. Also unref personal source if created here.
+
+ Fixes #67724
+
2005-02-09 Sivaiah Nallagatla <snallagatla@novell.com>
* gui/component/addressbook-config.c
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index a0c3c58c04..fdcb4c9c9d 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -95,7 +95,10 @@ ensure_sources (AddressbookComponent *component)
group = E_SOURCE_GROUP (g->data);
- if (!on_this_computer && !strcmp (base_uri_proto, e_source_group_peek_base_uri (group)))
+ /* compare only file:// part. If user home dir name changes we do not want to create
+ one more group */
+
+ if (!on_this_computer && !strncmp (base_uri_proto, e_source_group_peek_base_uri (group), 7))
on_this_computer = group;
else if (!on_ldap_servers && !strcmp (LDAP_BASE_URI, e_source_group_peek_base_uri (group)))
on_ldap_servers = group;
@@ -114,6 +117,16 @@ ensure_sources (AddressbookComponent *component)
break;
}
}
+ /* Make sure we have the correct base uri. This can change when user's
+ homedir name changes */
+ if (strcmp (base_uri_proto, e_source_group_peek_base_uri (on_this_computer))) {
+ e_source_group_set_base_uri (on_this_computer, base_uri_proto);
+
+ /* *sigh* . We shouldn't need this sync call here as set_base_uri
+ call results in synching to gconf, but that happens in idle loop
+ and too late to prevent user seeing "Can not Open ... because of invalid uri" error.*/
+ e_source_list_sync (source_list,NULL);
+ }
}
else {
/* create the local source group */
@@ -138,7 +151,8 @@ ensure_sources (AddressbookComponent *component)
on_ldap_servers = group;
}
-
+ if (personal_source)
+ g_object_unref (personal_source);
g_free (base_uri_proto);
g_free (base_uri);
}