aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/importers
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-07-12 20:02:18 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-08-20 02:17:55 +0800
commitc85109fc322137596bf34cffc5445d568223c60d (patch)
tree711e6d5b2eb3d6c7780d1d01e20d980c67a77f9e /addressbook/importers
parent7d1751cc26a75166019917ec8c3b35e1083d27d6 (diff)
downloadgsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar
gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar.gz
gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar.bz2
gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar.lz
gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar.xz
gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar.zst
gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'addressbook/importers')
-rw-r--r--addressbook/importers/evolution-csv-importer.c120
-rw-r--r--addressbook/importers/evolution-ldif-importer.c16
-rw-r--r--addressbook/importers/evolution-vcard-importer.c26
3 files changed, 81 insertions, 81 deletions
diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c
index 9d693e1300..7594ab1cf3 100644
--- a/addressbook/importers/evolution-csv-importer.c
+++ b/addressbook/importers/evolution-csv-importer.c
@@ -103,27 +103,27 @@ static import_fields csv_fields_outlook[] = {
{"Company", E_CONTACT_ORG},
{"Department", E_CONTACT_ORG_UNIT},
{"Job Title", E_CONTACT_TITLE},
- {"Business Street", NOMAP, FLAG_WORK_ADDRESS|FLAG_STREET },
- {"Business Street 2", NOMAP, FLAG_WORK_ADDRESS|FLAG_STREET },
- {"Business Street 3", NOMAP, FLAG_WORK_ADDRESS|FLAG_STREET},
- {"Business City", NOMAP, FLAG_WORK_ADDRESS|FLAG_CITY},
- {"Business State", NOMAP, FLAG_WORK_ADDRESS|FLAG_STATE},
- {"Business Postal Code", NOMAP, FLAG_WORK_ADDRESS|FLAG_POSTAL_CODE},
- {"Business Country", NOMAP, FLAG_WORK_ADDRESS|FLAG_COUNTRY},
- {"Home Street", NOMAP, FLAG_HOME_ADDRESS|FLAG_STREET},
- {"Home Street 2", NOMAP, FLAG_HOME_ADDRESS|FLAG_STREET},
- {"Home Street 3", NOMAP, FLAG_HOME_ADDRESS|FLAG_STREET},
- {"Home City", NOMAP, FLAG_HOME_ADDRESS|FLAG_CITY},
- {"Home State", NOMAP, FLAG_HOME_ADDRESS|FLAG_STATE},
- {"Home Postal Code", NOMAP,FLAG_HOME_ADDRESS|FLAG_POSTAL_CODE},
- {"Home Country", NOMAP, FLAG_HOME_ADDRESS|FLAG_COUNTRY},
- {"Other Street", NOMAP, FLAG_OTHER_ADDRESS|FLAG_STREET},
- {"Other Street 2", NOMAP, FLAG_OTHER_ADDRESS|FLAG_STREET},
- {"Other Street 3", NOMAP, FLAG_OTHER_ADDRESS|FLAG_STREET},
- {"Other City", NOMAP, FLAG_OTHER_ADDRESS|FLAG_CITY},
- {"Other State", NOMAP, FLAG_OTHER_ADDRESS|FLAG_STATE},
- {"Other Postal Code", NOMAP, FLAG_OTHER_ADDRESS|FLAG_POSTAL_CODE},
- {"Other Country", NOMAP, FLAG_OTHER_ADDRESS|FLAG_COUNTRY},
+ {"Business Street", NOMAP, FLAG_WORK_ADDRESS | FLAG_STREET },
+ {"Business Street 2", NOMAP, FLAG_WORK_ADDRESS | FLAG_STREET },
+ {"Business Street 3", NOMAP, FLAG_WORK_ADDRESS | FLAG_STREET},
+ {"Business City", NOMAP, FLAG_WORK_ADDRESS | FLAG_CITY},
+ {"Business State", NOMAP, FLAG_WORK_ADDRESS | FLAG_STATE},
+ {"Business Postal Code", NOMAP, FLAG_WORK_ADDRESS | FLAG_POSTAL_CODE},
+ {"Business Country", NOMAP, FLAG_WORK_ADDRESS | FLAG_COUNTRY},
+ {"Home Street", NOMAP, FLAG_HOME_ADDRESS | FLAG_STREET},
+ {"Home Street 2", NOMAP, FLAG_HOME_ADDRESS | FLAG_STREET},
+ {"Home Street 3", NOMAP, FLAG_HOME_ADDRESS | FLAG_STREET},
+ {"Home City", NOMAP, FLAG_HOME_ADDRESS | FLAG_CITY},
+ {"Home State", NOMAP, FLAG_HOME_ADDRESS | FLAG_STATE},
+ {"Home Postal Code", NOMAP,FLAG_HOME_ADDRESS | FLAG_POSTAL_CODE},
+ {"Home Country", NOMAP, FLAG_HOME_ADDRESS | FLAG_COUNTRY},
+ {"Other Street", NOMAP, FLAG_OTHER_ADDRESS | FLAG_STREET},
+ {"Other Street 2", NOMAP, FLAG_OTHER_ADDRESS | FLAG_STREET},
+ {"Other Street 3", NOMAP, FLAG_OTHER_ADDRESS | FLAG_STREET},
+ {"Other City", NOMAP, FLAG_OTHER_ADDRESS | FLAG_CITY},
+ {"Other State", NOMAP, FLAG_OTHER_ADDRESS | FLAG_STATE},
+ {"Other Postal Code", NOMAP, FLAG_OTHER_ADDRESS | FLAG_POSTAL_CODE},
+ {"Other Country", NOMAP, FLAG_OTHER_ADDRESS | FLAG_COUNTRY},
{"Assistant's Phone", E_CONTACT_PHONE_ASSISTANT},
{"Business Fax", E_CONTACT_PHONE_BUSINESS_FAX},
{"Business Phone", E_CONTACT_PHONE_BUSINESS},
@@ -148,7 +148,7 @@ static import_fields csv_fields_outlook[] = {
{"Assistant's Name", E_CONTACT_ASSISTANT},
{"Billing Information", NOMAP},
{"Birthday", NOMAP, FLAG_DATE_BDAY},
- {"Business Address PO Box", NOMAP, FLAG_WORK_ADDRESS|FLAG_POBOX},
+ {"Business Address PO Box", NOMAP, FLAG_WORK_ADDRESS | FLAG_POBOX},
{"Categories", E_CONTACT_CATEGORIES},
{"Children", NOMAP},
{"Directory Server", NOMAP},
@@ -164,7 +164,7 @@ static import_fields csv_fields_outlook[] = {
{"Gender", NOMAP},
{"Government ID Number", NOMAP},
{"Hobby", NOMAP},
- {"Home Address PO Box", NOMAP, FLAG_HOME_ADDRESS|FLAG_POBOX},
+ {"Home Address PO Box", NOMAP, FLAG_HOME_ADDRESS | FLAG_POBOX},
{"Initials", NOMAP},
{"Internet FREE/BUSY", E_CONTACT_FREEBUSY_URL},
{"Keywords", NOMAP},
@@ -175,7 +175,7 @@ static import_fields csv_fields_outlook[] = {
{"Notes", NOMAP},
{"Office Location", NOMAP},
{"Organizational ID Number", NOMAP},
- {"Other Address PO Box", NOMAP, FLAG_OTHER_ADDRESS|FLAG_POBOX},
+ {"Other Address PO Box", NOMAP, FLAG_OTHER_ADDRESS | FLAG_POBOX},
{"Priority", NOMAP},
{"Private", NOMAP},
{"Profession", NOMAP},
@@ -201,18 +201,18 @@ static import_fields csv_fields_mozilla[] = {
{"Business Fax", E_CONTACT_PHONE_BUSINESS_FAX},
{"Pager", E_CONTACT_PHONE_PAGER},
{"Mobile Phone", E_CONTACT_PHONE_MOBILE},
- {"Home Street", NOMAP, FLAG_HOME_ADDRESS|FLAG_STREET},
- {"Home Street 2", NOMAP, FLAG_HOME_ADDRESS|FLAG_STREET},
- {"Home City", NOMAP, FLAG_HOME_ADDRESS|FLAG_CITY},
- {"Home State", NOMAP, FLAG_HOME_ADDRESS|FLAG_STATE},
- {"Home Postal Code", NOMAP,FLAG_HOME_ADDRESS|FLAG_POSTAL_CODE},
- {"Home Country", NOMAP, FLAG_HOME_ADDRESS|FLAG_COUNTRY},
- {"Business Street", NOMAP, FLAG_WORK_ADDRESS|FLAG_STREET },
- {"Business Street 2", NOMAP, FLAG_WORK_ADDRESS|FLAG_STREET },
- {"Business City", NOMAP, FLAG_WORK_ADDRESS|FLAG_CITY},
- {"Business State", NOMAP, FLAG_WORK_ADDRESS|FLAG_STATE},
- {"Business Postal Code", NOMAP, FLAG_WORK_ADDRESS|FLAG_POSTAL_CODE},
- {"Business Country", NOMAP, FLAG_WORK_ADDRESS|FLAG_COUNTRY},
+ {"Home Street", NOMAP, FLAG_HOME_ADDRESS | FLAG_STREET},
+ {"Home Street 2", NOMAP, FLAG_HOME_ADDRESS | FLAG_STREET},
+ {"Home City", NOMAP, FLAG_HOME_ADDRESS | FLAG_CITY},
+ {"Home State", NOMAP, FLAG_HOME_ADDRESS | FLAG_STATE},
+ {"Home Postal Code", NOMAP,FLAG_HOME_ADDRESS | FLAG_POSTAL_CODE},
+ {"Home Country", NOMAP, FLAG_HOME_ADDRESS | FLAG_COUNTRY},
+ {"Business Street", NOMAP, FLAG_WORK_ADDRESS | FLAG_STREET },
+ {"Business Street 2", NOMAP, FLAG_WORK_ADDRESS | FLAG_STREET },
+ {"Business City", NOMAP, FLAG_WORK_ADDRESS | FLAG_CITY},
+ {"Business State", NOMAP, FLAG_WORK_ADDRESS | FLAG_STATE},
+ {"Business Postal Code", NOMAP, FLAG_WORK_ADDRESS | FLAG_POSTAL_CODE},
+ {"Business Country", NOMAP, FLAG_WORK_ADDRESS | FLAG_COUNTRY},
{"Job Title", E_CONTACT_TITLE},
{"Department", E_CONTACT_ORG_UNIT},
{"Company", E_CONTACT_ORG},
@@ -244,18 +244,18 @@ static import_fields csv_fields_evolution[] = {
{"Business Fax", E_CONTACT_PHONE_BUSINESS_FAX},
{"Pager", E_CONTACT_PHONE_PAGER},
{"Mobile Phone", E_CONTACT_PHONE_MOBILE},
- {"Home Street", NOMAP, FLAG_HOME_ADDRESS|FLAG_STREET},
+ {"Home Street", NOMAP, FLAG_HOME_ADDRESS | FLAG_STREET},
{"Home Street 2", NOMAP, FLAG_INVALID},
- {"Home City", NOMAP, FLAG_HOME_ADDRESS|FLAG_CITY},
- {"Home State", NOMAP, FLAG_HOME_ADDRESS|FLAG_STATE},
- {"Home Postal Code", NOMAP,FLAG_HOME_ADDRESS|FLAG_POSTAL_CODE},
- {"Home Country", NOMAP, FLAG_HOME_ADDRESS|FLAG_COUNTRY},
- {"Business Street", NOMAP, FLAG_WORK_ADDRESS|FLAG_STREET },
+ {"Home City", NOMAP, FLAG_HOME_ADDRESS | FLAG_CITY},
+ {"Home State", NOMAP, FLAG_HOME_ADDRESS | FLAG_STATE},
+ {"Home Postal Code", NOMAP,FLAG_HOME_ADDRESS | FLAG_POSTAL_CODE},
+ {"Home Country", NOMAP, FLAG_HOME_ADDRESS | FLAG_COUNTRY},
+ {"Business Street", NOMAP, FLAG_WORK_ADDRESS | FLAG_STREET },
{"Business Street 2", NOMAP, FLAG_INVALID },
- {"Business City", NOMAP, FLAG_WORK_ADDRESS|FLAG_CITY},
- {"Business State", NOMAP, FLAG_WORK_ADDRESS|FLAG_STATE},
- {"Business Postal Code", NOMAP, FLAG_WORK_ADDRESS|FLAG_POSTAL_CODE},
- {"Business Country", NOMAP, FLAG_WORK_ADDRESS|FLAG_COUNTRY},
+ {"Business City", NOMAP, FLAG_WORK_ADDRESS | FLAG_CITY},
+ {"Business State", NOMAP, FLAG_WORK_ADDRESS | FLAG_STATE},
+ {"Business Postal Code", NOMAP, FLAG_WORK_ADDRESS | FLAG_POSTAL_CODE},
+ {"Business Country", NOMAP, FLAG_WORK_ADDRESS | FLAG_COUNTRY},
{"Job Title", E_CONTACT_TITLE},
{"Office", E_CONTACT_OFFICE},
{"Company", E_CONTACT_ORG},
@@ -431,9 +431,9 @@ parseLine (CSVImporter *gci,
EContactAddress *home_address = NULL, *work_address = NULL, *other_address = NULL;
EContactDate *bday = NULL;
GString *home_street, *work_street, *other_street;
- home_street = g_string_new("");
- work_street = g_string_new("");
- other_street = g_string_new("");
+ home_street = g_string_new ("");
+ work_street = g_string_new ("");
+ other_street = g_string_new ("");
home_address = g_new0 (EContactAddress, 1);
work_address = g_new0 (EContactAddress, 1);
other_address = g_new0 (EContactAddress, 1);
@@ -506,7 +506,7 @@ parseLine (CSVImporter *gci,
case FLAG_HOME_ADDRESS | FLAG_STREET:
if (strlen (home_street->str) != 0) {
- home_street = g_string_append(home_street, ",\n");
+ home_street = g_string_append (home_street, ",\n");
}
home_street = g_string_append (home_street, value->str);
break;
@@ -528,7 +528,7 @@ parseLine (CSVImporter *gci,
case FLAG_WORK_ADDRESS | FLAG_STREET:
if (strlen (work_street->str) != 0) {
- work_street = g_string_append(work_street, ",\n");
+ work_street = g_string_append (work_street, ",\n");
}
work_street = g_string_append (work_street, value->str);
break;
@@ -550,7 +550,7 @@ parseLine (CSVImporter *gci,
case FLAG_OTHER_ADDRESS | FLAG_STREET:
if (strlen (other_street->str) != 0) {
- other_street = g_string_append(other_street, ",\n");
+ other_street = g_string_append (other_street, ",\n");
}
other_street = g_string_append (other_street, value->str);
break;
@@ -646,7 +646,7 @@ getNextCSVEntry (CSVImporter *gci,
gchar *buf;
gchar c;
- line = g_string_new("");
+ line = g_string_new ("");
while (1) {
c = fgetc (f);
if (c == EOF)
@@ -671,7 +671,7 @@ getNextCSVEntry (CSVImporter *gci,
if (gci->count == 0 && importer != MOZILLA_IMPORTER) {
gci->fields_map = map_fields (line->str, importer);
g_string_free (line, TRUE);
- line = g_string_new("");
+ line = g_string_new ("");
while (1) {
c = fgetc (f);
if (c == EOF)
@@ -695,7 +695,7 @@ getNextCSVEntry (CSVImporter *gci,
gci->count++;
}
- str = g_string_new("");
+ str = g_string_new ("");
str = g_string_append (str, line->str);
g_string_free (line, TRUE);
@@ -784,7 +784,7 @@ csv_getwidget (EImport *ei,
E_SOURCE_SELECTOR (selector), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), selector, FALSE, TRUE, 6);
- primary = g_datalist_get_data(&target->data, "csv-source");
+ primary = g_datalist_get_data (&target->data, "csv-source");
if (primary == NULL) {
GList *list;
@@ -830,7 +830,7 @@ csv_supported (EImport *ei,
if (s->uri_src == NULL)
return TRUE;
- if (strncmp(s->uri_src, "file:///", 8) != 0)
+ if (strncmp (s->uri_src, "file:///", 8) != 0)
return FALSE;
ext = strrchr (s->uri_src, '.');
@@ -912,13 +912,13 @@ csv_import (EImport *ei,
file = g_fopen (filename, "r");
g_free (filename);
if (file == NULL) {
- g_message("Can't open .csv file");
+ g_message ("Can't open .csv file");
e_import_complete (ei, target);
return;
}
gci = g_malloc0 (sizeof (*gci));
- g_datalist_set_data(&target->data, "csv-data", gci);
+ g_datalist_set_data (&target->data, "csv-data", gci);
gci->import = g_object_ref (ei);
gci->target = target;
gci->file = file;
@@ -967,7 +967,7 @@ csv_cancel (EImport *ei,
EImportTarget *target,
EImportImporter *im)
{
- CSVImporter *gci = g_datalist_get_data(&target->data, "csv-data");
+ CSVImporter *gci = g_datalist_get_data (&target->data, "csv-data");
if (gci)
gci->state = 1;
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c
index bf1c15793c..3adf2afe4f 100644
--- a/addressbook/importers/evolution-ldif-importer.c
+++ b/addressbook/importers/evolution-ldif-importer.c
@@ -130,7 +130,7 @@ ldif_fields[] = {
static GString *
getValue (gchar **src)
{
- GString *dest = g_string_new("");
+ GString *dest = g_string_new ("");
gchar *s = *src;
gboolean need_base64 = (*s == ':');
@@ -582,7 +582,7 @@ ldif_getwidget (EImport *ei,
E_SOURCE_SELECTOR (selector), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), selector, FALSE, TRUE, 6);
- primary = g_datalist_get_data(&target->data, "ldif-source");
+ primary = g_datalist_get_data (&target->data, "ldif-source");
if (primary == NULL) {
GList *list;
@@ -628,7 +628,7 @@ ldif_supported (EImport *ei,
if (s->uri_src == NULL)
return TRUE;
- if (strncmp(s->uri_src, "file:///", 8) != 0)
+ if (strncmp (s->uri_src, "file:///", 8) != 0)
return FALSE;
ext = strrchr (s->uri_src, '.');
@@ -696,17 +696,17 @@ ldif_import (EImport *ei,
filename = g_filename_from_uri (s->uri_src, NULL, NULL);
if (filename != NULL) {
- file = g_fopen(filename, "r");
+ file = g_fopen (filename, "r");
g_free (filename);
}
if (file == NULL) {
- g_message(G_STRLOC ":Can't open .ldif file");
+ g_message (G_STRLOC ":Can't open .ldif file");
e_import_complete (ei, target);
return;
}
gci = g_malloc0 (sizeof (*gci));
- g_datalist_set_data(&target->data, "ldif-data", gci);
+ g_datalist_set_data (&target->data, "ldif-data", gci);
gci->import = g_object_ref (ei);
gci->target = target;
gci->file = file;
@@ -730,7 +730,7 @@ ldif_cancel (EImport *ei,
EImportTarget *target,
EImportImporter *im)
{
- LDIFImporter *gci = g_datalist_get_data(&target->data, "ldif-data");
+ LDIFImporter *gci = g_datalist_get_data (&target->data, "ldif-data");
if (gci)
gci->state = 2;
@@ -755,7 +755,7 @@ ldif_get_preview (EImport *ei,
return NULL;
}
- file = g_fopen(filename, "r");
+ file = g_fopen (filename, "r");
g_free (filename);
if (file == NULL) {
diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c
index b20bdd18de..2e452c24ad 100644
--- a/addressbook/importers/evolution-vcard-importer.c
+++ b/addressbook/importers/evolution-vcard-importer.c
@@ -133,7 +133,7 @@ vcard_import_contact (VCardImporter *gci,
GList *v = e_vcard_attribute_get_values (a);
if (v && v->data) {
- if (!strncmp ((gchar *)v->data, "<?xml", 5)) {
+ if (!strncmp ((gchar *) v->data, "<?xml", 5)) {
EDestination *dest = e_destination_import ((gchar *) v->data);
e_destination_export_to_vcard_attribute (dest, a);
@@ -174,12 +174,12 @@ vcard_import_contact (VCardImporter *gci,
vs = e_vcard_attribute_param_get_values (p);
for (v = vs; v; v = v->next) {
is_work_home = is_work_home ||
- !g_ascii_strcasecmp ((gchar *)v->data, "WORK") ||
- !g_ascii_strcasecmp ((gchar *)v->data, "HOME");
+ !g_ascii_strcasecmp ((gchar *) v->data, "WORK") ||
+ !g_ascii_strcasecmp ((gchar *) v->data, "HOME");
- if (!g_ascii_strcasecmp ((gchar *)v->data, "WORK") ||
- !g_ascii_strcasecmp ((gchar *)v->data, "HOME") ||
- !g_ascii_strcasecmp ((gchar *)v->data, "OTHER"))
+ if (!g_ascii_strcasecmp ((gchar *) v->data, "WORK") ||
+ !g_ascii_strcasecmp ((gchar *) v->data, "HOME") ||
+ !g_ascii_strcasecmp ((gchar *) v->data, "OTHER"))
no_location = FALSE;
else
location_only = FALSE;
@@ -227,8 +227,8 @@ vcard_import_contact (VCardImporter *gci,
vs = e_vcard_attribute_param_get_values (p);
for (v = vs; v; v = v->next) {
- if (!g_ascii_strcasecmp ((gchar *)v->data, "WORK") ||
- !g_ascii_strcasecmp ((gchar *)v->data, "HOME"))
+ if (!g_ascii_strcasecmp ((gchar *) v->data, "WORK") ||
+ !g_ascii_strcasecmp ((gchar *) v->data, "HOME"))
no_location = FALSE;
}
}
@@ -421,7 +421,7 @@ vcard_getwidget (EImport *ei,
E_SOURCE_SELECTOR (selector), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), selector, FALSE, TRUE, 6);
- primary = g_datalist_get_data(&target->data, "vcard-source");
+ primary = g_datalist_get_data (&target->data, "vcard-source");
if (primary == NULL) {
GList *list;
@@ -463,7 +463,7 @@ vcard_supported (EImport *ei,
if (s->uri_src == NULL)
return TRUE;
- if (strncmp(s->uri_src, "file:///", 8) != 0)
+ if (strncmp (s->uri_src, "file:///", 8) != 0)
return FALSE;
filename = g_filename_from_uri (s->uri_src, NULL, NULL);
@@ -549,7 +549,7 @@ vcard_import (EImport *ei,
filename = g_filename_from_uri (s->uri_src, NULL, NULL);
if (filename == NULL) {
- g_message(G_STRLOC ": Couldn't get filename from URI '%s'", s->uri_src);
+ g_message (G_STRLOC ": Couldn't get filename from URI '%s'", s->uri_src);
e_import_complete (ei, target);
return;
}
@@ -571,7 +571,7 @@ vcard_import (EImport *ei,
g_free (filename);
gci = g_malloc0 (sizeof (*gci));
- g_datalist_set_data(&target->data, "vcard-data", gci);
+ g_datalist_set_data (&target->data, "vcard-data", gci);
gci->import = g_object_ref (ei);
gci->target = target;
gci->encoding = encoding;
@@ -589,7 +589,7 @@ vcard_cancel (EImport *ei,
EImportTarget *target,
EImportImporter *im)
{
- VCardImporter *gci = g_datalist_get_data(&target->data, "vcard-data");
+ VCardImporter *gci = g_datalist_get_data (&target->data, "vcard-data");
if (gci)
gci->state = 1;