2012-09-16 [mones] 3.8.1cvs60
authorRicardo Mones <mones@claws-mail.org>
Sun, 16 Sep 2012 21:56:21 +0000 (21:56 +0000)
committerRicardo Mones <mones@claws-mail.org>
Sun, 16 Sep 2012 21:56:21 +0000 (21:56 +0000)
        * src/action.c
                Removed dup calls with ignored result
        * src/addr_compl.c
                Removed unused var is_group and simplified logic around it
        * src/addrharvest.c
        * src/matcher.c
        * src/procmsg.c
        * src/etpan/etpan-thread-manager.c
                Use unused var r to verify result and emit messages on error
        * src/compose.c
                Move color variable into conditional usage blocks
                Remove assigned but not used vars: lock, titles, count
        * src/edittags.c
                Remove assigned but not used var actions
        * src/folderview.c
                Remove assigned but not used vars: from_parent, src_node
        * src/imap_gtk.c
        * src/mh_gtk.c
                Remove malloc-ed but not used var: old_path
        * src/news.c
                Comment unused vars from commented block: tofetch, fetched
        * src/prefs_account.c
                Remove assigned but not used var: privacy_enabled
        * src/prefs_actions.c
        * src/prefs_customheader.c
                Remove assigned but not used var: store
        * src/prefs_filtering.c
                Remove assigned but not used var: n_rows
        * src/prefs_template.c
                Remove assigned but not used vars: model, list_store
        * src/prefs_toolbar.c
                Remove assigned but not used var: win_titles
        * src/printing.c
                Remove assigned but not used vars: orientation, line, baseline,
                off_chars
        * src/etpan/imap-thread.c
                Remove assigned but not used var: value, r
                Refactor to check correct memory allocation
        * src/etpan/nntp-thread.c
                Remove assigned but not used var: value
        * src/gtk/gtkaspell.c
                Remove assigned but not used vars: textbuf, exist
                Remove unused function: find_gtkaspeller
        * src/gtk/gtkcmctree.c
                Remove unused function: gtk_cmctree_get_offset
        * src/gtk/gtkshruler.c
                Remove assigned but not used vars: ruler, priv

27 files changed:
ChangeLog
PATCHSETS
configure.ac
src/action.c
src/addr_compl.c
src/addrharvest.c
src/compose.c
src/edittags.c
src/etpan/etpan-thread-manager.c
src/etpan/imap-thread.c
src/etpan/nntp-thread.c
src/folderview.c
src/gtk/gtkaspell.c
src/gtk/gtkcmctree.c
src/gtk/gtkshruler.c
src/imap_gtk.c
src/matcher.c
src/mh_gtk.c
src/news.c
src/prefs_account.c
src/prefs_actions.c
src/prefs_customheader.c
src/prefs_filtering.c
src/prefs_template.c
src/prefs_toolbar.c
src/printing.c
src/procmsg.c

index c20eae0..d7a2085 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,53 @@
+2012-09-16 [mones]     3.8.1cvs60
+
+        * src/action.c                                                          
+                Removed dup calls with ignored result
+        * src/addr_compl.c                                                      
+                Removed unused var is_group and simplified logic around it      
+        * src/addrharvest.c                                                     
+        * src/matcher.c
+        * src/procmsg.c                                                         
+        * src/etpan/etpan-thread-manager.c                                      
+                Use unused var r to verify result and emit messages on error
+        * src/compose.c                                                         
+                Move color variable into conditional usage blocks
+                Remove assigned but not used vars: lock, titles, count          
+        * src/edittags.c
+                Remove assigned but not used var actions                        
+        * src/folderview.c
+                Remove assigned but not used vars: from_parent, src_node        
+        * src/imap_gtk.c
+        * src/mh_gtk.c                                                          
+                Remove malloc-ed but not used var: old_path                     
+        * src/news.c
+                Comment unused vars from commented block: tofetch, fetched      
+        * src/prefs_account.c
+                Remove assigned but not used var: privacy_enabled
+        * src/prefs_actions.c
+        * src/prefs_customheader.c
+                Remove assigned but not used var: store
+        * src/prefs_filtering.c
+                Remove assigned but not used var: n_rows
+        * src/prefs_template.c
+                Remove assigned but not used vars: model, list_store
+        * src/prefs_toolbar.c
+                Remove assigned but not used var: win_titles
+        * src/printing.c
+                Remove assigned but not used vars: orientation, line, baseline,
+                off_chars 
+        * src/etpan/imap-thread.c
+                Remove assigned but not used var: value, r
+                Refactor to check correct memory allocation
+        * src/etpan/nntp-thread.c
+                Remove assigned but not used var: value
+        * src/gtk/gtkaspell.c
+                Remove assigned but not used vars: textbuf, exist
+                Remove unused function: find_gtkaspeller
+        * src/gtk/gtkcmctree.c
+                Remove unused function: gtk_cmctree_get_offset
+        * src/gtk/gtkshruler.c
+                Remove assigned but not used vars: ruler, priv
+
 2012-09-14 [mones]     3.8.1cvs59
 
        * src/common/log.c
