diff options
Diffstat (limited to 'mail/importers')
-rw-r--r-- | mail/importers/elm-importer.c | 32 | ||||
-rw-r--r-- | mail/importers/evolution-mbox-importer.c | 36 | ||||
-rw-r--r-- | mail/importers/mail-importer.c | 13 | ||||
-rw-r--r-- | mail/importers/mail-importer.h | 2 | ||||
-rw-r--r-- | mail/importers/pine-importer.c | 63 |
5 files changed, 93 insertions, 53 deletions
diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c index 75cf996e14..832bf749ea 100644 --- a/mail/importers/elm-importer.c +++ b/mail/importers/elm-importer.c @@ -122,7 +122,8 @@ parse_elm_rc (const gchar *elmrc) } static gchar * -elm_get_rc (EImport *ei, const gchar *name) +elm_get_rc (EImport *ei, + const gchar *name) { GHashTable *prefs; gchar *elmrc; @@ -142,7 +143,9 @@ elm_get_rc (EImport *ei, const gchar *name) } static gboolean -elm_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +elm_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { const gchar *maildir; gchar *elmdir; @@ -246,7 +249,10 @@ elm_import_free (struct _elm_import_msg *m) } static void -elm_status (CamelOperation *op, const gchar *what, gint pc, gpointer data) +elm_status (CamelOperation *op, + const gchar *what, + gint pc, + gpointer data) { struct _elm_import_msg *importer = data; @@ -288,7 +294,8 @@ static MailMsgInfo elm_import_info = { }; static gint -mail_importer_elm_import (EImport *ei, EImportTarget *target) +mail_importer_elm_import (EImport *ei, + EImportTarget *target) { struct _elm_import_msg *m; gint id; @@ -314,7 +321,8 @@ mail_importer_elm_import (EImport *ei, EImportTarget *target) } static void -checkbox_toggle_cb (GtkToggleButton *tb, EImportTarget *target) +checkbox_toggle_cb (GtkToggleButton *tb, + EImportTarget *target) { g_datalist_set_data ( &target->data, "elm-do-mail", @@ -322,7 +330,9 @@ checkbox_toggle_cb (GtkToggleButton *tb, EImportTarget *target) } static GtkWidget * -elm_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +elm_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *box, *w; GConfClient *gconf; @@ -340,7 +350,7 @@ elm_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) w = gtk_check_button_new_with_label(_("Mail")); gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_mail); - g_signal_connect(w, "toggled", G_CALLBACK(checkbox_toggle_cb), target); + g_signal_connect (w, "toggled", G_CALLBACK(checkbox_toggle_cb), target); gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 0); gtk_widget_show_all (box); @@ -349,7 +359,9 @@ elm_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -elm_import (EImport *ei, EImportTarget *target, EImportImporter *im) +elm_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { if (GPOINTER_TO_INT(g_datalist_get_data(&target->data, "elm-do-mail"))) mail_importer_elm_import (ei, target); @@ -358,7 +370,9 @@ elm_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -elm_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +elm_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { struct _elm_import_msg *m = g_datalist_get_data(&target->data, "elm-msg"); diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index 4b3a258e18..3c97bd953b 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -71,14 +71,17 @@ typedef struct { } MboxImporter; static void -folder_selected (EMFolderSelectionButton *button, EImportTargetURI *target) +folder_selected (EMFolderSelectionButton *button, + EImportTargetURI *target) { g_free (target->uri_dest); target->uri_dest = g_strdup (em_folder_selection_button_get_folder_uri (button)); } static GtkWidget * -mbox_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { EShell *shell; EShellBackend *shell_backend; @@ -159,7 +162,9 @@ mbox_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) } static gboolean -mbox_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar signature[6]; gboolean ret = FALSE; @@ -190,7 +195,10 @@ mbox_supported (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -mbox_status (CamelOperation *op, const gchar *what, gint pc, gpointer data) +mbox_status (CamelOperation *op, + const gchar *what, + gint pc, + gpointer data) { MboxImporter *importer = data; @@ -224,7 +232,8 @@ mbox_status_timeout (gpointer data) } static void -mbox_import_done (gpointer data, GError **error) +mbox_import_done (gpointer data, + GError **error) { MboxImporter *importer = data; @@ -238,7 +247,9 @@ mbox_import_done (gpointer data, GError **error) } static void -mbox_import (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { EShell *shell; EShellBackend *shell_backend; @@ -276,7 +287,9 @@ mbox_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -mbox_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { MboxImporter *importer = g_datalist_get_data(&target->data, "mbox-data"); @@ -296,7 +309,8 @@ mbox_importer_set_preview_funcs (MboxImporterCreatePreviewFunc create_func, } static void -preview_selection_changed_cb (GtkTreeSelection *selection, EWebViewPreview *preview) +preview_selection_changed_cb (GtkTreeSelection *selection, + EWebViewPreview *preview) { GtkTreeIter iter; GtkTreeModel *model = NULL; @@ -325,7 +339,9 @@ preview_selection_changed_cb (GtkTreeSelection *selection, EWebViewPreview *prev } static GtkWidget * -mbox_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) +mbox_get_preview (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *preview = NULL; EImportTargetURI *s = (EImportTargetURI *) target; @@ -345,7 +361,7 @@ mbox_get_preview (EImport *ei, EImportTarget *target, EImportImporter *im) return NULL; } - fd = g_open (filename, O_RDONLY|O_BINARY, 0); + fd = g_open (filename, O_RDONLY | O_BINARY, 0); if (fd == -1) { g_warning ( "Cannot find source file to import '%s': %s", diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index c2619e08a1..e28de37b3c 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -95,7 +95,7 @@ decode_status (const gchar *status) static guint32 decode_mozilla_status (const gchar *tmp) { - unsigned long status = strtoul (tmp, NULL, 16); + gulong status = strtoul (tmp, NULL, 16); guint32 flags = 0; gint i; @@ -134,7 +134,7 @@ import_mbox_exec (struct _import_mbox_msg *m, return; if (S_ISREG (st.st_mode)) { - fd = g_open (m->path, O_RDONLY|O_BINARY, 0); + fd = g_open (m->path, O_RDONLY | O_BINARY, 0); if (fd == -1) { g_warning ( "cannot find source file to import '%s': %s", @@ -242,7 +242,8 @@ mail_importer_import_mbox (EMailSession *session, const gchar *path, const gchar *folderuri, GCancellable *cancellable, - void (*done)(gpointer data, GError **), + void (*done) (gpointer data, + GError **error), gpointer data) { struct _import_mbox_msg *m; @@ -290,7 +291,7 @@ struct _import_folders_data { EMailSession *session; GCancellable *cancellable; - guint elmfmt:1; + guint elmfmt : 1; }; static void @@ -315,7 +316,7 @@ import_folders_rec (struct _import_folders_data *m, camel_operation_push_message (m->cancellable, _("Scanning %s"), utf8_filename); g_free (utf8_filename); - while ( (d=g_dir_read_name (dir))) { + while ( (d = g_dir_read_name (dir))) { if (d[0] == '.') continue; @@ -333,7 +334,7 @@ import_folders_rec (struct _import_folders_data *m, if (folderparent == NULL) { gint i; - for (i=0;m->special_folders[i].orig;i++) + for (i = 0; m->special_folders[i].orig; i++) if (strcmp (m->special_folders[i].orig, folder) == 0) { folder = m->special_folders[i].new; break; diff --git a/mail/importers/mail-importer.h b/mail/importers/mail-importer.h index 93d1897877..d66ed464ec 100644 --- a/mail/importers/mail-importer.h +++ b/mail/importers/mail-importer.h @@ -34,7 +34,7 @@ typedef void (*MboxImporterCreatePreviewFunc)(GObject *preview, GtkWidget **prev typedef void (*MboxImporterFillPreviewFunc)(GObject *preview, CamelMimeMessage *msg); /* 'create_func' is a function to create a view. 'fill_func' is to fill view with a preview of a message 'msg' - (mail importer cannot link to em-format-html-display directly) */ + * (mail importer cannot link to em-format-html-display directly) */ void mbox_importer_set_preview_funcs (MboxImporterCreatePreviewFunc create_func, MboxImporterFillPreviewFunc fill_func); EImportImporter *elm_importer_peek (void); diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index 9be96ba182..710e02b40e 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -64,7 +64,9 @@ struct _pine_import_msg { }; static gboolean -pine_supported (EImport *ei, EImportTarget *target, EImportImporter *im) +pine_supported (EImport *ei, + EImportTarget *target, + EImportImporter *im) { gchar *maildir, *addrfile; gboolean md_exists, addr_exists; @@ -84,21 +86,22 @@ pine_supported (EImport *ei, EImportTarget *target, EImportImporter *im) } /* -See: http://www.washington.edu/pine/tech-notes/low-level.html - -addressbook line is: - <nickname>TAB<fullname>TAB<address>TAB<fcc>TAB<comments> -lists, address is: - "(" <address>, <address>, <address>, ... ")" - -<address> is rfc822 address, or alias address. -if rfc822 address includes a phrase, then that overrides <fullname> - -FIXME: we dont handle aliases in lists. -*/ + * See: http://www.washington.edu/pine/tech-notes/low-level.html + * + * addressbook line is: + * <nickname>TAB<fullname>TAB<address>TAB<fcc>TAB<comments> + * lists, address is: + * "(" <address>, <address>, <address>, ... ")" + * + * <address> is rfc822 address, or alias address. + * if rfc822 address includes a phrase, then that overrides <fullname> + * + * FIXME: we dont handle aliases in lists. + */ static void -import_contact (EBookClient *book_client, gchar *line) +import_contact (EBookClient *book_client, + gchar *line) { gchar **strings, *addr, **addrs; gint i; @@ -118,16 +121,16 @@ import_contact (EBookClient *book_client, gchar *line) addr = strings[2]; len = strlen (addr); - if (addr[0] == '(' && addr[len-1] == ')') { + if (addr[0] == '(' && addr[len - 1] == ')') { addr[0] = 0; - addr[len-1] = 0; + addr[len - 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 * is a normal contact, but need to do this * XML crap for mailing lists. */ - for (i=0;addrs[i];i++) { + for (i = 0; addrs[i]; i++) { EDestination *d; EVCardAttribute *attr; @@ -228,15 +231,15 @@ import_contacts (void) line = g_string_new(""); g_string_set_size (line, 256); offset = 0; - while (fgets (line->str+offset, 256, fp)) { + while (fgets (line->str + offset, 256, fp)) { gsize len; - len = strlen (line->str+offset)+offset; - if (line->str[len-1] == '\n') - g_string_truncate (line, len-1); + len = strlen (line->str + offset) + offset; + if (line->str[len - 1] == '\n') + g_string_truncate (line, len - 1); else if (!feof (fp)) { offset = len; - g_string_set_size (line, len+256); + g_string_set_size (line, len + 256); continue; } else { g_string_truncate (line, len); @@ -428,7 +431,9 @@ checkbox_addr_toggle_cb (GtkToggleButton *tb, } static GtkWidget * -pine_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +pine_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { GtkWidget *box, *w; GConfClient *gconf; @@ -452,12 +457,12 @@ pine_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) w = gtk_check_button_new_with_label(_("Mail")); gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_mail); - g_signal_connect(w, "toggled", G_CALLBACK(checkbox_mail_toggle_cb), target); + 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")); gtk_toggle_button_set_active ((GtkToggleButton *) w, !done_addr); - g_signal_connect(w, "toggled", G_CALLBACK(checkbox_addr_toggle_cb), target); + g_signal_connect (w, "toggled", G_CALLBACK(checkbox_addr_toggle_cb), target); gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 0); gtk_widget_show_all (box); @@ -466,7 +471,9 @@ pine_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -pine_import (EImport *ei, EImportTarget *target, EImportImporter *im) +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"))) @@ -476,7 +483,9 @@ pine_import (EImport *ei, EImportTarget *target, EImportImporter *im) } static void -pine_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +pine_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { struct _pine_import_msg *m = g_datalist_get_data(&target->data, "pine-msg"); |