diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-07-12 20:02:18 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-08-20 02:17:55 +0800 |
commit | c85109fc322137596bf34cffc5445d568223c60d (patch) | |
tree | 711e6d5b2eb3d6c7780d1d01e20d980c67a77f9e /mail/importers | |
parent | 7d1751cc26a75166019917ec8c3b35e1083d27d6 (diff) | |
download | gsoc2013-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 'mail/importers')
-rw-r--r-- | mail/importers/elm-importer.c | 22 | ||||
-rw-r--r-- | mail/importers/evolution-mbox-importer.c | 11 | ||||
-rw-r--r-- | mail/importers/mail-importer.c | 10 | ||||
-rw-r--r-- | mail/importers/pine-importer.c | 34 |
4 files changed, 39 insertions, 38 deletions
diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c index 24db1041e3..5b555cb1c7 100644 --- a/mail/importers/elm-importer.c +++ b/mail/importers/elm-importer.c @@ -126,12 +126,12 @@ elm_get_rc (EImport *ei, GHashTable *prefs; gchar *elmrc; - prefs = g_object_get_data((GObject *)ei, "elm-rc"); + prefs = g_object_get_data ((GObject *) ei, "elm-rc"); if (prefs == NULL) { - elmrc = g_build_filename(g_get_home_dir(), ".elm/elmrc", NULL); + elmrc = g_build_filename (g_get_home_dir (), ".elm/elmrc", NULL); prefs = parse_elm_rc (elmrc); g_free (elmrc); - g_object_set_data((GObject *)ei, "elm-rc", prefs); + g_object_set_data ((GObject *) ei, "elm-rc", prefs); } if (prefs == NULL) @@ -152,13 +152,13 @@ elm_supported (EImport *ei, if (target->type != E_IMPORT_TARGET_HOME) return FALSE; - elmdir = g_build_filename(g_get_home_dir (), ".elm", NULL); + elmdir = g_build_filename (g_get_home_dir (), ".elm", NULL); exists = g_file_test (elmdir, G_FILE_TEST_IS_DIR); g_free (elmdir); if (!exists) return FALSE; - maildir = elm_get_rc(ei, "maildir"); + maildir = elm_get_rc (ei, "maildir"); if (maildir == NULL) maildir = "Mail"; @@ -202,7 +202,7 @@ elm_import_exec (struct _elm_import_msg *m, shell_backend = e_shell_get_backend_by_name (shell, "mail"); session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)); - maildir = elm_get_rc(m->import, "maildir"); + maildir = elm_get_rc (m->import, "maildir"); if (maildir == NULL) maildir = "Mail"; @@ -289,7 +289,7 @@ mail_importer_elm_import (EImport *ei, gint id; m = mail_msg_new (&elm_import_info); - g_datalist_set_data(&target->data, "elm-msg", m); + g_datalist_set_data (&target->data, "elm-msg", m); m->import = ei; g_object_ref (m->import); m->target = (EImportTargetHome *) target; @@ -325,11 +325,11 @@ elm_getwidget (EImport *ei, GtkWidget *box, *w; g_datalist_set_data ( - &target->data, "elm-do-mail", GINT_TO_POINTER(TRUE)); + &target->data, "elm-do-mail", GINT_TO_POINTER (TRUE)); box = gtk_vbox_new (FALSE, 2); - w = gtk_check_button_new_with_label(_("Mail")); + w = gtk_check_button_new_with_label (_("Mail")); gtk_toggle_button_set_active ((GtkToggleButton *) w, TRUE); g_signal_connect ( w, "toggled", @@ -346,7 +346,7 @@ elm_import (EImport *ei, EImportTarget *target, EImportImporter *im) { - if (GPOINTER_TO_INT(g_datalist_get_data(&target->data, "elm-do-mail"))) + if (GPOINTER_TO_INT (g_datalist_get_data (&target->data, "elm-do-mail"))) mail_importer_elm_import (ei, target); else e_import_complete (ei, target); @@ -357,7 +357,7 @@ elm_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) { - struct _elm_import_msg *m = g_datalist_get_data(&target->data, "elm-msg"); + struct _elm_import_msg *m = g_datalist_get_data (&target->data, "elm-msg"); if (m) g_cancellable_cancel (m->status); diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index 24a63c3af0..a024729bc2 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -184,7 +184,7 @@ mbox_supported (EImport *ei, if (s->uri_src == NULL) return TRUE; - if (strncmp(s->uri_src, "file:///", strlen("file:///")) != 0) + if (strncmp (s->uri_src, "file:///", strlen ("file:///")) != 0) return FALSE; filename = g_filename_from_uri (s->uri_src, NULL, NULL); @@ -192,7 +192,7 @@ mbox_supported (EImport *ei, g_free (filename); if (fd != -1) { n = read (fd, signature, 5); - ret = n == 5 && memcmp(signature, "From ", 5) == 0; + ret = n == 5 && memcmp (signature, "From ", 5) == 0; close (fd); } @@ -272,7 +272,7 @@ mbox_import (EImport *ei, /* TODO: do we validate target? */ importer = g_malloc0 (sizeof (*importer)); - g_datalist_set_data(&target->data, "mbox-data", importer); + g_datalist_set_data (&target->data, "mbox-data", importer); importer->import = ei; importer->target = target; importer->status_lock = g_mutex_new (); @@ -296,7 +296,7 @@ mbox_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) { - MboxImporter *importer = g_datalist_get_data(&target->data, "mbox-data"); + MboxImporter *importer = g_datalist_get_data (&target->data, "mbox-data"); if (importer) g_cancellable_cancel (importer->cancellable); @@ -407,7 +407,8 @@ mbox_get_preview (EImport *ei, camel_mime_message_get_from (msg))); gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, camel_mime_message_get_subject (msg) ? camel_mime_message_get_subject (msg) : "", 1, from ? from : "", 2, msg, -1); diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index 824d48a444..789a7d3611 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -177,13 +177,13 @@ import_mbox_exec (struct _import_mbox_msg *m, info = camel_message_info_new (NULL); - tmp = camel_medium_get_header((CamelMedium *)msg, "X-Mozilla-Status"); + tmp = camel_medium_get_header ((CamelMedium *) msg, "X-Mozilla-Status"); if (tmp) flags |= decode_mozilla_status (tmp); - tmp = camel_medium_get_header((CamelMedium *)msg, "Status"); + tmp = camel_medium_get_header ((CamelMedium *) msg, "Status"); if (tmp) flags |= decode_status (tmp); - tmp = camel_medium_get_header((CamelMedium *)msg, "X-Status"); + tmp = camel_medium_get_header ((CamelMedium *) msg, "X-Status"); if (tmp) flags |= decode_status (tmp); @@ -348,7 +348,7 @@ import_folders_rec (struct _import_folders_data *m, data_dir, folderparent, folder); } - printf("importing to uri %s\n", uri); + printf ("importing to uri %s\n", uri); mail_importer_import_mbox_sync ( m->session, filefull, uri, m->cancellable); g_free (uri); @@ -356,7 +356,7 @@ import_folders_rec (struct _import_folders_data *m, /* This little gem re-uses the stat buffer and filefull * to automagically scan mozilla-format folders. */ if (!m->elmfmt) { - gchar *tmp = g_strdup_printf("%s.sbd", filefull); + gchar *tmp = g_strdup_printf ("%s.sbd", filefull); g_free (filefull); filefull = tmp; diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index dbcc488f03..664a77bcba 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -71,11 +71,11 @@ pine_supported (EImport *ei, if (target->type != E_IMPORT_TARGET_HOME) return FALSE; - maildir = g_build_filename(g_get_home_dir (), "mail", NULL); + maildir = g_build_filename (g_get_home_dir (), "mail", NULL); md_exists = g_file_test (maildir, G_FILE_TEST_IS_DIR); g_free (maildir); - addrfile = g_build_filename(g_get_home_dir (), ".addressbook", NULL); + addrfile = g_build_filename (g_get_home_dir (), ".addressbook", NULL); addr_exists = g_file_test (addrfile, G_FILE_TEST_IS_REGULAR); g_free (addrfile); @@ -109,7 +109,7 @@ import_contact (EBookClient *book_client, GError *error = NULL; card = e_contact_new (); - strings = g_strsplit(line, "\t", 5); + strings = g_strsplit (line, "\t", 5); if (strings[0] && strings[1] && strings[2]) { gchar *new_uid = NULL; @@ -121,7 +121,7 @@ import_contact (EBookClient *book_client, if (addr[0] == '(' && addr[len - 1] == ')') { addr[0] = 0; addr[len - 1] = 0; - addrs = g_strsplit(addr+1, ",", 0); + addrs = g_strsplit (addr + 1, ",", 0); list = NULL; /* XXX So ... this api is just insane ... we set * plain strings as the contact email if it @@ -184,14 +184,14 @@ import_contacts (void) const gchar *extension_name; GError *error = NULL; - printf("importing pine addressbook\n"); + printf ("importing pine addressbook\n"); shell = e_shell_get_default (); registry = e_shell_get_registry (shell); extension_name = E_SOURCE_EXTENSION_ADDRESS_BOOK; - name = g_build_filename(g_get_home_dir(), ".addressbook", NULL); - fp = fopen(name, "r"); + name = g_build_filename (g_get_home_dir (), ".addressbook", NULL); + fp = fopen (name, "r"); g_free (name); if (fp == NULL) return; @@ -219,7 +219,7 @@ import_contacts (void) return; } - line = g_string_new(""); + line = g_string_new (""); g_string_set_size (line, 256); offset = 0; while (fgets (line->str + offset, 256, fp)) { @@ -273,13 +273,13 @@ pine_import_exec (struct _pine_import_msg *m, shell_backend = e_shell_get_backend_by_name (shell, "mail"); session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)); - if (GPOINTER_TO_INT(g_datalist_get_data(&m->target->data, "pine-do-addr"))) + if (GPOINTER_TO_INT (g_datalist_get_data (&m->target->data, "pine-do-addr"))) import_contacts (); - if (GPOINTER_TO_INT(g_datalist_get_data(&m->target->data, "pine-do-mail"))) { + if (GPOINTER_TO_INT (g_datalist_get_data (&m->target->data, "pine-do-mail"))) { gchar *path; - path = g_build_filename(g_get_home_dir(), "mail", NULL); + path = g_build_filename (g_get_home_dir (), "mail", NULL); mail_importer_import_folders_sync ( session, path, pine_special_folders, 0, m->cancellable); g_free (path); @@ -358,7 +358,7 @@ mail_importer_pine_import (EImport *ei, gint id; m = mail_msg_new (&pine_import_info); - g_datalist_set_data(&target->data, "pine-msg", m); + g_datalist_set_data (&target->data, "pine-msg", m); m->import = ei; g_object_ref (m->import); m->target = target; @@ -420,14 +420,14 @@ pine_getwidget (EImport *ei, box = gtk_vbox_new (FALSE, 2); - w = gtk_check_button_new_with_label(_("Mail")); + w = gtk_check_button_new_with_label (_("Mail")); gtk_toggle_button_set_active ((GtkToggleButton *) w, TRUE); g_signal_connect ( w, "toggled", G_CALLBACK (checkbox_mail_toggle_cb), target); gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 0); - w = gtk_check_button_new_with_label(_("Address Book")); + w = gtk_check_button_new_with_label (_("Address Book")); gtk_toggle_button_set_active ((GtkToggleButton *) w, TRUE); g_signal_connect ( w, "toggled", @@ -444,8 +444,8 @@ pine_import (EImport *ei, EImportTarget *target, EImportImporter *im) { - if (GPOINTER_TO_INT(g_datalist_get_data(&target->data, "pine-do-mail")) - || GPOINTER_TO_INT(g_datalist_get_data(&target->data, "pine-do-addr"))) + if (GPOINTER_TO_INT (g_datalist_get_data (&target->data, "pine-do-mail")) + || GPOINTER_TO_INT (g_datalist_get_data (&target->data, "pine-do-addr"))) mail_importer_pine_import (ei, target); else e_import_complete (ei, target); @@ -456,7 +456,7 @@ pine_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) { - struct _pine_import_msg *m = g_datalist_get_data(&target->data, "pine-msg"); + struct _pine_import_msg *m = g_datalist_get_data (&target->data, "pine-msg"); if (m) g_cancellable_cancel (m->cancellable); |