aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/importers
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-07-19 02:05:05 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-07-19 02:05:38 +0800
commitdcf2c0e754d6e251733cea74c2427738122620af (patch)
tree358d2c639c2a5b5cf5fc8f28c515076f8b4d4e5d /addressbook/importers
parent76fc1247ba88575c0f6e0040672e19e66f53da4f (diff)
downloadgsoc2013-evolution-dcf2c0e754d6e251733cea74c2427738122620af.tar.gz
gsoc2013-evolution-dcf2c0e754d6e251733cea74c2427738122620af.tar.zst
gsoc2013-evolution-dcf2c0e754d6e251733cea74c2427738122620af.zip
More whitespace cleanup.
Diffstat (limited to 'addressbook/importers')
-rw-r--r--addressbook/importers/evolution-csv-importer.c62
-rw-r--r--addressbook/importers/evolution-ldif-importer.c4
2 files changed, 33 insertions, 33 deletions
diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c
index 6f88bb9cbd..231d799957 100644
--- a/addressbook/importers/evolution-csv-importer.c
+++ b/addressbook/importers/evolution-csv-importer.c
@@ -283,7 +283,7 @@ add_to_notes(EContact *contact, gint i, gchar *val) {
return;
new_text = g_string_new(old_text);
- if(strlen(new_text->str) != 0)
+ if (strlen(new_text->str) != 0)
new_text = g_string_append_c(new_text, '\n');
new_text = g_string_append(new_text, field_text);
new_text = g_string_append_c(new_text, ':');
@@ -357,12 +357,12 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) {
ptr = do_free;
}
- while(*ptr != '\n') {
+ while (*ptr != '\n') {
value = g_string_new("");
- while(*ptr != delimiter) {
- if(*ptr == '\n')
+ while (*ptr != delimiter) {
+ if (*ptr == '\n')
break;
- if(*ptr != '"') {
+ if (*ptr != '"') {
g_string_append_unichar (value, g_utf8_get_char (ptr));
}
else {
@@ -381,13 +381,13 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) {
contact_field = NOMAP;
flags = FLAG_INVALID;
- if(importer == OUTLOOK_IMPORTER) {
+ if (importer == OUTLOOK_IMPORTER) {
if (i >= 0 && i < G_N_ELEMENTS (csv_fields_outlook)) {
contact_field = csv_fields_outlook[i].contact_field;
flags = csv_fields_outlook[i].flags;
}
}
- else if(importer == MOZILLA_IMPORTER) {
+ else if (importer == MOZILLA_IMPORTER) {
if (i >= 0 && i < G_N_ELEMENTS (csv_fields_mozilla)) {
contact_field = csv_fields_mozilla[i].contact_field;
flags = csv_fields_mozilla[i].flags;
@@ -400,12 +400,12 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) {
}
}
- if(strlen(value->str) != 0) {
+ if (strlen(value->str) != 0) {
if (contact_field != NOMAP) {
- if(importer == OUTLOOK_IMPORTER) {
+ if (importer == OUTLOOK_IMPORTER) {
if (i >= 0 && i < G_N_ELEMENTS (csv_fields_outlook))
e_contact_set (contact, csv_fields_outlook[i].contact_field, value->str);
- } else if(importer == MOZILLA_IMPORTER) {
+ } else if (importer == MOZILLA_IMPORTER) {
if (i >= 0 && i < G_N_ELEMENTS (csv_fields_mozilla))
e_contact_set (contact, csv_fields_mozilla[i].contact_field, value->str);
} else {
@@ -421,7 +421,7 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) {
switch (flags) {
case FLAG_HOME_ADDRESS|FLAG_STREET:
- if(strlen(home_street->str) != 0) {
+ if (strlen(home_street->str) != 0) {
home_street = g_string_append(home_street, ",\n");
}
home_street = g_string_append(home_street, value->str);
@@ -443,7 +443,7 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) {
break;
case FLAG_WORK_ADDRESS|FLAG_STREET:
- if(strlen(work_street->str) != 0) {
+ if (strlen(work_street->str) != 0) {
work_street = g_string_append(work_street, ",\n");
}
work_street = g_string_append(work_street, value->str);
@@ -465,7 +465,7 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) {
break;
case FLAG_OTHER_ADDRESS|FLAG_STREET:
- if(strlen(other_street->str) != 0) {
+ if (strlen(other_street->str) != 0) {
other_street = g_string_append(other_street, ",\n");
}
other_street = g_string_append(other_street, value->str);
@@ -515,30 +515,30 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) {
}
i++;
g_string_free(value, TRUE);
- if(*ptr != '\n')
+ if (*ptr != '\n')
ptr = g_utf8_next_char (ptr);
}
- if(strlen(home_street->str) != 0)
+ if (strlen(home_street->str) != 0)
home_address->street = g_strdup(home_street->str);
- if(strlen(work_street->str) != 0)
+ if (strlen(work_street->str) != 0)
work_address->street = g_strdup(work_street->str);
- if(strlen(other_street->str) != 0)
+ if (strlen(other_street->str) != 0)
other_address->street = g_strdup(other_street->str);
g_string_free(home_street, TRUE);
g_string_free(work_street, TRUE);
g_string_free(other_street, TRUE);
- if(home_address->locality || home_address->country ||
+ if (home_address->locality || home_address->country ||
home_address->code || home_address->region || home_address->street)
e_contact_set (contact, E_CONTACT_ADDRESS_HOME, home_address);
- if(work_address->locality || work_address->country ||
+ if (work_address->locality || work_address->country ||
work_address->code || work_address->region || work_address->street)
e_contact_set (contact, E_CONTACT_ADDRESS_WORK, work_address);
- if(other_address->locality || other_address->country ||
+ if (other_address->locality || other_address->country ||
other_address->code || other_address->region || other_address->street)
e_contact_set (contact, E_CONTACT_ADDRESS_OTHER, other_address);
- if(importer != OUTLOOK_IMPORTER) {
+ if (importer != OUTLOOK_IMPORTER) {
if (bday->day || bday->year || bday->month)
e_contact_set(contact, E_CONTACT_BIRTH_DATE, bday);
}
@@ -557,11 +557,11 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) {
gchar c;
/*
- if(!fgets(line, sizeof(line),f))
+ if (!fgets(line, sizeof(line),f))
return NULL;
- if(gci->count == 0 && importer != MOZILLA_IMPORTER) {
- if(!fgets(line, sizeof(line),f))
+ if (gci->count == 0 && importer != MOZILLA_IMPORTER) {
+ if (!fgets(line, sizeof(line),f))
return NULL;
gci->count ++;
}
@@ -589,7 +589,7 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) {
g_string_append_c (line, c);
}
- if(gci->count == 0 && importer != MOZILLA_IMPORTER) {
+ if (gci->count == 0 && importer != MOZILLA_IMPORTER) {
g_string_free (line, TRUE);
line = g_string_new("");
while (1) {
@@ -620,7 +620,7 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) {
g_string_free (line, TRUE);
- if(strlen(str->str) == 0) {
+ if (strlen(str->str) == 0) {
g_string_free(str, TRUE);
return NULL;
}
@@ -629,7 +629,7 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) {
buf = str->str;
- if(!parseLine (gci, contact, buf)) {
+ if (!parseLine (gci, contact, buf)) {
g_object_unref(contact);
return NULL;
}
@@ -649,10 +649,10 @@ csv_import_contacts(gpointer d) {
e_book_add_contact(gci->book, contact, NULL);
gci->contacts = g_slist_prepend(gci->contacts, contact);
}
- if(contact == NULL) {
+ if (contact == NULL) {
gci->state = 1;
}
- if(gci->state == 1) {
+ if (gci->state == 1) {
csv_import_done(gci);
return FALSE;
}
@@ -769,7 +769,7 @@ csv_import (EImport *ei, EImportTarget *target, EImportImporter *im)
EImportTargetURI *s = (EImportTargetURI *) target;
book = e_book_new(g_datalist_get_data(&target->data, "csv-source"), NULL);
- if(book == NULL) {
+ if (book == NULL) {
g_message("Couldn't Create EBook");
e_import_complete(ei, target);
return;
@@ -824,7 +824,7 @@ static void
csv_cancel(EImport *ei, EImportTarget *target, EImportImporter *im) {
CSVImporter *gci = g_datalist_get_data(&target->data, "csv-data");
- if(gci)
+ if (gci)
gci->state = 1;
}
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c
index 2c8b24cac5..efc4a2bf71 100644
--- a/addressbook/importers/evolution-ldif-importer.c
+++ b/addressbook/importers/evolution-ldif-importer.c
@@ -137,7 +137,7 @@ getValue( gchar **src )
gboolean need_base64 = (*s == ':');
copy_line:
- while( *s != 0 && *s != '\n' && *s != '\r' )
+ while ( *s != 0 && *s != '\n' && *s != '\r' )
dest = g_string_append_c (dest, *s++);
if (*s == '\r') s++;
@@ -250,7 +250,7 @@ parseLine (LDIFImporter *gci, EContact *contact,
}
/* first, check for a 'continuation' line */
- if( ptr[0] == ' ' && ptr[1] != '\n' ) {
+ if ( ptr[0] == ' ' && ptr[1] != '\n' ) {
g_warning ("unexpected continuation line");
return FALSE;
}