2012-09-19 [mones] 3.8.1cvs62
authorRicardo Mones <mones@claws-mail.org>
Wed, 19 Sep 2012 12:22:24 +0000 (12:22 +0000)
committerRicardo Mones <mones@claws-mail.org>
Wed, 19 Sep 2012 12:22:24 +0000 (12:22 +0000)
* src/action.c
Use unused var c to check result and emit messages on error
* src/addrbook.c
Remove unused vars: attr (several functions), element
* src/addrclip.c
Use unused var newGroup to check result
* src/addrcustomattr.c
Remove unused var summaryview and related code
* src/addressbook.c
Use unused vars nn, newNode, idleID to check result
Remove unused var aoType and refactor logic around it
Comment var enabled and related debug code
* src/msgcache.c
Use unused var error to check result and emit debug messages
* src/textview.c
Remove unused var link_color
* src/toolbar.c
Remove unused vars: attr, retVal

ChangeLog
PATCHSETS
configure.ac
src/action.c
src/addrbook.c
src/addrclip.c
src/addrcustomattr.c
src/addressbook.c
src/msgcache.c
src/textview.c
src/toolbar.c

index 7ebd67b..7a44302 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2012-09-19 [mones]     3.8.1cvs62
+
+       * src/action.c
+               Use unused var c to check result and emit messages on error
+       * src/addrbook.c
+               Remove unused vars: attr (several functions), element
+       * src/addrclip.c
+               Use unused var newGroup to check result
+       * src/addrcustomattr.c
+               Remove unused var summaryview and related code
+       * src/addressbook.c
+               Use unused vars nn, newNode, idleID to check result
+               Remove unused var aoType and refactor logic around it
+               Comment var enabled and related debug code
+       * src/msgcache.c
+               Use unused var error to check result and emit debug messages
+       * src/textview.c
+               Remove unused var link_color
+       * src/toolbar.c
+               Remove unused vars: attr, retVal
+
 2012-09-19 [colin]     3.8.1cvs61
 
        * src/imap.c
index 864e9e9..9d13d6f 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
 ( cvs diff -u -r 1.179.2.261 -r 1.179.2.262 src/imap.c;  cvs diff -u -r 1.149.2.110 -r 1.149.2.111 src/inc.c;  cvs diff -u -r 1.101.2.71 -r 1.101.2.72 src/news.c;  cvs diff -u -r 1.17.2.64 -r 1.17.2.65 src/send_message.c;  cvs diff -u -r 1.13.2.49 -r 1.13.2.50 src/common/socket.c;  ) > 3.8.1cvs61.patchset
+( cvs diff -u -r 1.12.2.74 -r 1.12.2.75 src/action.c;  cvs diff -u -r 1.22.2.29 -r 1.22.2.30 src/addrbook.c;  cvs diff -u -r 1.5.2.12 -r 1.5.2.13 src/addrclip.c;  cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/addrcustomattr.c;  cvs diff -u -r 1.60.2.150 -r 1.60.2.151 src/addressbook.c;  cvs diff -u -r 1.16.2.72 -r 1.16.2.73 src/msgcache.c;  cvs diff -u -r 1.96.2.248 -r 1.96.2.249 src/textview.c;  cvs diff -u -r 1.43.2.130 -r 1.43.2.131 src/toolbar.c;  ) > 3.8.1cvs62.patchset
index 9754b26..759b81d 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=61
+EXTRA_VERSION=62
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index f337fbd..163652a 100644 (file)
@@ -1473,6 +1473,9 @@ static void catch_status(gpointer data, gint source, GIOCondition cond)
        g_source_remove(child_info->tag_status);
 
        c = read(source, &buf, 1);
+       if (c != 1) {
+               g_message("error reading child return status\n");
+       }
        debug_print("Child returned %c\n", buf);
 
 #ifdef G_OS_UNIX