index 552fbfd..067b32f 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.25.2.75 -r 1.25.2.76 src/stock_pixmap.c;  ) > 3.8.1cvs57.patchset
 ( cvs diff -u -r 1.2.2.47 -r 1.2.2.48 src/gtk/inputdialog.c;  ) > 3.8.1cvs58.patchset
 ( cvs diff -u -r 1.6.2.24 -r 1.6.2.25 src/common/log.c;  ) > 3.8.1cvs59.patchset
+( cvs diff -u -r 1.12.2.73 -r 1.12.2.74 src/action.c;  cvs diff -u -r 1.27.2.64 -r 1.27.2.65 src/addr_compl.c;  cvs diff -u -r 1.6.10.28 -r 1.6.10.29 src/addrharvest.c;  cvs diff -u -r 1.382.2.612 -r 1.382.2.613 src/compose.c;  cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/edittags.c;  cvs diff -u -r 1.207.2.228 -r 1.207.2.229 src/folderview.c;  cvs diff -u -r 1.1.2.72 -r 1.1.2.73 src/imap_gtk.c;  cvs diff -u -r 1.75.2.74 -r 1.75.2.75 src/matcher.c;  cvs diff -u -r 1.2.2.44 -r 1.2.2.45 src/mh_gtk.c;  cvs diff -u -r 1.101.2.70 -r 1.101.2.71 src/news.c;  cvs diff -u -r 1.105.2.175 -r 1.105.2.176 src/prefs_account.c;  cvs diff -u -r 1.60.2.82 -r 1.60.2.83 src/prefs_actions.c;  cvs diff -u -r 1.16.2.44 -r 1.16.2.45 src/prefs_customheader.c;  cvs diff -u -r 1.59.2.92 -r 1.59.2.93 src/prefs_filtering.c;  cvs diff -u -r 1.12.2.82 -r 1.12.2.83 src/prefs_template.c;  cvs diff -u -r 1.30.2.74 -r 1.30.2.75 src/prefs_toolbar.c;  cvs diff -u -r 1.1.2.39 -r 1.1.2.40 src/printing.c;  cvs diff -u -r 1.150.2.128 -r 1.150.2.129 src/procmsg.c;  cvs diff -u -r 1.1.4.17 -r 1.1.4.18 src/etpan/etpan-thread-manager.c;  cvs diff -u -r 1.1.4.120 -r 1.1.4.121 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/etpan/nntp-thread.c;  cvs diff -u -r 1.9.2.81 -r 1.9.2.82 src/gtk/gtkaspell.c;  cvs diff -u -r 1.1.2.30 -r 1.1.2.31 src/gtk/gtkcmctree.c;  cvs diff -u -r 1.1.4.22 -r 1.1.4.23 src/gtk/gtkshruler.c;  ) > 3.8.1cvs60.patchset
index d3c5610..766ddf7 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=59
+EXTRA_VERSION=60
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 876d3a5..f337fbd 100644 (file)
@@ -973,18 +973,15 @@ static ChildInfo *fork_child(gchar *cmd, const gchar *msg_str,
                                     ACTION_USER_IN |
                                     ACTION_USER_HIDDEN_IN)) {
                                        r |= close(fileno(stdin));
-                                       (void) dup  (chld_in[0]);
                                }
                                r |= close(chld_in[0]);
                                r |= close(chld_in[1]);
 
                                r |= close(fileno(stdout));
-                               (void) dup  (chld_out[1]);
                                r |= close(chld_out[0]);
                                r |= close(chld_out[1]);
 
                                r |= close(fileno(stderr));
-                               (void) dup  (chld_err[1]);
                                r |= close(chld_err[0]);
                                r |= close(chld_err[1]);
 
