* src/compose.c
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Wed, 18 Sep 2002 20:21:20 +0000 (20:21 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Wed, 18 Sep 2002 20:21:20 +0000 (20:21 +0000)
:%sno/if(/if (/gc
:%sno/for(/for (/gc
(beautify a little bit)

ChangeLog.claws
configure.in
src/compose.c

index a394b4a..ea770d2 100644 (file)
@@ -1,3 +1,10 @@
+2002-09-18 [alfons]    0.8.2claws58
+
+       * src/compose.c
+               :%sno/if(/if (/gc
+               :%sno/for(/for (/gc
+               (beautify a little bit)
+
 2002-09-18 [christoph] 0.8.2claws57
 
        * src/pine.c
index 5e2b849..d187242 100644 (file)
@@ -10,7 +10,7 @@ MINOR_VERSION=8
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws57
+EXTRA_VERSION=claws58
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index a86f9e7..db88f44 100644 (file)
@@ -723,7 +723,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
                if (mailto && *mailto != '\0') {
                        compose_entries_set(compose, mailto);
 
-               } else if(item && item->prefs->enable_default_to) {
+               } else if (item && item->prefs->enable_default_to) {
                        compose_entry_append(compose, item->prefs->default_to, COMPOSE_TO);
                        compose_entry_select(compose, item->prefs->default_to);
                        grab_focus_on_last = FALSE;
@@ -755,7 +755,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
        compose_show_first_last_header(compose, TRUE);
 
        /* Set save folder */
-       if(item && item->prefs && item->prefs->save_copy_to_folder) {
+       if (item && item->prefs && item->prefs->save_copy_to_folder) {
                gchar *folderidentifier;
 
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compose->savemsg_checkbtn), prefs_common.savemsg);
@@ -765,7 +765,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
        }
        
        /* Grab focus on last header only if no default_to was set */
-       if(grab_focus_on_last)
+       if (grab_focus_on_last)
                gtk_widget_grab_focus(compose->header_last->entry);
 
        if (prefs_common.auto_exteditor)
@@ -859,7 +859,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                }
                if (!account) {
                        gchar cc[BUFFSIZE];
-                       if(!get_header_from_msginfo(msginfo, cc, sizeof(cc), "CC:")) { /* Found a CC header */
+                       if (!get_header_from_msginfo(msginfo, cc, sizeof(cc), "CC:")) { /* Found a CC header */
                                extract_address(cc);
                                account = account_find_from_address(cc);
                        }        
@@ -900,7 +900,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
        }
 
        /* Set save folder */
-       if(msginfo->folder && msginfo->folder->prefs && msginfo->folder->prefs->save_copy_to_folder) {
+       if (msginfo->folder && msginfo->folder->prefs && msginfo->folder->prefs->save_copy_to_folder) {
                gchar *folderidentifier;
 
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compose->savemsg_checkbtn), TRUE);
@@ -974,9 +974,9 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                account = account_find_from_address(to);
        }
 
-       if(!account && prefs_common.forward_account_autosel) {
+       if (!account && prefs_common.forward_account_autosel) {
                gchar cc[BUFFSIZE];
-               if(!get_header_from_msginfo(msginfo,cc,sizeof(cc),"CC:")){ /* Found a CC header */
+               if (!get_header_from_msginfo(msginfo,cc,sizeof(cc),"CC:")){ /* Found a CC header */
                        extract_address(cc);
                        account = account_find_from_address(cc);
                 }
@@ -1218,7 +1218,7 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo)
 
        g_return_val_if_fail(msginfo != NULL, NULL);
 
-       if(!account)
+       if (!account)
                account = cur_account;
        g_return_val_if_fail(account != NULL, NULL);
 
@@ -2792,21 +2792,21 @@ gboolean compose_check_for_valid_recipient(Compose *compose) {
         compose->newsgroup_list = NULL;
 
        /* search header entries for to and newsgroup entries */
-       for(list = compose->header_list; list; list = list->next) {
+       for (list = compose->header_list; list; list = list->next) {
                gchar *header;
                gchar *entry;
                header = gtk_editable_get_chars(GTK_EDITABLE(GTK_COMBO(((ComposeHeaderEntry *)list->data)->combo)->entry), 0, -1);
                entry = gtk_editable_get_chars(GTK_EDITABLE(((ComposeHeaderEntry *)list->data)->entry), 0, -1);
                g_strstrip(entry);
-               if(entry[0] != '\0') {
-                       for(strptr = recipient_headers_mail; *strptr != NULL; strptr++) {
-                               if(!strcmp(header, (prefs_common.trans_hdr ? gettext(*strptr) : *strptr))) {
+               if (entry[0] != '\0') {
+                       for (strptr = recipient_headers_mail; *strptr != NULL; strptr++) {
+                               if (!strcmp(header, (prefs_common.trans_hdr ? gettext(*strptr) : *strptr))) {
                                        compose->to_list = address_list_append(compose->to_list, entry);
                                        recipient_found = TRUE;
                                }
                        }
-                       for(strptr = recipient_headers_news; *strptr != NULL; strptr++) {
-                               if(!strcmp(header, (prefs_common.trans_hdr ? gettext(*strptr) : *strptr))) {
+                       for (strptr = recipient_headers_news; *strptr != NULL; strptr++) {
+                               if (!strcmp(header, (prefs_common.trans_hdr ? gettext(*strptr) : *strptr))) {
                                        compose->newsgroup_list = newsgroup_list_append(compose->newsgroup_list, entry);
                                        recipient_found = TRUE;
                                }
@@ -3011,20 +3011,20 @@ static gint compose_redirect_write_headers_from_headerlist(Compose *compose,
        to_hdr = prefs_common.trans_hdr ? _("To:") : "To:";
 
        first_address = TRUE;
-       for(list = compose->header_list; list; list = list->next) {
+       for (list = compose->header_list; list; list = list->next) {
                headerentry = ((ComposeHeaderEntry *)list->data);
                headerentryname = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(headerentry->combo)->entry));
 
-               if(g_strcasecmp(headerentryname, cc_hdr) == 0 
+               if (g_strcasecmp(headerentryname, cc_hdr) == 0 
                   || g_strcasecmp(headerentryname, to_hdr) == 0) {
                        str = gtk_entry_get_text(GTK_ENTRY(headerentry->entry));
                        Xstrdup_a(str, str, return -1);
                        g_strstrip(str);
-                       if(str[0] != '\0') {
+                       if (str[0] != '\0') {
                                compose_convert_header
                                        (buf, sizeof(buf), str,
                                        strlen("Resent-To") + 2);
-                               if(first_address) {
+                               if (first_address) {
                                        fprintf(fp, "Resent-To: ");
                                        first_address = FALSE;
                                } else {
@@ -3034,7 +3034,7 @@ static gint compose_redirect_write_headers_from_headerlist(Compose *compose,
                        }
                }
        }
-       /* if(!first_address) { */
+       /* if (!first_address) { */
        fprintf(fp, "\n");
        /* } */
 
@@ -3523,7 +3523,7 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                 return -1;
         }
 
-       if(compose->to_list) {
+       if (compose->to_list) {
                if (compose->account->protocol != A_NNTP)
                        mailac = compose->account;
                else if (compose->orig_account->protocol != A_NNTP)
@@ -3537,10 +3537,10 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                }
        }
 
-       if(compose->newsgroup_list) {
+       if (compose->newsgroup_list) {
                 if (compose->account->protocol == A_NNTP)
                         newsac = compose->account;
-                else if(!(newsac = compose->orig_account) || (newsac->protocol != A_NNTP)) {
+                else if (!(newsac = compose->orig_account) || (newsac->protocol != A_NNTP)) {
                        lock = FALSE;
                        alertpanel_error(_("No account for posting news available!"));
                        return -1;
@@ -3617,7 +3617,7 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
        fprintf(fp, "SSH:\n");
        /* write recepient list */
        fprintf(fp, "R:");
-       if(compose->to_list) {
+       if (compose->to_list) {
                fprintf(fp, "<%s>", (gchar *)compose->to_list->data);
                for (cur = compose->to_list->next; cur != NULL; cur = cur->next)
                        fprintf(fp, ",<%s>", (gchar *)cur->data);
@@ -3625,21 +3625,21 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
        fprintf(fp, "\n");
        /* write newsgroup list */
        fprintf(fp, "NG:");
-       if(compose->newsgroup_list) {
+       if (compose->newsgroup_list) {
                fprintf(fp, "%s", (gchar *)compose->newsgroup_list->data);
                for (cur = compose->newsgroup_list->next; cur != NULL; cur = cur->next)
                        fprintf(fp, ",%s", (gchar *)cur->data);
        }
        fprintf(fp, "\n");
        /* Sylpheed account IDs */
-       if(mailac) {
+       if (mailac) {
                fprintf(fp, "MAID:%d\n", mailac->account_id);
        }
-       if(newsac) {
+       if (newsac) {
                fprintf(fp, "NAID:%d\n", newsac->account_id);
        }
        /* Save copy folder */
-       if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(compose->savemsg_checkbtn))) {
+       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(compose->savemsg_checkbtn))) {
                gchar *savefolderid;
                
                savefolderid = gtk_editable_get_chars(GTK_EDITABLE(compose->savemsg_entry), 0, -1);
@@ -3647,7 +3647,7 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                g_free(savefolderid);
        }
        /* Message-ID of message replying to */
-       if((compose->replyinfo != NULL) && (compose->replyinfo->msgid != NULL)) {
+       if ((compose->replyinfo != NULL) && (compose->replyinfo->msgid != NULL)) {
                gchar *folderid;
                
                folderid = folder_item_get_identifier(compose->replyinfo->folder);
@@ -3707,7 +3707,7 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
 
        folderview_update_item(queue, TRUE);
 
-       if((msgnum != NULL) && (item != NULL)) {
+       if ((msgnum != NULL) && (item != NULL)) {
                *msgnum = num;
                *item = queue;
        }
@@ -3843,19 +3843,19 @@ static gint compose_write_headers_from_headerlist(Compose *compose,
        trans_hdr = (prefs_common.trans_hdr ? gettext(header_w_colon) : header_w_colon);
 
        first_address = TRUE;
-       for(list = compose->header_list; list; list = list->next) {
+       for (list = compose->header_list; list; list = list->next) {
                headerentry = ((ComposeHeaderEntry *)list->data);
                headerentryname = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(headerentry->combo)->entry));
 
-               if(!g_strcasecmp(trans_hdr, headerentryname)) {
+               if (!g_strcasecmp(trans_hdr, headerentryname)) {
                        str = gtk_entry_get_text(GTK_ENTRY(headerentry->entry));
                        Xstrdup_a(str, str, return -1);
                        g_strstrip(str);
-                       if(str[0] != '\0') {
+                       if (str[0] != '\0') {
                                compose_convert_header
                                        (buf, sizeof(buf), str,
                                        strlen(header) + 2);
-                               if(first_address) {
+                               if (first_address) {
                                        fprintf(fp, "%s: ", header);
                                        first_address = FALSE;
                                } else {
@@ -3865,7 +3865,7 @@ static gint compose_write_headers_from_headerlist(Compose *compose,
                        }
                }
        }
-       if(!first_address) {
+       if (!first_address) {
                fprintf(fp, "\n");
        }
 
@@ -3892,7 +3892,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
        g_return_val_if_fail(compose->account->address != NULL, -1);
 
        /* Save copy folder */
-       if(is_draft) {
+       if (is_draft) {
                if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(compose->savemsg_checkbtn))) {
                        gchar *savefolderid;
 
@@ -4250,7 +4250,7 @@ static void compose_create_header_entry(Compose *compose)
        gtk_editable_set_editable(GTK_EDITABLE(GTK_COMBO(combo)->entry), TRUE);
        gtk_widget_show(combo);
        gtk_table_attach(GTK_TABLE(compose->header_table), combo, 0, 1, compose->header_nextrow, compose->header_nextrow+1, GTK_SHRINK, GTK_FILL, 0, 0);
-       if(compose->header_last) {      
+       if (compose->header_last) {     
                gchar *last_header_entry = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(compose->header_last->combo)->entry));
                string = headers;
                while (*string != NULL) {
@@ -4515,7 +4515,7 @@ static GtkWidget *compose_create_others(Compose *compose)
        savemsg_checkbtn = gtk_check_button_new_with_label(_("Save Message to "));
        gtk_widget_show(savemsg_checkbtn);
        gtk_table_attach(GTK_TABLE(table), savemsg_checkbtn, 0, 1, rowcount, rowcount + 1, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
-       if(account_get_special_folder(compose->account, F_OUTBOX)) {
+       if (account_get_special_folder(compose->account, F_OUTBOX)) {
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(savemsg_checkbtn), prefs_common.savemsg);
        }
        gtk_signal_connect(GTK_OBJECT(savemsg_checkbtn), "toggled",
@@ -4525,7 +4525,7 @@ static GtkWidget *compose_create_others(Compose *compose)
        gtk_widget_show(savemsg_entry);
        gtk_table_attach_defaults(GTK_TABLE(table), savemsg_entry, 1, 2, rowcount, rowcount + 1);
        gtk_editable_set_editable(GTK_EDITABLE(savemsg_entry), prefs_common.savemsg);
-       if(account_get_special_folder(compose->account, F_OUTBOX)) {
+       if (account_get_special_folder(compose->account, F_OUTBOX)) {
                folderidentifier = folder_item_get_identifier(account_get_special_folder
                                  (compose->account, F_OUTBOX));
                gtk_entry_set_text(GTK_ENTRY(savemsg_entry), folderidentifier);