index a3c0873..8c2bec5 100644 (file)
@@ -401,7 +401,6 @@ static void addrbook_parse_address(AddressBookFile *book, XMLFile *file,
 static void addrbook_parse_addr_list(AddressBookFile *book, XMLFile *file, 
                                     ItemPerson *person)
 {
-       GList *attr;
        guint prev_level;
 
        for (;;) {
@@ -411,7 +410,6 @@ static void addrbook_parse_addr_list(AddressBookFile *book, XMLFile *file,
                }
                if (file->level < prev_level) return;
                if (xml_compare_tag(file, AB_ELTAG_ADDRESS)) {
-                       attr = xml_get_current_tag_attr(file);
                        addrbook_parse_address(book, file, person);
                        addrbook_parse_addr_list(book, file, person);
                }
@@ -467,7 +465,6 @@ static void addrbook_parse_attribute(XMLFile *file, ItemPerson *person)
 static void addrbook_parse_attr_list(AddressBookFile *book, XMLFile *file, 
                                     ItemPerson *person)
 {
-       GList *attr;
        guint prev_level;
 
        for (;;) {
@@ -477,7 +474,6 @@ static void addrbook_parse_attr_list(AddressBookFile *book, XMLFile *file,
                }
                if (file->level < prev_level) return;
                if (xml_compare_tag(file, AB_ELTAG_ATTRIBUTE)) {
-                       attr = xml_get_current_tag_attr(file);
                        addrbook_parse_attribute(file, person);
                        addrbook_parse_attr_list(book, file, person);
                }
@@ -579,7 +575,6 @@ static void addrbook_parse_member(AddressBookFile *book, XMLFile *file,
 static void addrbook_parse_member_list(AddressBookFile *book, XMLFile *file, 
                                       ItemGroup *group)
 {
-       GList *attr;
        guint prev_level;
 
        for (;;) {
@@ -590,13 +585,9 @@ static void addrbook_parse_member_list(AddressBookFile *book, XMLFile *file,
                if (file->level < prev_level)
                        return;
                if (xml_compare_tag(file, AB_ELTAG_MEMBER)) {
-                       attr = xml_get_current_tag_attr(file);
                        addrbook_parse_member(book, file, group);
                        addrbook_parse_member_list(book, file, group);
                }
-               else {
-                       attr = xml_get_current_tag_attr(file);
-               }
        }
 }
 
@@ -674,7 +665,6 @@ static void addrbook_parse_folder_item(AddressBookFile *book, XMLFile *file,
 static void addrbook_parse_folder_list(AddressBookFile *book, XMLFile *file,
                                       ItemFolder *folder)
 {
-       GList *attr;
        guint prev_level;
 
        for (;;) {
@@ -685,13 +675,9 @@ static void addrbook_parse_folder_list(AddressBookFile *book, XMLFile *file,
                if (file->level < prev_level)
                        return;
                if (xml_compare_tag(file, AB_ELTAG_ITEM)) {
-                       attr = xml_get_current_tag_attr(file);
                        addrbook_parse_folder_item(book, file, folder);
                        addrbook_parse_folder_list(book, file, folder);
                }
-               else {
-                       attr = xml_get_current_tag_attr(file);
-               }
        }
 }
 
@@ -1924,9 +1910,10 @@ gchar *addrbook_gen_new_file_name(gint fileNum) {
  * \param book Address book.
  * \param file XML file handle.
  */
-static void addrbook_chkparse_addr_list( AddressBookFile *book, XMLFile *file ){
+static void addrbook_chkparse_addr_list( AddressBookFile *book, XMLFile *file )
+{
        guint prev_level;
-       GList *attr;
+       /* GList *attr; */
 
        for (;;) {
                prev_level = file->level;
@@ -1934,7 +1921,7 @@ static void addrbook_chkparse_addr_list( AddressBookFile *book, XMLFile *file ){
                        longjmp(book->jumper, 1);
                if (file->level < prev_level)
                        return;
-               attr = xml_get_current_tag_attr(file);
+               /* attr = xml_get_current_tag_attr(file); */
                /* addrbook_show_attribs( attr ); */
                if (xml_compare_tag(file, AB_ELTAG_ADDRESS))
                        addrbook_chkparse_addr_list(book, file);
@@ -1948,12 +1935,12 @@ static void addrbook_chkparse_addr_list( AddressBookFile *book, XMLFile *file ){
  */
 static void addrbook_chkparse_attribute(AddressBookFile *book, XMLFile *file)
 {
-       GList *attr;
-       gchar *element;
+       /* GList *attr; */
+       /* gchar *element; */
 
-       attr = xml_get_current_tag_attr(file);
+       /* attr = xml_get_current_tag_attr(file); */
        /* addrbook_show_attribs( attr ); */
-       element = xml_get_element(file);
+       /* element = xml_get_element(file); */
        /* g_print( "\t\tattrib value : %s\n", element ); */
 }
 
@@ -1986,9 +1973,9 @@ static void addrbook_chkparse_attr_list(AddressBookFile *book, XMLFile *file)
  */
 static void addrbook_chkparse_person(AddressBookFile *book, XMLFile *file)
 {
-       GList *attr;
+       /* GList *attr; */
 
-       attr = xml_get_current_tag_attr(file);
+       /* attr = xml_get_current_tag_attr(file); */
        /* addrbook_show_attribs( attr ); */
        if (xml_parse_next_tag(file)) /* Consume closing tag */
                longjmp(book->jumper, 1);
@@ -2010,7 +1997,7 @@ static void addrbook_chkparse_person(AddressBookFile *book, XMLFile *file)
  */
 static void addrbook_chkparse_member_list(AddressBookFile *book, XMLFile *file)
 {
-       GList *attr;
+       /* GList *attr; */
        guint prev_level;
 
        for (;;) {
@@ -2022,12 +2009,12 @@ static void addrbook_chkparse_member_list(AddressBookFile *book, XMLFile *file)
                        return;
                        
                if (xml_compare_tag(file, AB_ELTAG_MEMBER)) {
-                       attr = xml_get_current_tag_attr(file);
+                       /* attr = xml_get_current_tag_attr(file); */
                        /* addrbook_show_attribs( attr ); */
                        addrbook_chkparse_member_list(book, file);
                }
                else {
-                       attr = xml_get_current_tag_attr(file);
+                       /* attr = xml_get_current_tag_attr(file); */
                        /* addrbook_show_attribs( attr ); */
                }
        }
@@ -2040,9 +2027,9 @@ static void addrbook_chkparse_member_list(AddressBookFile *book, XMLFile *file)
  */
 static void addrbook_chkparse_group(AddressBookFile *book, XMLFile *file)
 {
-       GList *attr;
+       /* GList *attr; */
 
-       attr = xml_get_current_tag_attr(file);
+       /* attr = xml_get_current_tag_attr(file); */
        /* addrbook_show_attribs( attr ); */
        if (xml_parse_next_tag(file))   /* Consume closing tag */
                longjmp(book->jumper, 1);
@@ -2058,7 +2045,7 @@ static void addrbook_chkparse_group(AddressBookFile *book, XMLFile *file)
  */
 static void addrbook_chkparse_folder_list(AddressBookFile *book, XMLFile *file)
 {
-       GList *attr;
+       /* GList *attr; */
        guint prev_level;
 
        for (;;) {
@@ -2070,12 +2057,12 @@ static void addrbook_chkparse_folder_list(AddressBookFile *book, XMLFile *file)
                        return;
                        
                if (xml_compare_tag(file, AB_ELTAG_ITEM)) {
-                       attr = xml_get_current_tag_attr(file);
+                       /* attr = xml_get_current_tag_attr(file); */
                        /* addrbook_show_attribs( attr ); */
                        addrbook_chkparse_folder_list(book, file);
                }
                else {
-                       attr = xml_get_current_tag_attr(file);
+                       /* attr = xml_get_current_tag_attr(file); */
                        /* addrbook_show_attribs( attr ); */
                }
        }
@@ -2088,9 +2075,9 @@ static void addrbook_chkparse_folder_list(AddressBookFile *book, XMLFile *file)
  */
 static void addrbook_chkparse_folder(AddressBookFile *book, XMLFile *file)
 {
-       GList *attr;
+       /* GList *attr; */
 
-       attr = xml_get_current_tag_attr(file);
+       /* attr = xml_get_current_tag_attr(file); */
        /* addrbook_show_attribs( attr ); */
        if (xml_parse_next_tag(file))   /* Consume closing tag */
                longjmp(book->jumper, 1);
@@ -2106,7 +2093,7 @@ static void addrbook_chkparse_folder(AddressBookFile *book, XMLFile *file)
  */
 static gboolean addrbook_chkread_tree(AddressBookFile *book, XMLFile *file)
 {
-       GList *attr;
+       /* GList *attr; */
        gboolean retVal;
 
        if (xml_get_dtd(file))
@@ -2118,7 +2105,7 @@ static gboolean addrbook_chkread_tree(AddressBookFile *book, XMLFile *file)
        if (!xml_compare_tag(file, AB_ELTAG_ADDRESS_BOOK))
                return FALSE;
 
-       attr = xml_get_current_tag_attr(file);
+       /* attr = xml_get_current_tag_attr(file); */
        /* addrbook_show_attribs( attr ); */
 
        retVal = TRUE;
index ecb9032..1d469c2 100644 (file)
@@ -379,6 +379,9 @@ static ItemFolder *addrclip_cache_copy_folder(
                node = g_list_next( node );
                newGroup = addrclip_cache_add_group(
                                cache, newFolder, item, copyList );
+               if (newGroup == NULL) {
+                       g_message("error allocating memory for new group\n");
+               }
        }
        g_list_free( copyList );
 
index f17f2f4..be22130 100644 (file)
@@ -324,10 +324,6 @@ static void custom_attr_selected_attr_edited(GtkCellRendererText *widget,
 {
        GtkTreeIter iter;
        GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list_view));
-       SummaryView *summaryview = NULL;
-
-       if (mainwindow_get_mainwindow() != NULL)
-               summaryview = mainwindow_get_mainwindow()->summaryview;
 
        if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
                return;
index 1004b91..827829e 100644 (file)
@@ -2142,6 +2142,9 @@ static void addressbook_treenode_add_list(
 
                        group = ( ItemGroup * ) aio;
                        nn = addressbook_node_add_group( treeNode, ds, group );
+                       if (nn == NULL) {
+                               g_message("error adding addressbook group\n");
+                       }
                }
                else if( ADDRESS_OBJECT_TYPE(aio) == ITEMTYPE_FOLDER ) {
                        ItemFolder *folder;
@@ -2149,6 +2152,9 @@ static void addressbook_treenode_add_list(
                        folder = ( ItemFolder * ) aio;
                        nn = addressbook_node_add_folder(
                                treeNode, ds, folder, ADDR_ITEM_FOLDER );
+                       if (nn == NULL) {
+                               g_message("error adding addressbook folder\n");
+                       }
                }
                node = g_list_next( node );
        }
@@ -2678,6 +2684,9 @@ static void addressbook_new_folder_cb(GtkAction *action, gpointer data)
                GtkCMCTreeNode *nn;
                nn = addressbook_node_add_folder(
                        addrbook.treeSelected, ds, folder, ADDR_ITEM_FOLDER );
+               if (nn == NULL) {
+                       g_message("error adding addressbook folder\n");
+               }
                gtk_cmctree_expand( ctree, addrbook.treeSelected );
                if( addrbook.treeSelected == addrbook.opened )
                        addressbook_set_clist(obj, TRUE);
@@ -2715,6 +2724,9 @@ static void addressbook_new_group_cb(GtkAction *action, gpointer data)
        if( group ) {
                GtkCMCTreeNode *nn;
                nn = addressbook_node_add_group( addrbook.treeSelected, ds, group );
+               if (nn == NULL) {
+                       g_message("error adding addressbook group\n");
+               }
                gtk_cmctree_expand( ctree, addrbook.treeSelected );
                if( addrbook.treeSelected == addrbook.opened )
                        addressbook_set_clist(obj, TRUE);
@@ -3978,12 +3990,14 @@ static void addressbook_load_tree( void ) {
                                nodeDS = iface->listSource;
                                while( nodeDS ) {
                                        ds = nodeDS->data;
-                                       newNode = NULL;
                                        name = addrindex_ds_get_name( ds );
                                        ads = addressbook_create_ds_adapter(
                                                        ds, atci->objectType, name );
                                        newNode = addressbook_add_object(
                                                        node, ADDRESS_OBJECT(ads) );
+                                       if (newNode == NULL) {
+                                               g_message("error adding addressbook object\n");
+                                       }
                                        nodeDS = g_list_next( nodeDS );
                                }
                                gtk_cmctree_expand( ctree, node );
@@ -4579,21 +4593,11 @@ static void addressbook_perform_search(
        gchar *name;
        gint queryID;
        guint idleID;
-#ifdef USE_LDAP
-       AddressObjectType aoType = ADDR_NONE;
-#endif
 
        /* Setup a query */
        if( *searchTerm == '\0' || strlen( searchTerm ) < 1 ) return;
 
-       if( ds && ds->type == ADDR_IF_LDAP ) {
-#if USE_LDAP
-               aoType = ADDR_LDAP_QUERY;
-#endif
-       }
-       else {
-               return;
-       }
+       if( !ds || ds->type != ADDR_IF_LDAP ) return;
 
        /* Create a folder for the search results */
        name = g_strdup_printf( _queryFolderLabel_, searchTerm );
@@ -4609,6 +4613,9 @@ static void addressbook_perform_search(
        idleID = g_idle_add(
                        (GSourceFunc) addressbook_search_idle,
                        GINT_TO_POINTER( queryID ) );
+       if (idleID == 0) {
+               g_message("error adding addressbook_search_idle\n");
+       }
 
        /* Start search, sit back and wait for something to happen */
        addrindex_start_search( queryID );
@@ -5076,7 +5083,7 @@ static void addrbookctl_build_ifselect( void ) {
        gint ifType;
        gint i;
        gchar *endptr = NULL;
-       gboolean enabled;
+       /* gboolean enabled; */
        AdapterInterface *adapter;
 
        selectStr = g_strdup( ADDRESSBOOK_IFACE_SELECTION );
@@ -5087,12 +5094,13 @@ static void addrbookctl_build_ifselect( void ) {
                if( splitStr[i] ) {
                        /* g_print( "%d : %s\n", i, splitStr[i] ); */
                        ifType = strtol( splitStr[i], &endptr, 10 );
-                       enabled = TRUE;
+                       /* enabled = TRUE;
                        if( *endptr ) {
                                if( strcmp( endptr, "/n" ) == 0 ) {
                                        enabled = FALSE;
                                }
                        }
+                       */
                        /* g_print( "\t%d : %s\n", ifType, enabled ? "yes" : "no" ); */
                        adapter = addrbookctl_find_interface( ifType );
                        if( adapter ) {
@@ -5482,6 +5490,9 @@ void addressbook_harvest(
                                newNode = addressbook_add_object(
                                                adapter->treeNode,
                                                ADDRESS_OBJECT(ads) );
+                               if (newNode == NULL) {
+                                       g_message("error adding addressbook object\n");
+                               }
                        }
                }
 
index f1c5ee3..2ea7df5 100644 (file)
@@ -879,6 +879,9 @@ void msgcache_read_mark(MsgCache *cache, const gchar *mark_file)
        }
 bail_err:
        fclose(fp);
+       if (error) {
+               debug_print("error reading cache mark from %s\n", mark_file);
+       }
 }
 
 void msgcache_read_tags(MsgCache *cache, const gchar *tags_file)
@@ -986,6 +989,9 @@ void msgcache_read_tags(MsgCache *cache, const gchar *tags_file)
        }
 bail_err:
        fclose(fp);
+       if (error) {
+               debug_print("error reading cache tags from %s\n", tags_file);
+       }
 }
 
 static int msgcache_write_cache(MsgInfo *msginfo, FILE *fp)
index ef23808..d91b3ff 100644 (file)
@@ -1685,7 +1685,6 @@ do_quote:
 void textview_write_link(TextView *textview, const gchar *str,
                         const gchar *uri, CodeConverter *conv)
 {
-       GdkColor *link_color = NULL;
        GtkTextView *text;
        GtkTextBuffer *buffer;
        GtkTextIter iter;
@@ -1726,9 +1725,6 @@ void textview_write_link(TextView *textview, const gchar *str,
        if (bufp > buf)
                gtk_text_buffer_insert(buffer, &iter, buf, bufp - buf);
 
-       if (prefs_common.enable_color) {
-               link_color = &uri_color;
-       }
        r_uri = g_new0(ClickableText, 1);
        r_uri->uri = g_strdup(uri);
        r_uri->start = gtk_text_iter_get_offset(&iter);
index 27e3eb5..63fe7c9 100644 (file)
@@ -705,8 +705,6 @@ void toolbar_read_config_file(ToolbarType source)
 {
        XMLFile *file   = NULL;
        gchar *fileSpec = NULL;
-       GList *attr;
-       gboolean retVal;
        jmp_buf    jumper;
 
        debug_print("read Toolbar Configuration from %s\n", toolbar_config[source].conf_file);
@@ -726,9 +724,6 @@ void toolbar_read_config_file(ToolbarType source)
                        return;
                }
 
-               attr = xml_get_current_tag_attr(file);
-               
-               retVal = TRUE;
                for (;;) {
                        if (!file->level) 
                                break;