aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook-migrate.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-11-15 06:04:21 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-11-15 06:04:21 +0800
commit9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91 (patch)
tree2e1e96f33404781354c422a7e9beaf458ebeb655 /addressbook/gui/component/addressbook-migrate.c
parent7e8f8bb9e5167b0219b48ab3e8062080d3740b0a (diff)
downloadgsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.gz
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.zst
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.zip
** Remove trailing whitespace from source code.
2007-11-14 Matthew Barnes <mbarnes@redhat.com> ** Remove trailing whitespace from source code. svn path=/trunk/; revision=34537
Diffstat (limited to 'addressbook/gui/component/addressbook-migrate.c')
-rw-r--r--addressbook/gui/component/addressbook-migrate.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c
index 249cdf7a12..1974ada536 100644
--- a/addressbook/gui/component/addressbook-migrate.c
+++ b/addressbook/gui/component/addressbook-migrate.c
@@ -1,5 +1,5 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
+/*
* Copyright (C) 2004, Novell, Inc.
*
* This program is free software; you can redistribute it and/or
@@ -73,28 +73,28 @@ setup_progress_dialog (MigrationContext *context)
gtk_window_set_title (GTK_WINDOW (context->window), _("Migrating..."));
gtk_window_set_modal (GTK_WINDOW (context->window), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (context->window), 6);
-
+
vbox = gtk_vbox_new (FALSE, 6);
gtk_widget_show (vbox);
gtk_container_add (GTK_CONTAINER (context->window), vbox);
-
+
context->label = gtk_label_new ("");
gtk_label_set_line_wrap (GTK_LABEL (context->label), TRUE);
gtk_widget_show (context->label);
gtk_box_pack_start_defaults (GTK_BOX (vbox), context->label);
-
+
hbox = gtk_hbox_new (FALSE, 6);
gtk_widget_show (hbox);
gtk_box_pack_start_defaults (GTK_BOX (vbox), hbox);
-
+
context->folder_label = gtk_label_new ("");
gtk_widget_show (context->folder_label);
gtk_box_pack_start_defaults (GTK_BOX (hbox), context->folder_label);
-
+
context->progress = gtk_progress_bar_new ();
gtk_widget_show (context->progress);
gtk_box_pack_start_defaults (GTK_BOX (hbox), context->progress);
-
+
gtk_widget_show (context->window);
}
@@ -121,13 +121,13 @@ static void
dialog_set_folder_name (MigrationContext *context, const char *folder_name)
{
char *text;
-
+
text = g_strdup_printf (_("Migrating `%s':"), folder_name);
gtk_label_set_text (GTK_LABEL (context->folder_label), text);
g_free (text);
-
+
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (context->progress), 0.0);
-
+
while (gtk_events_pending ())
gtk_main_iteration ();
@@ -140,12 +140,12 @@ static void
dialog_set_progress (MigrationContext *context, double percent)
{
char text[5];
-
+
snprintf (text, sizeof (text), "%d%%", (int) (percent * 100.0f));
-
+
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (context->progress), percent);
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (context->progress), text);
-
+
while (gtk_events_pending ())
gtk_main_iteration ();
@@ -229,7 +229,7 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book)
/* both books are loaded, start the actual migration */
e_book_get_contacts (old_book, query, &contacts, NULL);
- e_book_query_unref (query);
+ e_book_query_unref (query);
num_contacts = g_list_length (contacts);
for (l = contacts; l; l = l->next) {
@@ -334,7 +334,7 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book)
params = e_vcard_attribute_get_params (a);
if (!params)
e_vcard_attribute_add_param_with_value (a,
- e_vcard_attribute_param_new (EVC_TYPE),
+ e_vcard_attribute_param_new (EVC_TYPE),
"OTHER");
if (v && v->data) {
@@ -973,7 +973,7 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup
}
attr = next_attr;
-
+
if (converted)
break;
}
@@ -1004,10 +1004,10 @@ migrate_pilot_data (const char *old_path, const char *new_path)
const char *ext;
char *filename;
GDir *dir;
-
+
if (!(dir = g_dir_open (old_path, 0, NULL)))
return;
-
+
while ((dent = g_dir_read_name (dir))) {
if ((!strncmp (dent, "pilot-map-", 10) &&
((ext = strrchr (dent, '.')) && !strcmp (ext, ".xml"))) ||
@@ -1018,13 +1018,13 @@ migrate_pilot_data (const char *old_path, const char *new_path)
size_t nread, nwritten;
int fd0, fd1;
ssize_t n;
-
+
filename = g_build_filename (old_path, dent, NULL);
if ((fd0 = g_open (filename, O_RDONLY | O_BINARY, 0)) == -1) {
g_free (filename);
continue;
}
-
+
g_free (filename);
filename = g_build_filename (new_path, dent, NULL);
if ((fd1 = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666)) == -1) {
@@ -1032,30 +1032,30 @@ migrate_pilot_data (const char *old_path, const char *new_path)
close (fd0);
continue;
}
-
+
do {
do {
n = read (fd0, inbuf, sizeof (inbuf));
} while (n == -1 && errno == EINTR);
-
+
if (n < 1)
break;
-
+
nread = n;
nwritten = 0;
do {
do {
n = write (fd1, inbuf + nwritten, nread - nwritten);
} while (n == -1 && errno == EINTR);
-
+
if (n > 0)
nwritten += n;
} while (nwritten < nread && n != -1);
-
+
if (n == -1)
break;
} while (1);
-
+
if (n != -1)
n = fsync (fd1);
@@ -1063,13 +1063,13 @@ migrate_pilot_data (const char *old_path, const char *new_path)
g_warning ("Failed to migrate %s: %s", dent, strerror (errno));
g_unlink (filename);
}
-
+
close (fd0);
close (fd1);
g_free (filename);
}
}
-
+
g_dir_close (dir);
}
@@ -1077,7 +1077,7 @@ static MigrationContext*
migration_context_new (AddressbookComponent *component)
{
MigrationContext *context = g_new (MigrationContext, 1);
-
+
/* set up the mapping from old uris to new uids */
context->folder_uid_map = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)g_free);
@@ -1122,12 +1122,12 @@ addressbook_migrate (AddressbookComponent *component, int major, int minor, int
further decomposition will happen below. */
&& (minor < 5 || (minor == 5 && revision <= 10)))
need_dialog = TRUE;
-
+
if (need_dialog)
setup_progress_dialog (context);
if (major == 1) {
-
+
if (minor < 5 || (minor == 5 && revision <= 2)) {
/* initialize our dialog */
dialog_set_label (context,
@@ -1160,13 +1160,13 @@ addressbook_migrate (AddressbookComponent *component, int major, int minor, int
migrate_company_phone_for_local_folders (context, on_this_computer);
}
-
+
if (minor < 5 || (minor == 5 && revision <= 10)) {
char *old_path, *new_path;
-
+
dialog_set_label (context, _("Evolution's Palm Sync changelog and map files have changed.\n\n"
"Please be patient while Evolution migrates your Pilot Sync data..."));
-
+
old_path = g_build_filename (g_get_home_dir (), "evolution", "local", "Contacts", NULL);
new_path = g_build_filename (addressbook_component_peek_base_directory (component),
"addressbook", "local", "system", NULL);
@@ -1204,7 +1204,7 @@ addressbook_migrate (AddressbookComponent *component, int major, int minor, int
g_object_unref (on_ldap_servers);
if (personal_source)
g_object_unref (personal_source);
-
+
migration_context_free (context);