diff options
author | Sivaiah Nallagatla <snallagatla@novell.com> | 2005-02-22 08:54:00 +0800 |
---|---|---|
committer | Sivaiah Nallagatla <siva@src.gnome.org> | 2005-02-22 08:54:00 +0800 |
commit | e5711b4dd2f7bc084d453cba8d78e7b656a40a67 (patch) | |
tree | a13fdc9881f023f5cdd67b5f66613be971366900 /addressbook | |
parent | edcedd2cb61004df765e647c4a73fdf76a04fb7e (diff) | |
download | gsoc2013-evolution-e5711b4dd2f7bc084d453cba8d78e7b656a40a67.tar.gz gsoc2013-evolution-e5711b4dd2f7bc084d453cba8d78e7b656a40a67.tar.zst gsoc2013-evolution-e5711b4dd2f7bc084d453cba8d78e7b656a40a67.zip |
update the base uri of the "On This Computer" group when user home dir
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
svn path=/trunk/; revision=28838
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 9 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-component.c | 18 |
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); } |