diff options
author | Chris Toshok <toshok@ximian.com> | 2004-01-28 05:19:07 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2004-01-28 05:19:07 +0800 |
commit | eb4fecb99453dc64a4339c9589f33a56adeb20d8 (patch) | |
tree | 3dec93b3ead375a41003e88caa376a1859e73c45 | |
parent | 96729a9fd1c06a0b68f774ea608a21fb05969c91 (diff) | |
download | gsoc2013-evolution-eb4fecb99453dc64a4339c9589f33a56adeb20d8.tar.gz gsoc2013-evolution-eb4fecb99453dc64a4339c9589f33a56adeb20d8.tar.zst gsoc2013-evolution-eb4fecb99453dc64a4339c9589f33a56adeb20d8.zip |
set the relative_uri of a local source to be its uid.
2004-01-27 Chris Toshok <toshok@ximian.com>
* gui/component/addressbook-config.c (dialog_to_source): set the
relative_uri of a local source to be its uid.
* gui/component/addressbook-migrate.c
(migrate_contact_folder_to_source): remove the dest_group arg,
since we don't use it.
(migrate_contact_folder): set the relative uri of the source to be
its uid.
(PERSONAL_RELATIVE_URI): "Personal" -> "system".
(create_groups): don't actually make the directory hierarchy for
the personal folder here. let e-d-s do that. Also remove
OnThisComputer from the base uri.
(migrate_local_folders): track change to
migrate_contact_folder_to_source.
svn path=/trunk/; revision=24478
-rw-r--r-- | addressbook/ChangeLog | 17 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-config.c | 2 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-migrate.c | 25 |
3 files changed, 29 insertions, 15 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 670a86743b..76646095e1 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,20 @@ +2004-01-27 Chris Toshok <toshok@ximian.com> + + * gui/component/addressbook-config.c (dialog_to_source): set the + relative_uri of a local source to be its uid. + + * gui/component/addressbook-migrate.c + (migrate_contact_folder_to_source): remove the dest_group arg, + since we don't use it. + (migrate_contact_folder): set the relative uri of the source to be + its uid. + (PERSONAL_RELATIVE_URI): "Personal" -> "system". + (create_groups): don't actually make the directory hierarchy for + the personal folder here. let e-d-s do that. Also remove + OnThisComputer from the base uri. + (migrate_local_folders): track change to + migrate_contact_folder_to_source. + 2004-01-26 Chris Toshok <toshok@ximian.com> [ Should fix #53361 and other migration problems/crashes ] diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index e5ecdd8f28..2897308ab3 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -257,7 +257,7 @@ dialog_to_source (AddressbookSourceDialog *dialog, ESource *source, gboolean tem relative_uri = e_source_peek_relative_uri (source); if (!relative_uri || !strlen (relative_uri)) - e_source_set_relative_uri (source, e_source_peek_name (source)); + e_source_set_relative_uri (source, e_source_peek_uid (source)); } if (!temporary && !e_source_peek_group (source)) diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c index 627660b9c1..77481f76b0 100644 --- a/addressbook/gui/component/addressbook-migrate.c +++ b/addressbook/gui/component/addressbook-migrate.c @@ -282,7 +282,7 @@ migrate_contacts (EBook *old_book, EBook *new_book) } static void -migrate_contact_folder_to_source (char *old_path, ESourceGroup *dest_group, ESource *new_source) +migrate_contact_folder_to_source (char *old_path, ESource *new_source) { char *old_uri = g_strdup_printf ("file://%s", old_path); GError *e = NULL; @@ -327,15 +327,16 @@ migrate_contact_folder (char *old_path, ESourceGroup *dest_group, char *source_n ESource *new_source; new_source = e_source_new (source_name, source_name); + e_source_set_relative_uri (new_source, e_source_peek_uid (new_source)); e_source_group_add_source (dest_group, new_source, -1); - migrate_contact_folder_to_source (old_path, dest_group, new_source); + migrate_contact_folder_to_source (old_path, new_source); g_object_unref (new_source); } #define LDAP_BASE_URI "ldap://" -#define PERSONAL_RELATIVE_URI "Personal" +#define PERSONAL_RELATIVE_URI "system" static void create_groups (AddressbookComponent *component, @@ -347,13 +348,13 @@ create_groups (AddressbookComponent *component, GSList *groups; ESourceGroup *group; ESource *source = NULL; - char *base_uri, *base_uri_proto, *new_dir; + char *base_uri, *base_uri_proto; *on_this_computer = NULL; *on_ldap_servers = NULL; base_uri = g_build_filename (addressbook_component_peek_base_directory (component), - "/addressbook/local/OnThisComputer/", + "/addressbook/local/", NULL); base_uri_proto = g_strconcat ("file://", base_uri, NULL); @@ -397,14 +398,10 @@ create_groups (AddressbookComponent *component, if (!source) { /* Create the default Person addressbook */ - new_dir = g_build_filename (base_uri, "Personal/", NULL); - if (!e_mkdir_hier (new_dir, 0700)) { - source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); - e_source_group_add_source (*on_this_computer, source, -1); + source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); + e_source_group_add_source (*on_this_computer, source, -1); - *personal_source = source; - } - g_free (new_dir); + *personal_source = source; } if (!*on_ldap_servers) { @@ -430,11 +427,11 @@ migrate_local_folders (AddressbookComponent *component, ESourceGroup *on_this_co dirs = e_folder_map_local_folders (old_path, "contacts"); - /* migrate the local addressbook first, to OnThisComputer/Personal */ + /* migrate the local addressbook first, to local/system */ local_contact_folder = g_build_filename (g_get_home_dir (), "/evolution/local/Contacts", NULL); if (personal_source) - migrate_contact_folder_to_source (local_contact_folder, on_this_computer, personal_source); + migrate_contact_folder_to_source (local_contact_folder, personal_source); for (l = dirs; l; l = l->next) { char *source_name; |