index 1706589..89f1b56 100644 (file)
@@ -254,13 +254,10 @@ void addr_compl_add_address1(const char *str, address_entry *ae)
 static gint add_address(const gchar *name, const gchar *address, 
                        const gchar *nick, const gchar *alias, GList *grp_emails)
 {
-       address_entry    *ae;
-       gboolean is_group = FALSE;
+       address_entry *ae;
 
        if (!name || !address) {
-               if (!address && !nick && !alias && grp_emails) {
-                       is_group = TRUE;
-               } else
+               if (address || nick || alias || !grp_emails) 
                        return -1;
        }
 
index b0d08ac..2fa27f9 100644 (file)
@@ -813,11 +813,16 @@ static void addrharvest_harvest_list(
        int r;
 
        if( ( dp = opendir( harvester->path ) ) == NULL ) {
+               g_message("cannot opendir %s\n", harvester->path);
                return;
        }
 
        /* Process message list */
        r = chdir( harvester->path );
+       if (r != 0) {
+               g_message("cannot chdir %s\n", harvester->path);
+               return;
+       }
        node = msgList;
        while( node ) {
                num = GPOINTER_TO_UINT( node->data );
index 0dd6249..028e02f 100644 (file)
@@ -812,8 +812,8 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
        GdkColormap *cmap;
        gboolean success[8];
        int i;
-#endif
        GdkColor color[8];
+#endif
 
        buffer = gtk_text_view_get_buffer(text);
 
@@ -875,6 +875,7 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
        compose->no_wrap_tag = gtk_text_buffer_create_tag(buffer, "no_wrap", NULL);
        compose->no_join_tag = gtk_text_buffer_create_tag(buffer, "no_join", NULL);
 
+#if !GTK_CHECK_VERSION(2, 24, 0)
        color[0] = quote_color1;
        color[1] = quote_color2;
        color[2] = quote_color3;
@@ -883,7 +884,7 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
        color[5] = quote_bgcolor3;
        color[6] = signature_color;
        color[7] = uri_color;
-#if !GTK_CHECK_VERSION(2, 24, 0)
+
        cmap = gdk_drawable_get_colormap(gtk_widget_get_window(compose->window));
        gdk_colormap_alloc_colors(cmap, color, 8, FALSE, TRUE, success);
 
@@ -5749,17 +5750,13 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
        FILE *fp;
        GSList *cur;
        gint num;
-        static gboolean lock = FALSE;
        PrefsAccount *mailac = NULL, *newsac = NULL;
        gboolean err = FALSE;
 
        debug_print("queueing message...\n");
        cm_return_val_if_fail(compose->account != NULL, -1);
 
-        lock = TRUE;
-       
        if (compose_check_entries(compose, check_subject) == FALSE) {
-                lock = FALSE;
                if (compose->batch) {
                        gtk_widget_show_all(compose->window);
                }
@@ -5768,7 +5765,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
 
        if (!compose->to_list && !compose->newsgroup_list) {
                g_warning("can't get recipient list.");
-               lock = FALSE;
                 return -1;
         }
 
@@ -5778,7 +5774,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                else if (cur_account && cur_account->protocol != A_NNTP)
                        mailac = cur_account;
                else if (!(mailac = compose_current_mail_account())) {
-                       lock = FALSE;
                        alertpanel_error(_("No account for sending mails available!"));
                        return -1;
                }
@@ -5788,7 +5783,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                 if (compose->account->protocol == A_NNTP)
                         newsac = compose->account;
                 else {
-                       lock = FALSE;
                        alertpanel_error(_("Selected account isn't NNTP: Posting is impossible."));
                        return -1;
                }                       
@@ -5801,7 +5795,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
        if ((fp = g_fopen(tmp, "wb")) == NULL) {
                FILE_OP_ERROR(tmp, "fopen");
                g_free(tmp);
-               lock = FALSE;
                return -2;
        }
 
@@ -5863,7 +5856,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                if (compose->use_encryption) {
                        gchar *encdata;
                        if (!compose_warn_encryption(compose)) {
-                               lock = FALSE;
                                fclose(fp);
                                claws_unlink(tmp);
                                g_free(tmp);
@@ -5889,7 +5881,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                                 * key selection */
                                if (err == TRUE)
                                        g_warning("failed to write queue message");
-                               lock = FALSE;
                                fclose(fp);
                                claws_unlink(tmp);
                                g_free(tmp);
@@ -5936,7 +5927,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
 
        if (compose->redirect_filename != NULL) {
                if (compose_redirect_write_to_file(compose, fp) < 0) {
-                       lock = FALSE;
                        fclose(fp);
                        claws_unlink(tmp);
                        g_free(tmp);
@@ -5945,7 +5935,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
        } else {
                gint result = 0;
                if ((result = compose_write_to_file(compose, fp, COMPOSE_WRITE_FOR_SEND, TRUE)) < 0) {
-                       lock = FALSE;
                        fclose(fp);
                        claws_unlink(tmp);
                        g_free(tmp);
@@ -5957,14 +5946,12 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                fclose(fp);
                claws_unlink(tmp);
                g_free(tmp);
-               lock = FALSE;
                return -2;
        }
        if (fclose(fp) == EOF) {
                FILE_OP_ERROR(tmp, "fclose");
                claws_unlink(tmp);
                g_free(tmp);
-               lock = FALSE;
                return -2;
        }
 
@@ -5977,7 +5964,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                g_warning("can't find queue folder\n");
                claws_unlink(tmp);
                g_free(tmp);
-               lock = FALSE;
                return -1;
        }
        folder_item_scan(queue);
@@ -5985,7 +5971,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                g_warning("can't queue the message\n");
                claws_unlink(tmp);
                g_free(tmp);
-               lock = FALSE;
                return -1;
        }
        
@@ -7220,7 +7205,6 @@ static Compose *compose_create(PrefsAccount *account,
 
        UndoMain *undostruct;
 
-       gchar *titles[N_ATTACH_COLS];
        GtkWidget *popupmenu;
        GtkWidget *tmpl_menu;
        GtkActionGroup *action_group = NULL;
@@ -7236,11 +7220,6 @@ static Compose *compose_create(PrefsAccount *account,
        debug_print("Creating compose window...\n");
        compose = g_new0(Compose, 1);
 
-       titles[COL_MIMETYPE] = _("MIME type");
-       titles[COL_SIZE]     = _("Size");
-       titles[COL_NAME]     = _("Name");
-       titles[COL_CHARSET]  = _("Charset");
-
        compose->batch = batch;
        compose->account = account;
        compose->folder = folder;
@@ -10366,14 +10345,12 @@ static void textview_move_backward_word (GtkTextView *text)
        GtkTextBuffer *buffer;
        GtkTextMark *mark;
        GtkTextIter ins;
-       gint count;
 
        cm_return_if_fail(GTK_IS_TEXT_VIEW(text));
 
        buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
        mark = gtk_text_buffer_get_insert(buffer);
        gtk_text_buffer_get_iter_at_mark(buffer, &ins, mark);
-       count = gtk_text_iter_inside_word (&ins) ? 2 : 1;
        if (gtk_text_iter_backward_word_starts(&ins, 1))
                gtk_text_buffer_place_cursor(buffer, &ins);
 }
index 67fcef6..652bff3 100644 (file)
@@ -275,7 +275,6 @@ static GtkActionEntry apply_popup_actions[] =
 static gint apply_list_btn_pressed(GtkWidget *widget, GdkEventButton *event,
                                    GtkTreeView *list_view)
 {
-       GtkActionGroup *actions;
        GtkUIManager *gui_manager = gtkut_ui_manager();
 
        if (applywindow.busy)
@@ -287,7 +286,7 @@ static gint apply_list_btn_pressed(GtkWidget *widget, GdkEventButton *event,
                gboolean non_empty;
 
                if (!apply_popup_menu) {
-                       actions = cm_menu_create_action_group("EditTags", apply_popup_actions,
+                       (void) cm_menu_create_action_group("EditTags", apply_popup_actions,
                                        G_N_ELEMENTS(apply_popup_actions), (gpointer)list_view);
 
                        MENUITEM_ADDUI("/Menus", "EditTags", "EditTags", GTK_UI_MANAGER_MENU)
index 0b8c366..f72e8c7 100644 (file)
@@ -281,6 +281,9 @@ static void manager_notify(struct etpan_thread_manager * manager)
   
   ch = 1;
   r = write(manager->notify_fds[1], &ch, 1);
+  if (r < 0) {
+    g_warning("error writing notification to etpan thread manager");
+  }
 }
 
 static void manager_ack(struct etpan_thread_manager * manager)
@@ -289,6 +292,9 @@ static void manager_ack(struct etpan_thread_manager * manager)
   char ch;
   ssize_t r;
   r = read(manager->notify_fds[0], &ch, 1);
+  if (r != 1) {
+    g_warning("error reading notification from etpan thread manager");
+  }
 #else
   /* done in the GIOChannel handler in imap-thread.c and nntp-thread.c */
 #endif
@@ -590,12 +596,9 @@ void etpan_thread_manager_loop(struct etpan_thread_manager * manager)
   
   for(i = 0 ; i < carray_count(op_to_notify) ; i ++) {
     struct etpan_thread_op * op;
-    int cancelled;
     
     op = carray_get(op_to_notify, i);
     
-    cancelled = etpan_thread_op_cancelled(op);
-    
     etpan_thread_op_lock(op);
     
     if (!op->callback_called) {
index 0266ce8..e7ad978 100644 (file)
@@ -61,12 +61,9 @@ static GIOChannel * io_channel = NULL;
 static void delete_imap(Folder *folder, mailimap *imap)
 {
        chashdatum key;
-       chashdatum value;
 
        key.data = &folder;
        key.len = sizeof(folder);
-       value.data = imap;
-       value.len = 0;
        chash_delete(session_hash, &key, NULL);
        
        key.data = &imap;
@@ -2679,30 +2676,24 @@ imap_fetch_result_to_envelop_list(clist * fetch_result,
 static int imap_add_envelope_fetch_att(struct mailimap_fetch_type * fetch_type)
 {
        struct mailimap_fetch_att * fetch_att;
-       int r;
+       int i;
        char * header;
        clist * hdrlist;
        struct mailimap_header_list * imap_hdrlist;
        struct mailimap_section * section;
+       char *headers[] = {
+                       "Date", "From", "To", "Cc", "Subject", "Message-ID",
+                       "References", "In-Reply-To", NULL
+               };
 
        hdrlist = clist_new();
-  
-       header = strdup("Date");
-       r = clist_append(hdrlist, header);
-       header = strdup("From");
-       r = clist_append(hdrlist, header);
-       header = strdup("To");
-       r = clist_append(hdrlist, header);
-       header = strdup("Cc");
-       r = clist_append(hdrlist, header);
-       header = strdup("Subject");
-       r = clist_append(hdrlist, header);
-       header = strdup("Message-ID");
-       r = clist_append(hdrlist, header);
-       header = strdup("References");
-       r = clist_append(hdrlist, header);
-       header = strdup("In-Reply-To");
-       r = clist_append(hdrlist, header);
+       i = 0;
+       while (headers[i] != NULL) {
+               header = strdup(headers[i]);
+               if (header == NULL || clist_append(hdrlist, header) != 0)
+                       return MAIL_ERROR_MEMORY;
+               ++i;
+       }
   
        imap_hdrlist = mailimap_header_list_new(hdrlist);
        section = mailimap_section_new_header_fields(imap_hdrlist);
index b775c0c..f5de0ef 100644 (file)
@@ -96,12 +96,9 @@ static void nntp_logger(int direction, const char * str, size_t size)
 static void delete_nntp(Folder *folder, newsnntp *nntp)
 {
        chashdatum key;
-       chashdatum value;
 
        key.data = &folder;
        key.len = sizeof(folder);
-       value.data = nntp;
-       value.len = 0;
        chash_delete(session_hash, &key, NULL);
        
        key.data = &nntp;
index 755fc74..a0a3536 100644 (file)
@@ -2473,9 +2473,7 @@ static void folderview_recollapse_nodes(FolderView *folderview, GtkCMCTreeNode *
 void folderview_move_folder(FolderView *folderview, FolderItem *from_folder,
                            FolderItem *to_folder, gboolean copy)
 {
-       FolderItem *from_parent = NULL;
        FolderItem *new_folder = NULL;
-       GtkCMCTreeNode *src_node = NULL;
        gchar *buf;
        gint status;
 
@@ -2483,9 +2481,6 @@ void folderview_move_folder(FolderView *folderview, FolderItem *from_folder,
        cm_return_if_fail(from_folder != NULL);
        cm_return_if_fail(to_folder != NULL);
 
-       src_node = gtk_cmctree_find_by_row_data(GTK_CMCTREE(folderview->ctree), NULL, from_folder);
-       from_parent = folder_item_parent(from_folder);
-       
        if (prefs_common.warn_dnd) {
                buf = g_strdup_printf(copy ? _("Do you really want to copy folder '%s' in '%s' ?"):
                                             _("Do you really want to make folder '%s' a subfolder of '%s' ?"), 
index 717396d..f2ca7b0 100644 (file)
@@ -191,8 +191,6 @@ static Dictionary * dictionary_dup                  (const Dictionary *dict);
 static void            reset_theword_data              (GtkAspell *gtkaspell);
 static void            free_checkers                   (gpointer elt, 
                                                         gpointer data);
-static gint            find_gtkaspeller                (gconstpointer aa, 
-                                                        gconstpointer bb);
 
 static void destroy_menu(GtkWidget *widget, gpointer user_data);       
 
@@ -491,7 +489,6 @@ static gboolean key_press_cb                        (GtkWidget    *text_view,
                                                  GtkAspell    *gtkaspell)
 {
        gint pos;
-       GtkTextBuffer *textbuf = gtk_text_view_get_buffer(text_view);
 
        cm_return_val_if_fail(gtkaspell->gtkaspeller->speller, FALSE);
 
@@ -649,7 +646,6 @@ static void button_press_intercept_cb(GtkTextView *gtktext,
 /* Checker creation */
 static GtkAspeller *gtkaspeller_new(Dictionary *dictionary)
 {
-       GSList          *exist;
        GtkAspeller     *gtkaspeller = NULL;
        GtkAspeller     *tmp;
        Dictionary      *dict;
@@ -669,9 +665,6 @@ static GtkAspeller *gtkaspeller_new(Dictionary *dictionary)
        tmp = g_new0(GtkAspeller, 1);
        tmp->dictionary = dict;
 
-       exist = g_slist_find_custom(gtkaspellcheckers->checkers, tmp, 
-                                   find_gtkaspeller);
-       
        g_free(tmp);
 
        if ((gtkaspeller = gtkaspeller_real_new(dict)) != NULL) {
@@ -2389,17 +2382,6 @@ static void free_checkers(gpointer elt, gpointer data)
        gtkaspeller_real_delete(gtkaspeller);
 }
 
-static gint find_gtkaspeller(gconstpointer aa, gconstpointer bb)
-{
-       Dictionary *a = ((GtkAspeller *) aa)->dictionary;
-       Dictionary *b = ((GtkAspeller *) bb)->dictionary;
-
-       if (a && b && a->fullname && b->fullname)
-               return strcmp(a->fullname, b->fullname);
-
-       return 1;
-}
-
 gchar *gtkaspell_get_default_dictionary(GtkAspell *gtkaspell)
 {
        if (gtkaspell && gtkaspell->gtkaspeller &&
index 8ad5e24..5e81c98 100644 (file)
@@ -1467,21 +1467,6 @@ gtk_cmctree_button_press (GtkWidget      *widget,
   return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, event);
 }
 
-static gint
-gtk_cmctree_get_offset(GtkCMCTree     *ctree,
-                     GtkCMCTreeRow  *ctree_row,
-                     gint          column,
-                     GdkRectangle *clip_rectangle)
-{
-  gint justify_right = (GTK_CMCLIST (ctree)->column[column].justification == GTK_JUSTIFY_RIGHT);
-
-  if (justify_right)
-      return (clip_rectangle->x + clip_rectangle->width - 1 -
-               ctree->tree_indent * (ctree_row->level - 1));
-
-  return clip_rectangle->x + ctree->tree_indent * (ctree_row->level - 1);
-}
-
 static GtkCMCTreeNode *
 gtk_cmctree_last_visible (GtkCMCTree     *ctree,
                        GtkCMCTreeNode *node)
index 175cd77..2a00bdb 100644 (file)
@@ -280,9 +280,6 @@ gtk_shruler_init (GtkSHRuler *ruler)
 static void
 gtk_shruler_dispose (GObject *object)
 {
-  GtkSHRuler        *ruler = GTK_SHRULER (object);
-  GtkSHRulerPrivate *priv  = GTK_SHRULER_GET_PRIVATE (ruler);
-
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
index bcf47ba..aa5893e 100644 (file)
@@ -247,7 +247,6 @@ static void rename_folder_cb(GtkAction *action, gpointer data)
        gchar *new_folder;
        gchar *name;
        gchar *message;
-       gchar *old_path;
        gchar *old_id;
        gchar *new_id;
        gchar *base;
@@ -287,8 +286,6 @@ static void rename_folder_cb(GtkAction *action, gpointer data)
                return;
        }
 
-       Xstrdup_a(old_path, item->path, {g_free(new_folder); return;});
-
        old_id = folder_item_get_identifier(item);
        
        if (folder_item_rename(item, new_folder) < 0) {
@@ -348,7 +345,6 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
        FolderItem *item;
        gchar *message, *name;
        AlertValue avalue;
-       gchar *old_path;
        gchar *old_id;
 
        if (!folderview->selected) return;
@@ -370,7 +366,6 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
-       Xstrdup_a(old_path, item->path, return);
        old_id = folder_item_get_identifier(item);
 
        if (folderview->opened == folderview->selected ||
index aa33270..26e9735 100644 (file)
@@ -2400,8 +2400,14 @@ static void matcher_add_rulenames(const gchar *rcpath)
                && strncmp(buf, "disabled rulename \"", 18)) {
                        r = fwrite("enabled rulename \"\" ",
                                strlen("enabled rulename \"\" "), 1, dst);
+                       if (r != 1) {
+                               g_message("cannot fwrite rulename\n");
+                       }
                }
                r = fwrite(buf, strlen(buf), 1, dst);
+               if (r != 1) {
+                       g_message("cannot fwrite rule\n");
+               }
        }
        fclose(dst);
        fclose(src);
index 5b937b1..c763c51 100644 (file)
@@ -186,7 +186,6 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
        FolderItem *item;
        gchar *message, *name;
        AlertValue avalue;
-       gchar *old_path;
        gchar *old_id;
 
        item = folderview_get_selected_item(folderview);
@@ -206,7 +205,6 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
-       Xstrdup_a(old_path, item->path, return);
        old_id = folder_item_get_identifier(item);
 
        if (folderview->opened == folderview->selected ||
@@ -238,7 +236,6 @@ static void rename_folder_cb(GtkAction *action, gpointer data)
        gchar *new_folder;
        gchar *name;
        gchar *message;
-       gchar *old_path;
        gchar *old_id;
        gchar *new_id;
        gchar *base;
@@ -271,8 +268,6 @@ static void rename_folder_cb(GtkAction *action, gpointer data)
                return;
        }
 
-       Xstrdup_a(old_path, item->path, {g_free(new_folder); return;});
-
        old_id = folder_item_get_identifier(item);
        
        if (folder_item_rename(item, new_folder) < 0) {
index f3e56b6..e7755f5 100644 (file)
@@ -1255,7 +1255,8 @@ static GSList *news_get_msginfos(Folder *folder, FolderItem *item, GSList *msgnu
        NewsSession *session;
        GSList *elem, *msginfo_list = NULL, *tmp_msgnum_list, *tmp_msginfo_list;
        guint first, last, next;
-       guint tofetch, fetched;
+/*     guint tofetch, fetched;
+*/
        
        cm_return_val_if_fail(folder != NULL, NULL);
        cm_return_val_if_fail(FOLDER_CLASS(folder) == &news_class, NULL);
@@ -1269,8 +1270,9 @@ static GSList *news_get_msginfos(Folder *folder, FolderItem *item, GSList *msgnu
        tmp_msgnum_list = g_slist_sort(tmp_msgnum_list, g_int_compare);
 
        progressindicator_start(PROGRESS_TYPE_NETWORK);
-       tofetch = g_slist_length(tmp_msgnum_list);
+/*     tofetch = g_slist_length(tmp_msgnum_list);
        fetched = 0;
+*/
 
        first = GPOINTER_TO_INT(tmp_msgnum_list->data);
        last = first;
@@ -1285,7 +1287,8 @@ static GSList *news_get_msginfos(Folder *folder, FolderItem *item, GSList *msgnu
 */
                        tmp_msginfo_list = news_get_msginfos_for_range(session, item, first, last);
                        msginfo_list = g_slist_concat(msginfo_list, tmp_msginfo_list);
-                       fetched = last - first + 1;
+/*                     fetched = last - first + 1;
+*/
                        first = next;
                }
                last = next;
index 880dff1..986d734 100644 (file)
@@ -906,7 +906,6 @@ static void prefs_account_edit_custom_header        (void);
 static void privacy_system_activated(GtkWidget *combobox)
 {
        const gchar *system_id;
-       gboolean privacy_enabled = FALSE;
        gint privacy_enabled_int;
        GtkTreeIter iter;
        GtkListStore *menu = GTK_LIST_STORE(gtk_combo_box_get_model(
@@ -919,11 +918,6 @@ static void privacy_system_activated(GtkWidget *combobox)
                        COMBOBOX_DATA, &privacy_enabled_int,
                        -1);
        
-       privacy_enabled = strcmp(system_id, "");
-
-       if( privacy_enabled_int == 0 )
-               privacy_enabled = FALSE;
-
        gtk_widget_set_sensitive (privacy_page.save_clear_text_checkbtn, 
                !gtk_toggle_button_get_active(
                                GTK_TOGGLE_BUTTON(privacy_page.encrypt_to_self_checkbtn)));
index fa95c14..fa9a65f 100644 (file)
@@ -590,10 +590,6 @@ static gint prefs_actions_clist_set_row(gint row)
        gint len, action_nb;
        gchar action[PREFSBUFSIZE];
        gchar *new_action;
-       GtkListStore *store;
-
-       store = GTK_LIST_STORE(gtk_tree_view_get_model
-                               (GTK_TREE_VIEW(actions.actions_list_view)));
 
        GET_ENTRY(actions.name_entry);
        if (entry_text[0] == '\0') {
index 51832f6..36c2737 100644 (file)
@@ -501,10 +501,6 @@ static void prefs_custom_header_list_view_set_row(PrefsAccount *ac)
        CustomHeader *ch;
        const gchar *entry_text;
        gchar *ch_str;
-       GtkListStore *store;
-
-       store = GTK_LIST_STORE(gtk_tree_view_get_model
-                               (GTK_TREE_VIEW(customhdr.list_view)));
 
        entry_text = gtk_entry_get_text(GTK_ENTRY(customhdr.hdr_entry));
        if (entry_text[0] == '\0') {
index 575f65a..48af8f5 100644 (file)
@@ -1289,14 +1289,13 @@ static void prefs_filtering_top(gpointer action, gpointer data)
 
 static void prefs_filtering_page_up(gpointer action, gpointer data)
 {
-       gint row, target_row, n_rows;
+       gint row, target_row;
        GtkTreeIter selected, target;
        GtkTreeModel *model;
        GtkTreePath *path;
        GdkRectangle cell_rect, view_rect;
 
        model = gtk_tree_view_get_model(GTK_TREE_VIEW(filtering.cond_list_view));       
-       n_rows = gtk_tree_model_iter_n_children(model, NULL);
        row = gtkut_list_view_get_selected_row(filtering.cond_list_view);
        if (row <= 1)
                return;
index f72192f..4b731a9 100644 (file)
@@ -734,11 +734,8 @@ static gboolean prefs_template_list_view_set_row(gint row)
        gchar *value;
        GtkTextBuffer *buffer;
        GtkTextIter start, end;
-       GtkTreeModel *model;
        gint line;
 
-       model = gtk_tree_view_get_model(GTK_TREE_VIEW(templates.list_view));
-
        buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(templates.text_value));
        gtk_text_buffer_get_start_iter(buffer, &start);
        gtk_text_buffer_get_iter_at_offset(buffer, &end, -1);
@@ -901,14 +898,11 @@ static void prefs_template_delete_cb(gpointer action, gpointer data)
 
 static void prefs_template_delete_all_cb(gpointer action, gpointer data)
 {
-       GtkListStore *list_store;
-
        if (alertpanel(_("Delete all templates"),
                          _("Do you really want to delete all the templates?"),
                          GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL) == G_ALERTDEFAULT)
           return;
 
-       list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(templates.list_view)));
        prefs_template_clear_list();
        modified = FALSE;
 
index bc55950..a437dcc 100644 (file)
@@ -249,10 +249,6 @@ static GHashTable** get_plugin_hash_from_toolbar_type(ToolbarType toolbar_type)
 static void prefs_toolbar_create_widget(PrefsPage *_page, GtkWindow *window, gpointer data)
 {
        ToolbarPage *prefs_toolbar = (ToolbarPage *) _page;
-       gchar *win_titles[3];
-       win_titles[TOOLBAR_MAIN]    = _("Main toolbar configuration");
-       win_titles[TOOLBAR_COMPOSE] = _("Compose toolbar configuration");  
-       win_titles[TOOLBAR_MSGVIEW] = _("Message view toolbar configuration");  
 
        prefs_toolbar->window = GTK_WIDGET(window);
 
index 8a969ad..c48a6d3 100644 (file)
@@ -634,14 +634,12 @@ static void cb_preview_got_page_size(GtkPrintOperationPreview *preview,
                                     gpointer                  data)
 {
        PreviewData *preview_data;
-       GtkPageOrientation orientation;
        GtkPaperSize *paper_size;
        gint paper_width;
        gint paper_height;
 
        preview_data = (PreviewData*) data;
        debug_print("got_page_size\n");
-       orientation  = gtk_page_setup_get_orientation(page_setup);
        paper_size   = gtk_page_setup_get_paper_size(page_setup);
        paper_width  = (gint)(gtk_paper_size_get_width(paper_size, GTK_UNIT_INCH)  
                              * PREVIEW_SCALE);
@@ -950,15 +948,10 @@ static void printing_textview_cb_begin_print(GtkPrintOperation *op, GtkPrintCont
 
        do {
                PangoRectangle logical_rect;
-               PangoLayoutLine *line;
                PangoAttrShape *attr = NULL;
-               int baseline;
 
                if (ii >= start) {
-                       line = pango_layout_iter_get_line(iter);
-
                        pango_layout_iter_get_line_extents(iter, NULL, &logical_rect);
-                       baseline = pango_layout_iter_get_baseline(iter);
 
                        if ((attr = g_hash_table_lookup(print_data->images,
                                                GINT_TO_POINTER(pango_layout_iter_get_index(iter)))) != NULL) {
@@ -1429,12 +1422,10 @@ static gboolean printing_is_pango_gdk_color_equal(PangoColor *p, GdkColor *g)
  */
 static gint printing_text_iter_get_offset_bytes(PrintData *print_data, const GtkTextIter *iter)
 {
-       gint off_chars;
        gint off_bytes;
        gchar *text;
        GtkTextIter start;
 
-       off_chars = gtk_text_iter_get_offset(iter);
        if (print_data->sel_start < 0 || print_data->sel_end <= print_data->sel_start) {
                gtk_text_buffer_get_start_iter(gtk_text_iter_get_buffer(iter), &start);
        } else {
index 4d17e4f..cb58ce3 100644 (file)
@@ -1138,6 +1138,7 @@ static gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file,
        return 0;
 }
 
+
 void procmsg_print_message(MsgInfo *msginfo, const gchar *cmdline)
 {
        static const gchar *def_cmd = "lpr %s";
@@ -1168,17 +1169,20 @@ void procmsg_print_message(MsgInfo *msginfo, const gchar *cmdline)
                return;
        }
 
-       if (msginfo->date) r = fprintf(prfp, "Date: %s\n", msginfo->date);
-       if (msginfo->from) r = fprintf(prfp, "From: %s\n", msginfo->from);
-       if (msginfo->to)   r = fprintf(prfp, "To: %s\n", msginfo->to);
-       if (msginfo->cc)   r = fprintf(prfp, "Cc: %s\n", msginfo->cc);
-       if (msginfo->newsgroups)
-               r = fprintf(prfp, "Newsgroups: %s\n", msginfo->newsgroups);
-       if (msginfo->subject) r = fprintf(prfp, "Subject: %s\n", msginfo->subject);
-       fputc('\n', prfp);
+       if (msginfo->date) { r = fprintf(prfp, "Date: %s\n", msginfo->date); if (r < 0) goto fpferr; }
+       if (msginfo->from) { r = fprintf(prfp, "From: %s\n", msginfo->from); if (r < 0) goto fpferr; }
+       if (msginfo->to)   { r = fprintf(prfp, "To: %s\n", msginfo->to); if (r < 0) goto fpferr; }
+       if (msginfo->cc)   { r = fprintf(prfp, "Cc: %s\n", msginfo->cc); if (r < 0) goto fpferr; }
+       if (msginfo->newsgroups) {
+               r = fprintf(prfp, "Newsgroups: %s\n", msginfo->newsgroups); if (r < 0) goto fpferr;
+       }
+       if (msginfo->subject) { r = fprintf(prfp, "Subject: %s\n", msginfo->subject); if (r < 0) goto fpferr; }
+       if (fputc('\n', prfp) == EOF) goto fpferr;
 
-       while (fgets(buf, sizeof(buf), tmpfp) != NULL)
+       while (fgets(buf, sizeof(buf), tmpfp) != NULL) {
                r = fputs(buf, prfp);
+               if (r == EOF) goto fpferr;
+       }
 
        fclose(prfp);
        fclose(tmpfp);
@@ -1200,6 +1204,12 @@ void procmsg_print_message(MsgInfo *msginfo, const gchar *cmdline)
                strncat(buf, "&", sizeof(buf) - strlen(buf) - 1);
        if (system(buf) == -1)
                g_warning("system(%s) failed.", buf);
+       return;
+fpferr:
+       FILE_OP_ERROR(prtmp, "fprintf/fputc/fputs");
+       g_free(prtmp);
+       fclose(tmpfp);
+       fclose(prfp);
 }
 
 MsgInfo *procmsg_msginfo_new_ref(MsgInfo *msginfo)