* major code cleanup (part 1)
authorChristoph Hohmann <reboot@gmx.ch>
Tue, 2 Jul 2002 19:49:11 +0000 (19:49 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Tue, 2 Jul 2002 19:49:11 +0000 (19:49 +0000)
        - unused variables removed
        - unused functions removed
        - uninitialized variables checked
        - missing return statements added
        - missing function return types added
        - added parentheses around assignment and
          && in || when suggested by gcc

* src/mh.c
* src/folder.c
        replaced direct calls to folder->scan_tree
        with folder_scan_tree and restore folder
        prefs in this function. The folder should
        not have to deal with them.
        ( Should now work for all folder types )

49 files changed:
src/addr_compl.c
src/addrbook.c
src/addrcache.c
src/addrclip.c
src/addressbook.c
src/addressbook.h
src/addrharvest.c
src/addrindex.c
src/addrselect.c
src/compose.c
src/exphtmldlg.c
src/exporthtml.c
src/filesel.c
src/folder.c
src/folder.h
src/folderview.c
src/gtksctree.c
src/gtkshruler.c
src/gtkstext.c
src/inc.c
src/ldif.c
src/main.c
src/mainwindow.c
src/mbox.c
src/messageview.c
src/mgutils.c
src/mh.c
src/mutt.c
src/news.c
src/passphrase.c
src/passphrase.h
src/pgptext.c
src/pine.c
src/prefs_account.c
src/prefs_actions.c
src/prefs_common.c
src/prefs_filtering.c
src/prefs_folder_item.c
src/prefs_matcher.c
src/prefs_scoring.c
src/procheader.c
src/procmime.c
src/procmsg.c
src/setup.c
src/string_match.c
src/summaryview.c
src/textview.c
src/vcard.c
src/xmlprops.c

index 0054989..f688423 100644 (file)
@@ -144,7 +144,7 @@ static void free_all(void)
        g_completion = NULL;
 }
 
-static gint add_address1(const char *str, address_entry *ae)
+static void add_address1(const char *str, address_entry *ae)
 {
        completion_entry *ce1;
        ce1 = g_new0(completion_entry, 1),
index 605771f..dcdad5c 100644 (file)
@@ -1350,15 +1350,6 @@ static void addrbook_load_hash_table_email_vis( gpointer key, gpointer value, gp
        }
 }
 
-/*
-* Load hash table with links to email addresses.
-*/
-static void addrbook_load_hash_table_email( AddressBookFile *book, GHashTable *table ) {
-       g_return_if_fail( book != NULL );
-       g_return_if_fail( table != NULL );
-       g_hash_table_foreach( book->addressCache->itemHash, addrbook_load_hash_table_email_vis, table );
-}
-
 /*
 * Build available email list visitor function.
 */
@@ -1728,16 +1719,6 @@ gchar *addrbook_gen_new_file_name( gint fileNum ) {
 * ***********************************************************************
 */
 
-static void addrbook_show_attribs( GList *attr ) {
-       while( attr ) {
-               gchar *name = ((XMLAttr *)attr->data)->name;
-               gchar *value = ((XMLAttr *)attr->data)->value;
-               printf( "\tn/v = %s : %s\n", name, value );
-               attr = g_list_next( attr );
-       }
-       printf( "\t---\n" );
-}
-
 /*
 * Test email address list.
 */
index ccf3865..ae82b4f 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include <stdio.h>
+#include <string.h>
 #include <sys/stat.h>
 
 #include "mgutils.h"
index bbf4fb0..5e86739 100644 (file)
@@ -161,13 +161,6 @@ void addrclip_add_item(
        }
 }
 
-static void addrclip_print( AddrSelectItem *item, FILE *stream ) {
-       fprintf( stream, "Select Record\n" );
-       fprintf( stream, "obj type: %d\n", item->objectType );
-       fprintf( stream, "     uid: %s\n", item->uid );
-       fprintf( stream, "---\n" );
-}
-
 /*
 * Show clipboard contents.
 * Enter: clipBoard Clipboard.
@@ -286,79 +279,6 @@ static GList *addrclip_cache_add_person(
        return copyList;
 }
 
-/*
- * Paste unattached email into cache.
- * Enter: cache    Address cache to paste into.
- *        folder   Folder to store
- *        email    EMail to add.
- *        copyList List of email addresses pasted.
- * Return: Update list of email addresses pasted.
- */
-static GList *addrclip_cache_add_email(
-       AddressCache *cache, ItemFolder *folder, ItemEMail *email,
-       GList *copyList )
-{
-       ItemPerson *newPerson;
-       ItemEMail *newEMail;
-       AddrClip_EMail *em;
-
-       /* Create a person */
-       newPerson = addritem_create_item_person();
-       addritem_person_set_common_name( newPerson, "" );
-       addrcache_id_person( cache, newPerson );
-       addrcache_folder_add_person( cache, folder, newPerson );
-
-       /* Copy email addresses */
-       newEMail = addritem_copy_item_email( email );
-       addrcache_id_email( cache, newEMail );
-       addrcache_person_add_email( cache, newPerson, newEMail );
-
-       /* Take a copy of the original */
-       em = g_new0( AddrClip_EMail, 1 );
-       em->original = email;
-       em->copy = newEMail;
-       copyList = g_list_append( copyList, em );
-
-       return copyList;
-}
-
-/*
- * Test whether specified E-Mail address object is already in clipboard and
- * owned by an ItemPerson objects.
- * Enter: email  E-Mail to test.
- * Return: TRUE if duplicate found.
- */
-static gboolean addrclip_test_email(
-       AddressClipboard *clipBoard, ItemEMail *testEMail )
-{
-       ItemPerson *person;
-       ItemEMail *email;
-       GList *node, *nodeMail;
-       AddrSelectItem *item;
-       AddrItemObject *aio;
-       AddressCache *cache;
-
-       node = clipBoard->objectList;
-       while( node ) {
-               item = node->data;
-               cache = addrindex_get_cache( clipBoard->addressIndex, item->cacheID );
-               aio = addrcache_get_object( cache, item->uid );
-               if( aio ) {
-                       if( ADDRITEM_TYPE(aio) == ITEMTYPE_PERSON ) {
-                               person = ( ItemPerson * ) aio;
-                               nodeMail = person->listEMail;
-                               while( nodeMail ) {
-                                       email = nodeMail->data;
-                                       if( email == testEMail ) return TRUE;
-                                       nodeMail = g_list_next( nodeMail );
-                               }
-                       }
-               }
-               node = g_list_next( node );
-       }
-       return FALSE;
-}
-
 /*
  * Search for new email record in copied email list.
  * Enter: copyList  List of copied email address mappings.
@@ -975,7 +895,7 @@ static gint addrclip_person_move_email(
        GList *node;
 
        cnt = 0;
-       while( node = fromPerson->listEMail ) {
+       while((node = fromPerson->listEMail) != NULL) {
                ItemEMail *email;
 
                email = node->data;
index 61fce2c..9f33ec0 100644 (file)
@@ -292,11 +292,6 @@ static void addressbook_move_nodes_up              (GtkCTree       *ctree,
                                                GtkCTreeNode    *node);
 static GtkCTreeNode *addressbook_find_group_node (GtkCTreeNode *parent,
                                                   ItemGroup    *group);
-static GtkCTreeNode *addressbook_find_folder_node( GtkCTreeNode        *parent,
-                                                  ItemFolder   *folder );
-
-static void addressbook_delete_object          (AddressObject  *obj);
-
 static void key_pressed                                (GtkWidget      *widget,
                                                 GdkEventKey    *event,
                                                 gpointer        data);
@@ -1054,12 +1049,10 @@ static void addressbook_to_clicked(GtkButton *button, gpointer data)
        if( ! compose ) return;
 
        /* Nothing selected, but maybe there is something in text entry */
-       if ( list == NULL ) {
-               addr = gtk_entry_get_text( GTK_ENTRY( addrbook.entry) );
-               if ( addr ) {
-                       compose_entry_append(
-                               compose, addr, (ComposeEntryType)data );
-               }
+       addr = gtk_entry_get_text( GTK_ENTRY( addrbook.entry) );
+       if ( addr ) {
+               compose_entry_append(
+                       compose, addr, (ComposeEntryType)data );
        }
 
        /* Select from address list */
@@ -2217,33 +2210,6 @@ static GtkCTreeNode *addressbook_find_group_node( GtkCTreeNode *parent, ItemGrou
        return NULL;
 }
 
-/*
-* Search for specified child folder node in address index tree.
-* Enter: parent Parent node.
-*        folder Folder to find.
-*/
-static GtkCTreeNode *addressbook_find_folder_node( GtkCTreeNode *parent, ItemFolder *folder ) {
-       GtkCTreeNode *node = NULL;
-       GtkCTreeRow *currRow;
-
-       currRow = GTK_CTREE_ROW( parent );
-       if( currRow ) {
-               node = currRow->children;
-               while( node ) {
-                       AddressObject *obj;
-
-                       obj = gtk_ctree_node_get_row_data( GTK_CTREE(addrbook.ctree), node );
-                       if( obj->type == ADDR_ITEM_FOLDER ) {
-                               ItemFolder *f = ADAPTER_FOLDER(obj)->itemFolder;
-                               if( f == folder ) return node;
-                       }
-                       currRow = GTK_CTREE_ROW(node);
-                       node = currRow->sibling;
-               }
-       }
-       return NULL;
-}
-
 static AddressBookFile *addressbook_get_book_file() {
        AddressBookFile *abf = NULL;
        AddressDataSource *ds = NULL;
@@ -2540,52 +2506,6 @@ static void addressbook_folder_load_group( GtkCTree *clist, ItemFolder *itemFold
        g_list_free( items );
 }
 
-/*
- * Load data sources into list.
- */
-static void addressbook_node_load_datasource( GtkCTree *clist, AddressObject *obj ) {
-       AdapterInterface *adapter;
-       AddressInterface *iface;
-       AddressTypeControlItem *atci = NULL;
-       GtkCTreeNode *newNode, *node;
-       GtkCTreeRow *row;
-       GtkCell *cell = NULL;
-       gchar *text[N_COLS];
-
-       adapter = ADAPTER_INTERFACE(obj);
-       if( adapter == NULL ) return;
-       iface = adapter->interface;
-       atci = adapter->atci;
-       if( atci == NULL ) return;
-
-       /* Create nodes in list copying values for data sources in tree */
-       row = GTK_CTREE_ROW( adapter->treeNode );
-       if( row ) {
-               node = row->children;
-               while( node ) {
-                       gpointer data;
-
-                       data = gtk_ctree_node_get_row_data( clist, node );
-                       row = GTK_CTREE_ROW( node );
-                       cell = ( ( GtkCListRow * )row )->cell;
-                       text[COL_NAME] = cell->u.text;
-                       text[COL_ADDRESS] = NULL;
-                       text[COL_REMARKS] = NULL;
-                       newNode = gtk_ctree_insert_node( clist, NULL, NULL,
-                                     text, FOLDER_SPACING,
-                                     atci->iconXpm, atci->maskXpm,
-                                     atci->iconXpmOpen, atci->maskXpmOpen,
-                                     FALSE, FALSE);
-                       /*
-                       gtk_ctree_node_set_row_data( clist, newNode, data );
-                       gtk_ctree_node_set_row_data_full( clist, newNode, NULL, NULL );
-                       */
-                       node = row->sibling;
-               }
-       }
-       gtk_ctree_sort_node( clist, NULL );
-}
-
 /*
 * Search ctree widget callback function.
 * Enter: pA Pointer to node.
@@ -3107,27 +3027,6 @@ static GtkCTreeNode *addressbook_node_add_folder(
        return newNode;
 }
 
-static void addressbook_delete_object(AddressObject *obj) {
-       AdapterDSource *ads = NULL;
-       AddressDataSource *ds = NULL;
-       if (!obj) return;
-
-       /* Remove data source. */
-       /* printf( "Delete obj type : %d\n", obj->type ); */
-
-       ads = ADAPTER_DSOURCE(obj);
-       if( ads == NULL ) return;
-       ds = ads->dataSource;
-       if( ds == NULL ) return;
-
-       /* Remove data source */
-       if( addrindex_index_remove_datasource( _addressIndex_, ds ) ) {
-               addrindex_free_datasource( ds );
-       }
-       /* Free up Adapter object */
-       g_free( ads );
-}
-
 void addressbook_export_to_file( void ) {
        if( _addressIndex_ ) {
                /* Save all new address book data */
index cc9ca94..f5ee5cd 100644 (file)
@@ -43,5 +43,8 @@ gboolean addressbook_load_completion  ( gint (*callBackFunc) ( const gchar *, con
 void addressbook_gather                        ( FolderItem *folderItem,
                                          gboolean sourceInd,
                                          GList *msgList );
+void addressbook_harvest               (FolderItem     *folderItem,
+                                        gboolean sourceInd,
+                                        GList *msgList);
 
 #endif /* __ADDRESSBOOK_H__ */
index b3a3f02..35ef37d 100644 (file)
@@ -67,7 +67,7 @@ struct _HeaderEntry {
  * Enter: harvester Harvester object.
  *        name      Header name.
  */
-static void *addrharvest_build_entry(
+static void addrharvest_build_entry(
                AddressHarvester* harvester, gchar *name )
 {
        HeaderEntry *entry;
@@ -80,12 +80,6 @@ static void *addrharvest_build_entry(
        harvester->headerTable = g_list_append( harvester->headerTable, entry );
 }
 
-static void addrharvest_print_hdrentry( HeaderEntry *entry, FILE *stream ) {
-       fprintf( stream, "Header Entry\n" );
-       fprintf( stream, "    name : %s\n", entry->header );
-       fprintf( stream, "selected : %s\n", entry->selected ? "yes" : "no" );
-}
-
 /*
  * Free key in table.
  */
@@ -375,7 +369,7 @@ static void addrharvest_del_email( gchar *name, gchar *str ) {
        gint lenn, lenr;
 
        lenr = strlen( str );
-       while( p = strcasestr( name, str )  ) {
+       while((p = strcasestr( name, str )) != NULL) {
                lenn = strlen( p );
                memmove( p, p + lenr, lenn );
        }
@@ -525,7 +519,7 @@ static void addrharvest_parse_address(
        gint bufLen;
 
        /* Search for an address */
-       while( atCh = addrharvest_find_at( hdrBuf ) ) {
+       while((atCh = addrharvest_find_at( hdrBuf )) != NULL) {
                /* Find addres string */
                addrharvest_find_address( hdrBuf, atCh, &bp, &ep );
 
index 17610ed..0dbc3ed 100644 (file)
@@ -427,7 +427,7 @@ AddressCache *addrindex_get_cache( AddressIndex *addrIndex, const gchar *cacheID
  * Enter: addrIndex Address index.
  *        ds        Data source.
  */
-static addrindex_hash_add_cache( AddressIndex *addrIndex, AddressDataSource *ds ) {
+static void addrindex_hash_add_cache( AddressIndex *addrIndex, AddressDataSource *ds ) {
        gchar *cacheID;
 
        cacheID = addrindex_get_cache_id( addrIndex, ds );
index d867d78..cc1338c 100644 (file)
@@ -176,7 +176,7 @@ gboolean addrselect_test_empty( AddrSelectList *asl ) {
 GList *addrselect_get_list( AddrSelectList *asl ) {
        GList *node, *list;
 
-       g_return_if_fail( asl != NULL );
+       g_return_val_if_fail(asl != NULL, NULL);
        list = NULL;
        node = asl->listSelect;
        while( node ) {
index 1fc1a3c..2acc299 100644 (file)
@@ -997,58 +997,6 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
 
 static void set_toolbar_style(Compose *compose);
 
-static gchar *procmime_get_file_name(MimeInfo *mimeinfo)
-{
-       gchar *base;
-       gchar *filename;
-
-       g_return_val_if_fail(mimeinfo != NULL, NULL);
-
-       base = mimeinfo->filename ? mimeinfo->filename
-               : mimeinfo->name ? mimeinfo->name : NULL;
-
-       if (MIME_TEXT_HTML == mimeinfo->mime_type && base == NULL){
-               filename = g_strdup_printf("%s%smimetmp.%08x.html",
-                                          get_mime_tmp_dir(),
-                                          G_DIR_SEPARATOR_S,
-                                          (gint)mimeinfo);
-               return filename;
-       }
-       else {
-               base = base ? base : "";
-               base = g_basename(base);
-               if (*base == '\0') {
-                       filename = g_strdup_printf("%s%smimetmp.%08x",
-                                                  get_mime_tmp_dir(),
-                                                  G_DIR_SEPARATOR_S,
-                                                  (gint)mimeinfo);
-                       return filename;
-               }
-       }
-
-       filename = g_strconcat(get_mime_tmp_dir(), G_DIR_SEPARATOR_S,
-                              base, NULL);
-
-       return filename;
-}
-
-static gchar *mime_extract_file(gchar *source, MimeInfo *partinfo)
-{
-       gchar *filename;
-
-       if (!partinfo) return NULL;
-
-       filename = procmime_get_file_name(partinfo);
-
-       if (procmime_get_part(filename, source, partinfo) < 0)
-               alertpanel_error
-                       (_("Can't get the part of multipart message."));
-
-       return filename;
-}
-
-
-
 #define INSERT_FW_HEADER(var, hdr) \
 if (msginfo->var && *msginfo->var) { \
        gtk_stext_insert(text, NULL, NULL, NULL, hdr, -1); \
@@ -1315,8 +1263,6 @@ GList *compose_get_compose_list(void)
 void compose_entry_append(Compose *compose, const gchar *address,
                          ComposeEntryType type)
 {
-       GtkEntry *entry;
-       const gchar *text;
        gchar *header;
 
        if (!address || *address == '\0') return;
@@ -1848,9 +1794,6 @@ static void compose_reedit_set_entry(Compose *compose, MsgInfo *msginfo)
 
 static void compose_exec_sig(Compose *compose, gchar *sigfile)
 {
-       FILE *tmpfp;
-       pid_t thepid;
-       gchar *sigtext;
        FILE  *sigprg;
        gchar  *buf;
        size_t buf_len = 128;
@@ -2364,7 +2307,7 @@ static guint ins_quote(GtkSText *text, guint indent_len,
                       guint prev_line_pos, guint text_len,
                       gchar *quote_fmt)
 {
-       guint i, ins_len;
+       guint i, ins_len = 0;
        gchar ch;
 
        if (indent_len) {
@@ -3352,7 +3295,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
        GSList *cur;
        gchar buf[BUFFSIZE];
        gint num;
-       MsgFlags flag = {0, 0};
         static gboolean lock = FALSE;
        PrefsAccount *mailac = NULL, *newsac = NULL;
        
@@ -4011,36 +3953,6 @@ static void compose_generate_msgid(Compose *compose, gchar *buf, gint len)
        g_free(addr);
 }
 
-static void compose_add_entry_field(GtkWidget *table, GtkWidget **hbox,
-                                   GtkWidget **entry, gint *count,
-                                   const gchar *label_str,
-                                   gboolean is_addr_entry)
-{
-       GtkWidget *label;
-
-       if (GTK_TABLE(table)->nrows < (*count) + 1)
-               gtk_table_resize(GTK_TABLE(table), (*count) + 1, 2);
-
-       *hbox = gtk_hbox_new(FALSE, 0);
-       label = gtk_label_new
-               (prefs_common.trans_hdr ? gettext(label_str) : label_str);
-       gtk_box_pack_end(GTK_BOX(*hbox), label, FALSE, FALSE, 0);
-       gtk_table_attach(GTK_TABLE(table), *hbox, 0, 1, *count, (*count) + 1,
-                        GTK_FILL, 0, 2, 0);
-       *entry = gtk_entry_new_with_max_length(MAX_ENTRY_LENGTH);
-       gtk_table_attach
-               (GTK_TABLE(table), *entry, 1, 2, *count, (*count) + 1, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
-#if 0 /* NEW COMPOSE GUI */
-       if (GTK_TABLE(table)->nrows > (*count) + 1)
-               gtk_table_set_row_spacing(GTK_TABLE(table), *count, 4);
-#endif
-
-       if (is_addr_entry)
-               address_completion_register_entry(GTK_ENTRY(*entry));
-
-       (*count)++;
-}
-
 static void compose_create_header_entry(Compose *compose) 
 {
        gchar *headers[] = {"To:", "Cc:", "Bcc:", "Newsgroups:", "Reply-To:", "Followup-To:", NULL};
@@ -4398,8 +4310,6 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        GtkWidget *scrolledwin;
        GtkWidget *text;
 
-       GtkWidget *table;
-
        UndoMain *undostruct;
 
        gchar *titles[N_ATTACH_COLS];
@@ -5053,7 +4963,7 @@ static void compose_set_priority_cb(gpointer data,
 static void compose_update_priority_menu_item(Compose * compose)
 {
        GtkItemFactory *ifactory;
-       GtkWidget *menuitem;
+       GtkWidget *menuitem = NULL;
 
        ifactory = gtk_item_factory_from_widget(compose->menubar);
        
@@ -6141,7 +6051,6 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
        FolderItem *draft;
        gchar *tmp;
        gint msgnum;
-       MsgFlags flag = {0, 0};
        static gboolean lock = FALSE;
        MsgInfo *newmsginfo;
        
@@ -6385,13 +6294,6 @@ static void compose_allsel_cb(Compose *compose)
                        (GTK_EDITABLE(compose->focused_editable), 0, -1);
 }
 
-static void compose_move_beginning_of_line_cb(Compose *compose)
-{
-       if (compose->focused_editable &&
-               GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
-               gtk_stext_move_beginning_of_line(GTK_STEXT(compose->focused_editable));
-}
-
 static void compose_gtk_stext_action_cb(Compose *compose, ComposeCallGtkSTextAction action)
 {
        if (!(compose->focused_editable && GTK_WIDGET_HAS_FOCUS(compose->focused_editable))) return;
index 9b47d8f..ab53717 100644 (file)
@@ -44,6 +44,8 @@
 #include "addrcache.h"
 #include "addressitem.h"
 #include "exporthtml.h"
+#include "utils.h"
+#include "manage_window.h"
 
 #define PAGE_FILE_INFO             0
 #define PAGE_FORMAT                1
index 67d76ad..78a01b0 100644 (file)
@@ -216,7 +216,7 @@ void exporthtml_print( ExportHtmlCtl *ctl, FILE *stream ) {
  * found in list, it will be returned.
  */
 static StylesheetEntry *exporthtml_find_stylesheet( ExportHtmlCtl *ctl ) {
-       StylesheetEntry *retVal;
+       StylesheetEntry *retVal = NULL;
        StylesheetEntry *entry;
        GList *node;
 
@@ -1019,7 +1019,7 @@ void exporthtml_process(
 
        tt = time( NULL );
        fprintf( htmlFile, "<p>%s</p>\n", ctime( &tt ) );
-       fprintf( htmlFile, "<hr width=\"100%\"></hr>\n" );
+       fprintf( htmlFile, "<hr width=\"100\%\"></hr>\n" );
 
        fprintf( htmlFile, "</body>\n" );
        fprintf( htmlFile, "</html>\n" );
@@ -1075,7 +1075,7 @@ gboolean exporthtml_test_dir( ExportHtmlCtl *ctl ) {
        DIR *dp;
 
        retVal = FALSE;
-       if( dp = opendir( ctl->dirOutput ) ) {
+       if((dp = opendir( ctl->dirOutput )) != NULL) {
                retVal = TRUE;
                closedir( dp );
        }
index 2428f39..aa06379 100644 (file)
@@ -312,7 +312,6 @@ static GList *filesel_get_multiple_filenames(void)
         * that need to be escaped). instead we use the file_list. the
         * entry is only useful for extracting the current directory. */
        GtkCList *file_list  = GTK_CLIST(GTK_FILE_SELECTION(filesel)->file_list);
-       GtkEntry *file_entry = GTK_ENTRY(GTK_FILE_SELECTION(filesel)->selection_entry);
        GList    *list = NULL, *sel_list;
        gchar    *cwd, *tmp;     
        gboolean  separator;
index 2cb2981..9500878 100644 (file)
@@ -46,6 +46,8 @@
 #include "prefs_common.h"
 #include "account.h"
 #include "prefs_account.h"
+#include "filtering.h"
+#include "scoring.h"
 #include "prefs_folder_item.h"
 #include "procheader.h"
 
@@ -66,8 +68,7 @@ static void folder_get_persist_prefs_recursive
                                        (GNode *node, GHashTable *pptable);
 static gboolean persist_prefs_free     (gpointer key, gpointer val, gpointer data);
 void folder_item_read_cache            (FolderItem *item);
-void folder_item_write_cache           (FolderItem *item);
-
+void folder_item_free_cache            (FolderItem *item);
 
 Folder *folder_new(FolderType type, const gchar *name, const gchar *path)
 {
@@ -307,7 +308,9 @@ gboolean folder_tree_destroy_func(GNode *node, gpointer data) {
 
 void folder_tree_destroy(Folder *folder)
 {
-       /* TODO: destroy all FolderItem before */
+       prefs_scoring_clear();
+       prefs_filtering_clear();
+
        g_node_traverse(folder->node, G_POST_ORDER, G_TRAVERSE_ALL, -1, folder_tree_destroy_func, NULL);
        g_node_destroy(folder->node);
 
@@ -407,6 +410,32 @@ void folder_write_list(void)
                g_warning("failed to write folder list.\n");
 }
 
+gboolean folder_scan_tree_func(GNode *node, gpointer data)
+{
+       GHashTable *pptable = (GHashTable *)data;
+       FolderItem *item = (FolderItem *)node->data;
+       
+       folder_item_restore_persist_prefs(item, pptable);
+}
+
+void folder_scan_tree(Folder *folder)
+{
+       GHashTable *pptable;
+       
+       if(!folder->scan_tree)
+               return;
+       
+       pptable = folder_persist_prefs_new(folder);
+       folder_tree_destroy(folder);
+
+       folder->scan_tree(folder);
+       
+       g_node_traverse(folder->node, G_POST_ORDER, G_TRAVERSE_ALL, -1, folder_scan_tree_func, pptable);
+       folder_persist_prefs_free(pptable);
+
+       prefs_matcher_read_config();
+}
+
 struct TotalMsgCount
 {
        guint new;
@@ -834,7 +863,7 @@ gint folder_item_scan(FolderItem *item)
        Folder *folder;
        GSList *folder_list, *cache_list, *elem, *new_list = NULL;
        gint i;
-       guint min = 0xffffffff, max = 0, cache_max = 0, maxgetcount = 0;
+       guint min = 0xffffffff, max = 0, cache_max = 0;
        FolderScanInfo *folderscaninfo;
        guint newcnt = 0, unreadcnt = 0, totalcnt = 0;
        
@@ -913,8 +942,8 @@ gint folder_item_scan(FolderItem *item)
                if( (folderscaninfo[i] & IN_FOLDER) && 
                   !(folderscaninfo[i] & IN_CACHE) && 
                    (folder->type != F_NEWS ||
-                       ((prefs_common.max_articles == 0) || (num > (max - prefs_common.max_articles))) &&
-                       (num > cache_max))
+                       (((prefs_common.max_articles == 0) || (num > (max - prefs_common.max_articles))) &&
+                       (num > cache_max)))
                    ) {
                        new_list = g_slist_prepend(new_list, GINT_TO_POINTER(num));
                        debug_print(_("Remembered message %d for fetching\n"), num);
@@ -978,7 +1007,6 @@ gint folder_item_scan(FolderItem *item)
                }
        } else if (folder->fetch_msginfo) {
                for(elem = new_list; elem != NULL; elem = g_slist_next(elem)) {
-                       MsgFlags flags;
                        MsgInfo *msginfo;
                        guint num;
 
@@ -1058,7 +1086,9 @@ void folder_find_expired_caches(FolderItem *item, gpointer data)
 void folder_item_free_cache(FolderItem *item)
 {
        g_return_if_fail(item != NULL);
-       g_return_if_fail(item->cache != NULL);
+       
+       if(item->cache == NULL)
+               return;
        
        folder_item_write_cache(item);
        msgcache_destroy(item->cache);
@@ -1153,7 +1183,7 @@ MsgInfo *folder_item_fetch_msginfo(FolderItem *item, gint num)
        if(!item->cache)
                folder_item_read_cache(item);
        
-       if(msginfo = msgcache_get_msg(item->cache, num))
+       if((msginfo = msgcache_get_msg(item->cache, num)) != NULL)
                return msginfo;
        
        g_return_val_if_fail(folder->fetch_msginfo, NULL);
@@ -1245,7 +1275,6 @@ gint folder_item_move_msg(FolderItem *dest, MsgInfo *msginfo)
 {
        Folder *folder;
        gint num;
-       gchar * filename;
        Folder * src_folder;
 
        g_return_val_if_fail(dest != NULL, -1);
@@ -1328,7 +1357,6 @@ gint folder_item_move_msgs_with_dest(FolderItem *dest, GSList *msglist)
        Folder *folder;
        FolderItem * item;
        GSList * l;
-       gchar * filename;
        gint num;
 
        g_return_val_if_fail(dest != NULL, -1);
@@ -1413,8 +1441,6 @@ gint folder_item_copy_msg(FolderItem *dest, MsgInfo *msginfo)
 {
        Folder *folder;
        gint num;
-       gchar * filename;
-       Folder * src_folder;
 
        g_return_val_if_fail(dest != NULL, -1);
        g_return_val_if_fail(msginfo != NULL, -1);
@@ -1479,7 +1505,6 @@ gint folder_item_copy_msgs_with_dest(FolderItem *dest, GSList *msglist)
        Folder *folder;
        gint num;
        GSList * l;
-       gchar * filename;
 
        g_return_val_if_fail(dest != NULL, -1);
        g_return_val_if_fail(msglist != NULL, -1);
@@ -2037,7 +2062,6 @@ static void folder_create_processing_folder(void)
 {
 #define PROCESSING_FOLDER ".processing"        
        Folder     *tmpparent;
-       FolderItem *tmpfolder;
        gchar      *tmpname;
 
        tmpparent = folder_get_default_folder();
index 4baf398..72d2203 100644 (file)
@@ -296,6 +296,7 @@ void   folder_add           (Folder         *folder);
 GList *folder_get_list         (void);
 gint   folder_read_list                (void);
 void   folder_write_list       (void);
+void   folder_scan_tree                (Folder *folder);
 void   folder_update_op_count          (void);
 void   folder_func_to_all_folders      (FolderItemFunc function,
                                         gpointer data);
@@ -358,5 +359,7 @@ const PersistPrefs *folder_get_persist_prefs
 
 void folder_item_restore_persist_prefs (FolderItem *item, GHashTable *pptable);
 void folder_clean_cache_memory         ();
+void folder_item_write_cache           (FolderItem *item);
+void folder_item_set_default_flags     (FolderItem *dest, MsgFlags *flags);
 
 #endif /* __FOLDER_H__ */
index 4d71ff7..234cedd 100644 (file)
@@ -806,7 +806,7 @@ void folderview_rescan_tree(Folder *folder)
        window = label_window_create(_("Rescanning folder tree..."));
 
        folder_set_ui_func(folder, folderview_scan_tree_func, NULL);
-       folder->scan_tree(folder);
+       folder_scan_tree(folder);
        folder_set_ui_func(folder, NULL, NULL);
 
        folder_write_list();
@@ -832,7 +832,7 @@ void folderview_rescan_all(void)
 
                if (!folder->scan_tree) continue;
                folder_set_ui_func(folder, folderview_scan_tree_func, NULL);
-               folder->scan_tree(folder);
+               folder_scan_tree(folder);
                folder_set_ui_func(folder, NULL, NULL);
        }
 
index b5ed823..5ac6f50 100644 (file)
@@ -2,8 +2,9 @@
  * This program is based on gtkflist.c
  */
 
-#include "gtksctree.h"
+#include <stdlib.h>
 
+#include "gtksctree.h"
 
 enum {
        ROW_POPUP_MENU,
index fc32d7e..0cc442d 100644 (file)
@@ -112,14 +112,6 @@ gtk_shruler_new(void)
        return GTK_WIDGET( gtk_type_new( gtk_shruler_get_type() ) );
 }
 
-static gint
-gtk_shruler_motion_notify(GtkWidget      *widget,
-                         GdkEventMotion *event)
-{
-       /* I could have perhaps set this to NULL */
-       return FALSE;
-}
-
 static void
 gtk_shruler_draw_ticks(GtkRuler *ruler)
 {
index 996b41c..cd6b024 100644 (file)
@@ -44,7 +44,7 @@
 
 #include "compose.h"
 #include "gtkstext.h"
-
+#include "gtkutils.h"
 
 /* line_arrow.xbm */
 #define line_arrow_width 6
index 8b8d034..5c04dfa 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -261,6 +261,7 @@ static gint inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
                inc_spool_account(account);
                return 1;
        }
+       return 0;
 }
 
 void inc_all_account_mail(MainWindow *mainwin, gboolean notify)
@@ -565,7 +566,6 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                /* CLAWS: perform filtering actions on dropped message */
                if (global_processing != NULL) {
                        FolderItem *processing, *inbox;
-                       Folder *folder;
                        MsgInfo *msginfo;
                        GSList *msglist, *msglist_element;
 
@@ -1114,8 +1114,6 @@ static gint inc_spool(void)
 static void inc_spool_account(PrefsAccount *account)
 {
        FolderItem *inbox;
-       FolderItem *dropfolder;
-       gint val;
 
        if (account->inbox) {
                inbox = folder_find_item_from_path(account->inbox);
@@ -1135,7 +1133,6 @@ static void inc_all_spool(void)
        if (!list) return;
 
        for (; list != NULL; list = list->next) {
-               IncSession *session;
                PrefsAccount *account = list->data;
 
                if ((account->protocol == A_LOCAL) &&
index 8c51aa6..7ad132f 100644 (file)
@@ -325,24 +325,6 @@ static gchar *ldif_get_tagvalue( gchar* line ) {
        return value;
 }
 
-/*
-* Dump linked lists of character strings (for debug).
-*/
-static void ldif_dump_lists( GSList *listName, GSList *listAddr, GSList *listRem, GSList *listID, FILE *stream ) {
-       fprintf( stream, "dump name\n" );
-       fprintf( stream, "------------\n" );
-       mgu_print_list( listName, stdout );
-       fprintf( stream, "dump address\n" );
-       fprintf( stream, "------------\n" );
-       mgu_print_list( listAddr, stdout );
-       fprintf( stream, "dump remarks\n" );
-       fprintf( stdout, "------------\n" );
-       mgu_print_list( listRem, stdout );
-       fprintf( stream, "dump id\n" );
-       fprintf( stdout, "------------\n" );
-       mgu_print_list( listID, stdout );
-}
-
 /*
 * Parsed address data.
 */
@@ -588,25 +570,6 @@ static void ldif_print_record( Ldif_ParsedRec *rec, FILE *stream ) {
 }
 #endif
 
-static void ldif_dump_b64( gchar *buf ) {
-       Base64Decoder *decoder = NULL;
-       gchar outBuf[8192];
-       gint len;
-
-       printf( "base-64 : inbuf : %s\n", buf );
-       decoder = base64_decoder_new();
-       len = base64_decoder_decode( decoder, buf, outBuf );
-       if (len < 0) {
-               printf( "base-64 : Bad BASE64 content\n" );
-       }
-       else {
-               outBuf[len] = '\0';
-               printf( "base-64 : %d : %s\n\n", len, outBuf );
-       }
-       base64_decoder_free( decoder );
-       decoder = NULL;
-}
-
 /*
 * Read file data into address cache.
 * Note that one LDIF record identifies one entity uniquely with the
index b591696..b117836 100644 (file)
@@ -58,6 +58,7 @@
 #include "prefs_common.h"
 #include "prefs_filter.h"
 #include "prefs_account.h"
+#include "prefs_actions.h"
 #include "scoring.h"
 #include "prefs_display_header.h"
 #include "account.h"
index 64decf9..2d3896d 100644 (file)
@@ -121,8 +121,6 @@ static void toolbar_inc_all_cb              (GtkWidget      *widget,
 static void toolbar_send_cb            (GtkWidget      *widget,
                                         gpointer        data);
 
-static void toolbar_compose_cb         (GtkWidget      *widget,
-                                        gpointer        data);
 static void toolbar_compose_news_cb    (GtkWidget      *widget,
                                         gpointer        data);
 static void toolbar_compose_mail_cb    (GtkWidget      *widget,
@@ -164,10 +162,6 @@ static void toolbar_exec_cb                (GtkWidget      *widget,
 static void toolbar_next_unread_cb     (GtkWidget      *widget,
                                         gpointer        data);
 
-static void toolbar_prefs_cb           (GtkWidget      *widget,
-                                        gpointer        data);
-static void toolbar_account_cb         (GtkWidget      *widget,
-                                        gpointer        data);
 
 #if 0
 static void toolbar_account_button_pressed     (GtkWidget      *widget,
@@ -272,9 +266,6 @@ static void send_queue_cb           (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
 
-static void compose_cb                 (MainWindow     *mainwin,
-                                        guint           action,
-                                        GtkWidget      *widget);
 static void compose_mail_cb(MainWindow *mainwin, guint action,
                            GtkWidget *widget);
 static void compose_news_cb(MainWindow *mainwin, guint action,
@@ -830,7 +821,6 @@ MainWindow *main_window_create(SeparateType type)
        GtkItemFactory *ifactory;
        GtkWidget *ac_menu;
        GtkWidget *menuitem;
-       GtkWidget *compose_popup;
        GtkWidget *reply_popup;
        GtkWidget *replyall_popup;
        GtkWidget *replysender_popup;
@@ -1487,7 +1477,7 @@ void main_window_add_mailbox(MainWindow *mainwin)
 
        folder_add(folder);
        folder_set_ui_func(folder, scan_tree_func, mainwin);
-       folder->scan_tree(folder);
+       folder_scan_tree(folder);
        folder_set_ui_func(folder, NULL, NULL);
 
        folderview_set(mainwin->folderview);
@@ -1581,7 +1571,7 @@ static SensitiveCond main_window_get_current_state(MainWindow *mainwin)
                /*              if (item->folder->type != F_NEWS) */
                state |= M_ALLOW_DELETE;
 
-               if (selection == SUMMARY_NONE && item->hide_read_msgs
+               if ((selection == SUMMARY_NONE && item->hide_read_msgs)
                    || selection != SUMMARY_NONE)
                        state |= M_HIDE_READ_MSG;       
        }               
@@ -2079,8 +2069,6 @@ static void main_window_toolbar_create(MainWindow *mainwin,
        GtkWidget *delete_btn;
        GtkWidget *exec_btn;
        
-       GtkTooltips *tooltips;
-
        toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,
                                  GTK_TOOLBAR_BOTH);
        gtk_container_add(GTK_CONTAINER(container), toolbar);
@@ -2318,7 +2306,6 @@ static void toolbar_reply_to_all_popup_closed_cb(GtkMenuShell *menu_shell, gpoin
 static void toolbar_reply_to_sender_popup_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
 {
        MainWindow *mainwindow = (MainWindow *) data;
-       GtkWidget *replysender_menu, *replysender_item;
 
        if (!event) return;
 
@@ -2384,17 +2371,6 @@ static void toolbar_send_cb      (GtkWidget      *widget,
        send_queue_cb(mainwin, 0, NULL);
 }
 
-static void toolbar_compose_cb (GtkWidget      *widget,
-                                gpointer        data)
-{
-       MainWindow *mainwin = (MainWindow *)data;
-
-       if (mainwin->compose_btn_type == COMPOSEBUTTON_MAIL)
-               compose_cb(mainwin, 0, NULL);
-       else
-               compose_news_cb(mainwin, 0, NULL);
-}
-
 static void toolbar_compose_news_cb    (GtkWidget      *widget,
                                 gpointer        data)
 {
@@ -2477,20 +2453,6 @@ static void toolbar_next_unread_cb       (GtkWidget      *widget,
        next_unread_cb(mainwin, 0, NULL);
 }
 
-static void toolbar_prefs_cb   (GtkWidget      *widget,
-                                gpointer        data)
-{
-       prefs_common_open();
-}
-
-static void toolbar_account_cb (GtkWidget      *widget,
-                                gpointer        data)
-{
-       MainWindow *mainwin = (MainWindow *)data;
-
-       prefs_account_open_cb(mainwin, 0, NULL);
-}
-
 #if 0
 static void toolbar_account_button_pressed(GtkWidget *widget,
                                           GdkEventButton *event,
@@ -2860,19 +2822,6 @@ static void send_queue_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
        }
 }
 
-static void compose_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
-{
-       if (mainwin->summaryview->folder_item) {
-               if (mainwin->summaryview->folder_item->folder->account != NULL
-                   && mainwin->summaryview->folder_item->folder->account->protocol == A_NNTP)
-                       compose_new_with_recipient(mainwin->summaryview->folder_item->folder->account, mainwin->summaryview->folder_item->path);
-               else
-                       compose_new_with_folderitem(mainwin->summaryview->folder_item->folder->account, mainwin->summaryview->folder_item);
-       }
-       else
-               compose_new(NULL);
-}
-
 static void compose_mail_cb(MainWindow *mainwin, guint action,
                            GtkWidget *widget)
 {
@@ -3327,8 +3276,6 @@ static void activate_compose_button (MainWindow *mainwin,
                                ToolbarStyle style,
                                ComposeButtonType type)
 {
-       SensitiveCond state = main_window_get_current_state(mainwin);
-
        if (style == TOOLBAR_NONE) 
                return;
 
index a1cc501..db29317 100644 (file)
@@ -102,7 +102,6 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, GHashTable *folder_table)
        do {
                FILE *tmp_fp;
                FolderItem *dropfolder;
-               gchar *startp, *endp, *rpath;
                gint empty_line;
                gint val;
                gboolean is_next_msg = FALSE;
index 4afbb02..47df1ce 100644 (file)
@@ -48,6 +48,7 @@
 #include "alertpanel.h"
 #include "send.h"
 #include "pgptext.h"
+#include "menu.h"
 
 static void messageview_change_view_type(MessageView   *messageview,
                                         MessageType     type);
@@ -183,7 +184,6 @@ static gint disposition_notification_queue(PrefsAccount * account,
        FolderItem *queue;
        gchar *tmp;
        FILE *fp, *src_fp;
-       GSList *cur;
        gchar buf[BUFFSIZE];
        gint num;
 
@@ -573,17 +573,6 @@ static void key_pressed(GtkWidget *widget, GdkEventKey *event,
                gtk_widget_destroy(messageview->window);
 }
 
-static void messageview_toggle_view(MessageView *messageview)
-{
-       MainWindow *mainwin = messageview->mainwin;
-       GtkItemFactory *ifactory;
-       
-       if (!mainwin) return;
-       
-       ifactory = gtk_item_factory_from_widget(mainwin->menubar);
-       menu_toggle_toggle(ifactory, "/View/Expand Summary View");
-}
-
 void messageview_toggle_view_real(MessageView *messageview)
 {
        MainWindow *mainwin = messageview->mainwin;
index 4a407d4..ba2e07e 100644 (file)
@@ -24,6 +24,7 @@
 #include <glib.h>
 #include <stdio.h>
 #include <string.h>
+#include <ctype.h>
 
 #include "mgutils.h"
 
index a01239d..4ddaef8 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
@@ -103,8 +103,7 @@ static GSList  *mh_get_uncached_msgs                (GHashTable     *msg_table,
                                                 FolderItem     *item);
 static MsgInfo *mh_parse_msg                   (const gchar    *file,
                                                 FolderItem     *item);
-static void    mh_scan_tree_recursive          (FolderItem     *item, 
-                                                GHashTable *pptable);
+static void    mh_scan_tree_recursive          (FolderItem     *item);
 
 static gboolean mh_rename_folder_func          (GNode          *node,
                                                 gpointer        data);
@@ -429,10 +428,8 @@ gint mh_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
 
 static gint mh_do_move(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
 {
-       gchar *destdir;
        gchar *srcfile;
        gchar *destfile;
-       FILE *fp;
        gint filemode = 0;
        PrefsFolderItem *prefs;
 
@@ -484,8 +481,6 @@ static gint mh_do_move(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
        g_free(destfile);
        dest->last_num++;
 
-       g_free(destdir);
-
        return dest->last_num;
 }
 
@@ -532,7 +527,6 @@ static gint mh_do_move_msgs_with_dest(Folder *folder, FolderItem *dest,
 {
        gchar *srcfile;
        gchar *destfile;
-       FILE *fp;
        GSList *cur;
        MsgInfo *msginfo;
        PrefsFolderItem *prefs;
@@ -601,7 +595,6 @@ gint mh_copy_msg(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
 {
        gchar *srcfile;
        gchar *destfile;
-       gchar *destdir;
        gint filemode = 0;
        PrefsFolderItem *prefs;
 
@@ -751,7 +744,6 @@ gint mh_copy_msgs_with_dest(Folder *folder, FolderItem *dest, GSList *msglist)
 gint mh_remove_msg(Folder *folder, FolderItem *item, gint num)
 {
        gchar *file;
-       MsgInfo *msginfo;
 
        g_return_val_if_fail(item != NULL, -1);
 
@@ -803,7 +795,6 @@ gint mh_scan_folder(Folder *folder, FolderItem *item)
        struct stat s;
        gint max = 0;
        gint num;
-       gint n_msg = 0;
 
        g_return_val_if_fail(item != NULL, -1);
 
@@ -864,15 +855,9 @@ void mh_scan_tree(Folder *folder)
 {
        FolderItem *item;
        gchar *rootpath;
-       GHashTable *pptable;
 
        g_return_if_fail(folder != NULL);
 
-       pptable = folder_persist_prefs_new(folder);
-
-       prefs_scoring_clear();
-       prefs_filtering_clear();
-       folder_tree_destroy(folder);
        item = folder_item_new(folder->name, NULL);
        item->folder = folder;
        folder->node = g_node_new(item);
@@ -885,11 +870,7 @@ void mh_scan_tree(Folder *folder)
        g_free(rootpath);
 
        mh_create_tree(folder);
-       mh_scan_tree_recursive(item, pptable);
-       
-       folder_persist_prefs_free(pptable);
-
-       prefs_matcher_read_config();
+       mh_scan_tree_recursive(item);
 }
 
 #define MAKE_DIR_IF_NOT_EXIST(dir) \
@@ -1194,7 +1175,7 @@ static gboolean mh_is_maildir(const gchar *path)
               mh_is_maildir_one(path, "tmp");
 }
 
-static void mh_scan_tree_recursive(FolderItem *item, GHashTable *pptable)
+static void mh_scan_tree_recursive(FolderItem *item)
 {
        DIR *dp;
        struct dirent *d;
@@ -1261,8 +1242,7 @@ static void mh_scan_tree_recursive(FolderItem *item, GHashTable *pptable)
                                        item->folder->trash = new_item;
                                }
                        }
-                       folder_item_restore_persist_prefs(new_item, pptable);
-                       mh_scan_tree_recursive(new_item, pptable);
+                       mh_scan_tree_recursive(new_item);
                } else if (to_number(d->d_name) != -1) n_msg++;
 
                g_free(entry);
index 2cd173a..c4fed76 100644 (file)
@@ -204,7 +204,7 @@ struct _Mutt_ParsedRec_ {
  * Free data record.
  * Enter: rec Data record.
  */
-static mutt_free_rec( Mutt_ParsedRec *rec ) {
+static void mutt_free_rec( Mutt_ParsedRec *rec ) {
        if( rec ) {
                g_free( rec->address );
                g_free( rec->name );
index b589c06..7347b83 100644 (file)
@@ -80,9 +80,6 @@ static gint news_get_article_cmd       (NNTPSession   *session,
 static gint news_get_article            (NNTPSession   *session,
                                          gint           num,
                                          gchar         *filename);
-static gint news_get_header             (NNTPSession   *session,
-                                         gint           num,
-                                         gchar         *filename);
 
 static gint news_select_group           (NNTPSession   *session,
                                          const gchar   *group,
@@ -374,9 +371,6 @@ gint news_scan_group(Folder *folder, FolderItem *item)
 {
        NNTPSession *session;
        gint num = 0, first = 0, last = 0;
-       gint new = 0, unread = 0, total = 0;
-       gint min = 0, max = 0;
-       gchar *path;
        gint ok;
 
        g_return_val_if_fail(folder != NULL, -1);
@@ -650,11 +644,6 @@ static gint news_get_article(NNTPSession *session, gint num, gchar *filename)
        return news_get_article_cmd(session, "ARTICLE", num, filename);
 }
 
-static gint news_get_header(NNTPSession *session, gint num, gchar *filename)
-{
-       return news_get_article_cmd(session, "HEAD", num, filename);
-}
-
 /**
  * news_select_group:
  * @session: Active NNTP session.
index 3435c58..184f349 100644 (file)
@@ -280,7 +280,7 @@ static int free_passphrase(gpointer _unused)
 }
 
 const char*
-gpgmegtk_passphrase_cb (void *opaque, const char *desc, void *r_hd)
+gpgmegtk_passphrase_cb (void *opaque, const char *desc, void **r_hd)
 {
     struct passphrase_cb_info_s *info = opaque;
     GpgmeCtx ctx = info ? info->c : NULL;
index 3f4b2e3..e33301d 100644 (file)
@@ -28,7 +28,7 @@ struct passphrase_cb_info_s {
 };
 
 void gpgmegtk_set_passphrase_grab (gint yesno);
-const char* gpgmegtk_passphrase_cb(void *opaque, const char *desc, void *r_hd);
+const char* gpgmegtk_passphrase_cb(void *opaque, const char *desc, void **r_hd);
 void gpgmegtk_free_passphrase();
 
 #endif /* GPGMEGTK_PASSPHRASE_H */
index dfa7617..95c4db3 100644 (file)
@@ -58,11 +58,6 @@ static char *content_names[] = {
     NULL
 };
 
-static char *mime_version_name[] = {
-    "Mime-Version",
-    NULL
-};
-
 /* stolen from rfc2015.c */
 static int
 gpg_name_cmp(const char *a, const char *b)
@@ -108,7 +103,7 @@ pgptext_decrypt (MimeInfo *partinfo, FILE *fp)
 
     if (!getenv("GPG_AGENT_INFO")) {
         info.c = ctx;
-        gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, &info);
+        gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, (void *)&info);
     } 
 
     err = gpgme_op_decrypt (ctx, cipher, plain);
@@ -158,6 +153,7 @@ headerp(char *p, char **names)
 
 MimeInfo * pgptext_find_signature (MimeInfo *mimeinfo)
 {
+       return NULL;
 }
 
 gboolean pgptext_has_signature (MimeInfo *mimeinfo)
@@ -187,23 +183,23 @@ int pgptext_is_encrypted (MimeInfo *mimeinfo, MsgInfo *msginfo)
        gchar *check_begin_pgp_msg = "-----BEGIN PGP MESSAGE-----\n";
        gchar *check_end_pgp_msg = "-----END PGP MESSAGE-----\n";
        
-       g_return_if_fail(msginfo != NULL);
+       g_return_val_if_fail(msginfo != NULL, 0);
        
        if (!mimeinfo)
                return 0;
        
-       if ((fp = procmsg_open_message(msginfo)) == NULL) return;
+       if ((fp = procmsg_open_message(msginfo)) == NULL) return 0;
        mimeinfo = procmime_scan_mime_header(fp);
        fclose(fp);
-       if (!mimeinfo) return;
+       if (!mimeinfo) return 0;
 
        file = procmsg_get_message_file_path(msginfo);
-       g_return_if_fail(file != NULL);
+       g_return_val_if_fail(file != NULL, 0);
 
        if (mimeinfo->mime_type != MIME_TEXT) {
                if ((fp = fopen(file, "rb")) == NULL) {
                        FILE_OP_ERROR(file, "fopen");
-                       return;
+                       return 0;
                }
                /* skip headers */
                if (mimeinfo->mime_type == MIME_MULTIPART) {
@@ -228,7 +224,7 @@ int pgptext_is_encrypted (MimeInfo *mimeinfo, MsgInfo *msginfo)
        } else {
                if ((fp = fopen(file, "rb")) == NULL) {
                        FILE_OP_ERROR(file, "fopen");
-                       return;
+                       return 0;
                }
                /* skip headers */
                if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0)
@@ -264,8 +260,6 @@ void pgptext_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp)
 {
     static int id;
     MimeInfo *partinfo;
-    int n, found;
-    int ver_okay=0;
     char *fname;
     GpgmeData plain;
     FILE *dstfp;
@@ -342,10 +336,12 @@ void pgptext_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp)
 
 int pgptext_encrypt (const char *file, GSList *recp_list)
 {
+       return 0;
 }
 
 int pgptext_sign (const char *file, PrefsAccount *ac)
 {
+       return 0;
 }
 
 #endif /* USE_GPGME */
index 701f8e3..3ec581a 100644 (file)
@@ -208,7 +208,7 @@ struct _Pine_ParsedRec_ {
  * Free data record.
  * Enter: rec Data record.
  */
-static pine_free_rec( Pine_ParsedRec *rec ) {
+static void pine_free_rec( Pine_ParsedRec *rec ) {
        if( rec ) {
                g_free( rec->nickName );
                g_free( rec->name );
@@ -229,20 +229,6 @@ static pine_free_rec( Pine_ParsedRec *rec ) {
        }
 }
 
-/*
- * Print data record.
- * Enter: rec    Data record.
- *        stream File.
- */
-static void pine_print_rec( Pine_ParsedRec *rec, FILE *stream ) {
-       fprintf( stream, "nick :%s:\n", rec->nickName );
-       fprintf( stream, "name :%s:\n", rec->name );
-       fprintf( stream, "addr :%s:\n", rec->address );
-       fprintf( stream, "fcc  :%s:\n", rec->fcc );
-       fprintf( stream, "comm :%s:\n", rec->comments );
-       fprintf( stream, "group:%s:\n", rec->isGroup ? "yes" : "no" );
-}
-
 /*
  * Clean name.
  */
@@ -423,7 +409,7 @@ static void pine_parse_address( PineFile *pineFile, AddressCache *cache, Pine_Pa
        gint len;
 
        buf = rec->address;
-       while( atCh = strchr( buf, CHAR_AT ) ) {
+       while((atCh = strchr( buf, CHAR_AT )) != NULL) {
                name = pine_parse_name( buf, atCh, &bp, &ep );
                len = ( size_t ) ( ep - bp );
                strncpy( addr, bp, len );
index 716f8d7..6b16648 100644 (file)
@@ -1063,7 +1063,6 @@ static void prefs_account_receive_create(void)
        GtkWidget *sd_filter_on_recv_chkbtn;
        GtkWidget *sd_rmmail_chkbtn;
        GtkWidget *vbox3;
-       GtkWidget *hbox2;
        GtkWidget *inbox_label;
        GtkWidget *inbox_entry;
        GtkWidget *inbox_btn;
@@ -1781,9 +1780,6 @@ static void prefs_account_advanced_create(void)
        GtkWidget *checkbtn_crosspost;
        GtkWidget *colormenu_crosspost;
        GtkWidget *menu;
-       GtkWidget *menuitem;
-       GtkWidget *item;
-       gint i;
        GtkWidget *imap_frame;
        GtkWidget *imapdir_label;
        GtkWidget *imapdir_entry;
@@ -2222,8 +2218,6 @@ static void prefs_account_smtp_auth_type_set_optmenu(PrefParam *pparam)
 static void prefs_account_protocol_activated(GtkMenuItem *menuitem)
 {
        RecvProtocol protocol;
-       gboolean active;
-       gint auth;
 
        protocol = GPOINTER_TO_INT
                (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
@@ -2521,19 +2515,3 @@ static void prefs_account_mailcmd_toggled(GtkToggleButton *button,
        gtk_widget_set_sensitive(basic.uid_entry,  !use_mailcmd);
        gtk_widget_set_sensitive(basic.pass_entry, !use_mailcmd);
 }
-
-static void prefs_account_smtp_userid_cb(GtkEditable *editable,
-                                        gpointer smtp_passwd)
-{
-       gchar *buf;
-       gboolean use_smtp_userid;
-       
-       buf = gtk_editable_get_chars(editable, 0, -1);
-       if(buf[0] == '\0') {
-               use_smtp_userid = FALSE;
-       } else {
-               use_smtp_userid = TRUE;
-       }
-       gtk_widget_set_sensitive(GTK_WIDGET(smtp_passwd), use_smtp_userid);
-       g_free(buf);
-}
index 1dfc699..c918f65 100644 (file)
@@ -1123,10 +1123,10 @@ static gboolean execute_actions(gchar     *action,
                                GtkWidget *text,
                                MimeView  *mimeview)
 {
-       GList *cur, *selection;
+       GList *cur, *selection = NULL;
        GSList *children_list = NULL;
        gint is_ok  = TRUE;
-       gint selection_len;
+       gint selection_len = 0;
        Children *children;
        ChildInfo *child_info;
        gint action_type;
@@ -1600,8 +1600,8 @@ static void update_io_dialog(Children *children)
 static void create_io_dialog(Children *children)
 {
        GtkWidget *dialog;
-       GtkWidget *entry;
-       GtkWidget *input_hbox;
+       GtkWidget *entry = NULL;
+       GtkWidget *input_hbox = NULL;
        GtkWidget *send_button;
        GtkWidget *label;
        GtkWidget *text;
index 56a322f..6631820 100644 (file)
@@ -1690,10 +1690,7 @@ static void prefs_compose_create(void)
 {
        GtkWidget *vbox1;
        GtkWidget *vbox2;
-       GtkWidget *vbox3;
        GtkWidget *hbox1;
-       GtkWidget *hbox2;
-       GtkWidget *btn_quotefmt;
 
        GtkWidget *frame_sig;
        GtkWidget *vbox_sig;
@@ -1701,13 +1698,10 @@ static void prefs_compose_create(void)
        GtkWidget *label_sigsep;
        GtkWidget *entry_sigsep;
 
-       GtkWidget *frame_editor;
-       GtkWidget *hbox_editor;
        GtkWidget *checkbtn_autoextedit;
 
        GtkWidget *frame_autosel;
        GtkWidget *hbox_autosel;
-       GtkWidget *vbox_autosel;
        GtkWidget *checkbtn_reply_account_autosel;
        GtkWidget *checkbtn_forward_account_autosel;
        GtkWidget *checkbtn_reedit_account_autosel;
@@ -1729,8 +1723,6 @@ static void prefs_compose_create(void)
        GtkWidget *checkbtn_autowrap;
        GtkWidget *checkbtn_wrapatsend;
 
-       GtkWidget *frame_reply;
-       GtkWidget *checkbtn_quote;
        GtkWidget *checkbtn_forward_as_attachment;
        GtkWidget *checkbtn_redirect_keep_from;
        GtkWidget *checkbtn_smart_wrapping;
@@ -4198,37 +4190,6 @@ static void prefs_common_cancel(void)
 }
 
 
-static struct _ComposePrefs
-{
-       GtkWidget *window;
-
-       GtkWidget *close_btn;
-} composeprefs;
-
-static void compose_prefs_key_pressed(GtkWidget *widget, GdkEventKey *event);
-static gint compose_prefs_delete_event(GtkWidget *widget, GdkEventAny *event);
-static void compose_prefs_close(GtkWidget *widget);
-static void compose_prefs_fmt_create(void);
-
-static void compose_prefs_close(GtkWidget *widget)
-{
-       gtk_widget_hide(composeprefs.window);
-}
-
-static gint compose_prefs_delete_event(GtkWidget *widget, GdkEventAny *event)
-{
-       gtk_widget_hide(composeprefs.window);
-
-       return TRUE;
-}
-
-static void compose_prefs_key_pressed(GtkWidget *widget, GdkEventKey *event)
-{
-       if (event && event->keyval == GDK_Escape) {
-               gtk_widget_hide(composeprefs.window);
-       }
-}
-
 /* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
 {
        GtkWidget *menu;
index 733ca89..bdcd0ac 100644 (file)
@@ -316,7 +316,6 @@ static void prefs_filtering_create(void)
        GtkWidget *up_btn;
        GtkWidget *down_btn;
 
-       GtkWidget *dummy;
 
        GList *combo_items;
        gint i;
@@ -759,7 +758,6 @@ static void prefs_filtering_set_list(void)
        FilteringProp *prop;
        GSList * cur;
        gchar * filtering_str;
-       gchar * tmp;
        GSList * prefs_filtering;
 
        if (cur_item == NULL)
@@ -839,9 +837,6 @@ static void prefs_filtering_condition_define(void)
        cond_str = gtk_entry_get_text(GTK_ENTRY(filtering.cond_entry));
 
        if (*cond_str != '\0') {
-               gchar * tmp;
-               
-               /* tmp = cond_str; */
                matchers = matcher_parser_get_cond(cond_str);
                if (matchers == NULL)
                        alertpanel_error(_("Match string is not valid."));
@@ -863,13 +858,12 @@ static FilteringProp * prefs_filtering_dialog_to_filtering(void)
        gchar * cond_str;
        FilteringProp * prop;
        FilteringAction * action;
-       gchar * tmp;
        gint list_id;
        gint action_id;
        gint action_type;
        gint account_id;
        gchar * destination;
-       gint labelcolor;
+       gint labelcolor = 0;
        
        cond_str = gtk_entry_get_text(GTK_ENTRY(filtering.cond_entry));
        if (*cond_str == '\0') {
@@ -1104,7 +1098,6 @@ static void prefs_filtering_select(GtkCList *clist, gint row, gint column,
                                GdkEvent *event)
 {
        FilteringProp * prop;
-       gchar * tmp;
        gchar * filtering_str;
 
        if (row == 0) {
index bb5a436..614ca38 100644 (file)
@@ -37,6 +37,8 @@
 #include "manage_window.h"
 #include "utils.h"
 #include "addr_compl.h"
+#include "prefs_scoring.h"
+#include "gtkutils.h"
 
 PrefsFolderItem tmp_prefs;
 
index 20de312..91599d5 100644 (file)
@@ -675,7 +675,6 @@ static MatcherList * prefs_matcher_get_list(void)
        gchar * matcher_str;
        MatcherProp * prop;
        gint row = 1;
-       gchar * tmp;
        gboolean bool_and;
        GSList * matcher_list;
        MatcherList * matchers;
@@ -1136,7 +1135,6 @@ static void prefs_matcher_select(GtkCList *clist, gint row, gint column,
                                 GdkEvent *event)
 {
        gchar * matcher_str;
-       gchar * tmp;
        MatcherProp * prop;
        gboolean negative_cond;
        gint criteria;
index ff9005e..0748993 100644 (file)
@@ -435,7 +435,6 @@ static void prefs_scoring_set_list(void)
        ScoringProp *prop;
        GSList * cur;
        gchar * scoring_str;
-       gchar * tmp;
        GSList * prefs_scoring;
 
        if (cur_item == NULL)
@@ -524,8 +523,6 @@ static void prefs_scoring_condition_define(void)
        cond_str = gtk_entry_get_text(GTK_ENTRY(scoring.cond_entry));
 
        if (*cond_str != '\0') {
-               gchar * tmp;
-               
                matchers = matcher_parser_get_cond(cond_str);
                if (matchers == NULL)
                        alertpanel_error(_("Match string is not valid."));
@@ -547,7 +544,6 @@ static void prefs_scoring_register_cb(void)
        gchar * score_str;
        ScoringProp * prop;
        gint score;
-       gchar * tmp;
 
        cond_str = gtk_entry_get_text(GTK_ENTRY(scoring.cond_entry));
        if (*cond_str == '\0') {
@@ -587,7 +583,6 @@ static void prefs_scoring_substitute_cb(void)
        gchar * score_str;
        ScoringProp * prop;
        gint score;
-       gchar * tmp;
 
        if (!clist->selection) return;
 
@@ -698,7 +693,6 @@ static void prefs_scoring_select(GtkCList *clist, gint row, gint column,
                                GdkEvent *event)
 {
        ScoringProp * prop;
-       gchar * tmp;
 
        gchar * scoring_str;
 
index aae2381..bfcfc7a 100644 (file)
@@ -204,15 +204,14 @@ GSList *procheader_get_header_list_from_file(const gchar *file)
 
 GSList *procheader_get_header_list(FILE *fp)
 {
-       gchar buf[BUFFSIZE], tmp[BUFFSIZE];
-       gchar *p;
+       gchar buf[BUFFSIZE];
        GSList *hlist = NULL;
        Header *header;
 
        g_return_val_if_fail(fp != NULL, NULL);
 
        while (procheader_get_unfolded_line(buf, sizeof(buf), fp) != NULL) {
-               if (header = procheader_parse_header(buf))
+               if ((header = procheader_parse_header(buf)) != NULL)
                        hlist = g_slist_append(hlist, header);
                /*
                if (*buf == ':') continue;
@@ -237,8 +236,7 @@ GSList *procheader_get_header_list(FILE *fp)
 
 GPtrArray *procheader_get_header_array(FILE *fp)
 {
-       gchar buf[BUFFSIZE], tmp[BUFFSIZE];
-       gchar *p;
+       gchar buf[BUFFSIZE];
        GPtrArray *headers;
        Header *header;
 
@@ -247,7 +245,7 @@ GPtrArray *procheader_get_header_array(FILE *fp)
        headers = g_ptr_array_new();
 
        while (procheader_get_unfolded_line(buf, sizeof(buf), fp) != NULL) {
-               if (header = procheader_parse_header(buf))
+               if ((header = procheader_parse_header(buf)) != NULL)
                        g_ptr_array_add(headers, header);
                /*
                if (*buf == ':') continue;
@@ -272,8 +270,7 @@ GPtrArray *procheader_get_header_array(FILE *fp)
 
 GPtrArray *procheader_get_header_array_asis(FILE *fp)
 {
-       gchar buf[BUFFSIZE], tmp[BUFFSIZE];
-       gchar *p;
+       gchar buf[BUFFSIZE];
        GPtrArray *headers;
        Header *header;
 
@@ -282,7 +279,7 @@ GPtrArray *procheader_get_header_array_asis(FILE *fp)
        headers = g_ptr_array_new();
 
        while (procheader_get_one_field(buf, sizeof(buf), fp, NULL) != -1) {
-               if (header = procheader_parse_header(buf))
+               if ((header = procheader_parse_header(buf)) != NULL)
                        g_ptr_array_add(headers, header);
                        /*
                if (*buf == ':') continue;
@@ -752,7 +749,6 @@ gboolean procheader_date_parse_to_tm(const gchar *src, struct tm *t, char *zone)
        gint hh, mm, ss;
        GDateMonth dmonth;
        gchar *p;
-       time_t timer;
 
        if (!t)
                return FALSE;
@@ -868,25 +864,27 @@ void procheader_date_get_localtime(gchar *dest, gint len, const time_t timer)
 
 gint get_header_from_msginfo(MsgInfo *msginfo, gchar *buf, gint len,gchar *header)
 {
-       gchar *file;
-       FILE *fp;
-       HeaderEntry hentry[]={{header,NULL,TRUE},
-                                    {NULL,NULL,FALSE}};
-       gint val;
-       g_return_if_fail(msginfo != NULL);
-       file = procmsg_get_message_file_path(msginfo);
-       if ((fp = fopen(file, "rb")) == NULL) {
+       gchar *file;
+       FILE *fp;
+       HeaderEntry hentry[]={{header,NULL,TRUE},
+                              {NULL,NULL,FALSE}};
+       gint val;
+       
+       g_return_val_if_fail(msginfo != NULL, -1);
+       file = procmsg_get_message_file_path(msginfo);
+       if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                g_free(file);
-               return;
-        }
-       val=procheader_get_one_field(buf,len, fp, hentry);
-       if (fclose(fp) == EOF) {
+               return -1;
+       }
+       val=procheader_get_one_field(buf,len, fp, hentry);
+       if (fclose(fp) == EOF) {
                FILE_OP_ERROR(file, "fclose");
                unlink(file);
                return -1;
        }
-       if (val == -1)
-          return -1;
-       return 0;
+        if (val == -1)
+               return -1;
+
+       return 0;
 }
index f0038bc..cc6d41a 100644 (file)
@@ -480,7 +480,6 @@ void procmime_scan_content_disposition(MimeInfo *mimeinfo,
 void procmime_scan_content_description(MimeInfo *mimeinfo,
                                       const gchar *content_description)
 {
-       gchar *delim, *p, *dispos;
        gchar *buf;
 
        gchar *tmp;
@@ -505,7 +504,6 @@ void procmime_scan_content_description(MimeInfo *mimeinfo,
 void procmime_scan_subject(MimeInfo *mimeinfo,
                           const gchar *subject)
 {
-       gchar *delim, *p, *dispos;
        gchar *buf;
 
        gchar *tmp;
@@ -788,7 +786,6 @@ void renderer_read_config(void)
 
 void renderer_write_config(void)
 {
-       int i;
        gchar * rcpath;
        PrefFile *pfile;
        GList * cur;
@@ -823,7 +820,6 @@ FILE *procmime_get_text_content(MimeInfo *mimeinfo, FILE *infp)
        gboolean conv_fail = FALSE;
        gchar buf[BUFFSIZE];
        gchar *str;
-       int i;
        struct ContentRenderer * renderer;
        GList * cur;
 
index 2973bbb..16a0f23 100644 (file)
@@ -39,6 +39,7 @@
 #endif
 #include "alertpanel.h"
 #include "news.h"
+#include "imap.h"
 
 typedef struct _FlagInfo       FlagInfo;
 
@@ -48,15 +49,8 @@ struct _FlagInfo
        MsgFlags flags;
 };
 
-static void mark_sum_func                      (gpointer        key,
-                                                gpointer        value,
-                                                gpointer        data);
-
 static GHashTable *procmsg_read_mark_file      (const gchar    *folder);
-static gint procmsg_cmp_msgnum                 (gconstpointer   a,
-                                                gconstpointer   b);
-static gint procmsg_cmp_flag_msgnum            (gconstpointer   a,
-                                                gconstpointer   b);
+void   procmsg_msginfo_write_flags             (MsgInfo        *msginfo);
 
 
 GHashTable *procmsg_msg_hash_table_create(GSList *mlist)
@@ -462,51 +456,6 @@ struct MarkSum {
        gint first;
 };
 
-static void mark_sum_func(gpointer key, gpointer value, gpointer data)
-{
-       MsgFlags *flags = value;
-       gint num = GPOINTER_TO_INT(key);
-       struct MarkSum *marksum = data;
-
-       if (marksum->first <= num) {
-               if (MSG_IS_NEW(*flags) && !MSG_IS_IGNORE_THREAD(*flags)) (*marksum->new)++;
-               if (MSG_IS_UNREAD(*flags) && !MSG_IS_IGNORE_THREAD(*flags)) (*marksum->unread)++;
-               if (num > *marksum->max) *marksum->max = num;
-               if (num < *marksum->min || *marksum->min == 0) *marksum->min = num;
-               (*marksum->total)++;
-       }
-
-       g_free(flags);
-}
-
-#if 0 /* NEW CACHE DOES NOT ALLOW ACCESS TO THE MARK FILE */
-void procmsg_get_mark_sum(const gchar *folder,
-                         gint *new, gint *unread, gint *total,
-                         gint *min, gint *max,
-                         gint first)
-{
-       GHashTable *mark_table;
-       struct MarkSum marksum;
-
-       *new = *unread = *total = *min = *max = 0;
-       marksum.new    = new;
-       marksum.unread = unread;
-       marksum.total  = total;
-       marksum.min    = min;
-       marksum.max    = max;
-       marksum.first  = first;
-
-       mark_table = procmsg_read_mark_file(folder);
-
-       if (mark_table) {
-               g_hash_table_foreach(mark_table, mark_sum_func, &marksum);
-               g_hash_table_destroy(mark_table);
-       }
-       debug_print("mark->new = %d, mark->unread = %d, mark->total = %d\n",
-                   *(marksum.new), *(marksum.unread), *(marksum.total));
-}
-#endif
-
 static GHashTable *procmsg_read_mark_file(const gchar *folder)
 {
        FILE *fp;
@@ -695,7 +644,6 @@ void procmsg_move_messages(GSList *mlist)
        GSList *cur, *movelist = NULL;
        MsgInfo *msginfo;
        FolderItem *dest = NULL;
-       GHashTable *hash;
 
        if (!mlist) return;
 
@@ -726,7 +674,6 @@ void procmsg_copy_messages(GSList *mlist)
        GSList *cur, *copylist = NULL;
        MsgInfo *msginfo;
        FolderItem *dest = NULL;
-       GHashTable *hash;
 
        if (!mlist) return;
 
@@ -901,7 +848,6 @@ void procmsg_empty_trash(void)
 
 gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
 {
-       gint i;
        gint ret = 0;
        GSList *list, *elem;
 
@@ -952,7 +898,6 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file,
 {
        gint num;
        FILE *fp;
-       MsgFlags flag = {0, 0};
        MsgInfo *msginfo;
 
        debug_print(_("saving sent message...\n"));
@@ -1192,17 +1137,6 @@ guint procmsg_msginfo_memusage(MsgInfo *msginfo)
        return memusage;
 }
 
-static gint procmsg_cmp_msgnum(gconstpointer a, gconstpointer b)
-{
-       const MsgInfo *msginfo = a;
-       const guint msgnum = GPOINTER_TO_UINT(b);
-
-       if (!msginfo)
-               return -1;
-
-       return msginfo->msgnum - msgnum;
-}
-
 gint procmsg_cmp_msgnum_for_sort(gconstpointer a, gconstpointer b)
 {
        const MsgInfo *msginfo1 = a;
@@ -1216,17 +1150,6 @@ gint procmsg_cmp_msgnum_for_sort(gconstpointer a, gconstpointer b)
        return msginfo1->msgnum - msginfo2->msgnum;
 }
 
-static gint procmsg_cmp_flag_msgnum(gconstpointer a, gconstpointer b)
-{
-       const FlagInfo *finfo = a;
-       const guint msgnum = GPOINTER_TO_UINT(b);
-
-       if (!finfo)
-               return -1;
-
-       return finfo->msgnum - msgnum;
-}
-
 enum
 {
        Q_SENDER           = 0,
index ccbb955..8d2798a 100644 (file)
@@ -68,7 +68,7 @@ void setup(MainWindow *mainwin)
 
        folder_add(folder);
        folder_set_ui_func(folder, scan_tree_func, mainwin);
-       folder->scan_tree(folder);
+       folder_scan_tree(folder);
        folder_set_ui_func(folder, NULL, NULL);
 }
 
index 52e5066..0a8cfe6 100644 (file)
@@ -22,6 +22,8 @@
 #  include "config.h"
 #endif
 
+#include <string.h>
+
 #include "intl.h"
 #include "string_match.h"
 
index 0043ce8..37b255f 100644 (file)
@@ -62,6 +62,7 @@
 #include "prefs_common.h"
 #include "prefs_summary_column.h"
 #include "prefs_filter.h"
+#include "prefs_filtering.h"
 #include "account.h"
 #include "compose.h"
 #include "utils.h"
@@ -376,7 +377,6 @@ static gint summary_cmp_by_label    (GtkCList               *clist,
                                         gconstpointer           ptr1,
                                         gconstpointer           ptr2);
 
-static void news_process_crossposted   (MsgInfo *msginfo);
 static void news_flag_crosspost                (MsgInfo *msginfo);
 
 GtkTargetEntry summary_drag_types[1] =
@@ -692,9 +692,6 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
        guint displayed_msgnum = 0;
        GtkCTreeNode *selected_node = summaryview->folderview->selected;
        GSList *cur;
-       gint sort_mode;
-       gint sort_type;
-        static gboolean locked = FALSE;
 
        if (summary_is_locked(summaryview)) return FALSE;
 
@@ -815,7 +812,6 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
        if (summaryview->folder_item->hide_read_msgs) {
                GSList *not_killed;
-               gint kill_score;
                
                summary_set_hide_read_msgs_menu(summaryview, TRUE);
                not_killed = NULL;
@@ -904,7 +900,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                }
        } else {
                /* select first unread message */
-               if (sort_mode == SORT_BY_SCORE)
+               if (item->sort_key == SORT_BY_SCORE)
                        node = summary_find_next_important_score(summaryview,
                                                                 NULL);
                else
@@ -1128,7 +1124,7 @@ void summary_select_prev_unread(SummaryView *summaryview)
                (summaryview, summaryview->selected, MSG_UNREAD, FALSE);
 
        if (!node) {
-               AlertValue val;
+               AlertValue val = 0;
 
                switch (prefs_common.next_unread_msg_dialog) {
                        case NEXTUNREADMSGDIALOG_ALWAYS:
@@ -1172,7 +1168,7 @@ void summary_select_next_unread(SummaryView *summaryview)
                node = summary_find_next_flagged_msg
                        (summaryview, NULL, MSG_UNREAD, FALSE);
                if (node == NULL) {
-                       AlertValue val;
+                       AlertValue val = 0;
 
                        switch (prefs_common.next_unread_msg_dialog) {
                                case NEXTUNREADMSGDIALOG_ALWAYS:
@@ -2000,14 +1996,11 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        MsgInfo *msginfo;
-       MsgInfo *parentinfo;
-       MsgInfo *cur_msginfo;
-       GtkCTreeNode *node = NULL;
+               GtkCTreeNode *node = NULL;
        GHashTable *msgid_table;
        GHashTable *subject_table;
        GSList * cur;
-       GtkCTreeNode *cur_parent;
-
+       
        if (!mlist) return;
 
        debug_print(_("\tSetting summary from message data..."));
@@ -2244,8 +2237,6 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
 {
        static gchar date_modified[80];
        static gchar *to = NULL;
-       static gchar *from_name = NULL;
-       static gchar col_number[11];
        static gchar col_score[11];
        static gchar buf[BUFFSIZE];
        PrefsFolderItem *prefs = summaryview->folder_item->prefs;
@@ -3743,7 +3734,6 @@ void summary_processing(SummaryView *summaryview, GSList * mlist)
        GSList * processing_list;
        FolderItem * folder_item;
        GSList * cur;
-       gchar * id;
        gchar * buf;
 
        folder_item = summaryview->folder_item;
@@ -4035,7 +4025,6 @@ void summary_filter_open(SummaryView *summaryview, PrefsFilterType type)
 
 void summary_reply(SummaryView *summaryview, ComposeMode mode)
 {
-       GtkWidget *widget;
        GList *sel = GTK_CLIST(summaryview->ctree)->selection;
        MsgInfo *msginfo;
        gchar *text;
@@ -4085,10 +4074,10 @@ void summary_reply(SummaryView *summaryview, ComposeMode mode)
                break;
        case COMPOSE_FORWARD:
                if (prefs_common.forward_as_attachment) {
-                       summary_reply_cb(summaryview, COMPOSE_FORWARD_AS_ATTACH, widget);
+                       summary_reply_cb(summaryview, COMPOSE_FORWARD_AS_ATTACH, NULL);
                        return;
                } else {
-                       summary_reply_cb(summaryview, COMPOSE_FORWARD_INLINE, widget);
+                       summary_reply_cb(summaryview, COMPOSE_FORWARD_INLINE, NULL);
                        return;
                }
                break;
@@ -4938,7 +4927,6 @@ static void news_flag_crosspost(MsgInfo *msginfo)
        GString *line;
        gpointer key;
        gpointer value;
-       MsgPermFlags flags;
        Folder *mff = msginfo->folder->folder;
 
        if (mff->account->mark_crosspost_read && MSG_IS_NEWS(msginfo->flags)) {
@@ -4947,10 +4935,10 @@ static void news_flag_crosspost(MsgInfo *msginfo)
                debug_print(_("nfcp: checking <%s>"), line->str);
                if (mff->newsart && 
                    g_hash_table_lookup_extended(mff->newsart, line->str, &key, &value)) {
-                       debug_print(_(" <%s>"), value);
+                       debug_print(_(" <%s>"), (gchar *)value);
                        if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
-                               MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_NEW | MSG_UNREAD);
-                               MSG_SET_COLORLABEL_VALUE(msginfo->flags, mff->account->crosspost_col);
+                               procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
+                               procmsg_msginfo_set_flags(msginfo, mff->account->crosspost_col, 0);
                        }
                        g_hash_table_remove(mff->newsart, key);
                        g_free(key);
@@ -4960,41 +4948,6 @@ static void news_flag_crosspost(MsgInfo *msginfo)
        }
 }
 
-static void news_process_crossposted(MsgInfo *msginfo)
-{
-       gchar **crossref;
-       gchar **crp;
-       gchar *cp;
-       gint cnt;
-       static char *read = "read";
-       Folder *mff = msginfo->folder->folder;
-
-       /* Get the Xref: line */
-       if (msginfo->xref) {
-               /* Retrieve the cross-posted groups and message ids */
-               /* Format of Xref is Xref: server message:id message:id ... */
-               crossref = g_strsplit(msginfo->xref, " ", 1024);
-               for (crp = crossref+2, cnt = 0; *crp; crp++, cnt++) {
-                       if ((cp = strchr(*crp, ':'))) {
-                               *cp = '\0';
-                               if (!strcmp(*crp, msginfo->folder->path)) continue;
-                               *cp = ':';
-
-                               /* On first pass, create a GHashTable to hold the list of
-                                * article numbers per newsgroup that have been read. */
-                               if (!mff->newsart) {
-                                       mff->newsart = g_hash_table_new(g_str_hash, g_str_equal);
-                               }
-                               /* When a summary is selected, the articles for that
-                                * newsgroup are marked based on this entry */
-                               g_hash_table_insert(mff->newsart, g_strdup(*crp), read);
-                               debug_print(_("Cross-reference %d: Hash <%s>\n"), cnt, *crp);
-                       }
-               }
-               g_strfreev(crossref);
-       }
-}
-
 static gint summary_cmp_by_score(GtkCList *clist,
                                 gconstpointer ptr1, gconstpointer ptr2)
 {
@@ -5022,13 +4975,11 @@ static gint summary_cmp_by_locked(GtkCList *clist,
 
 static void summary_select_thread_func(GtkCTree *ctree, GtkCTreeNode *row, gpointer data)
 {
-       SummaryView *summaryview = (SummaryView *) data;
        MsgInfo *msginfo;
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
        gtk_ctree_select(GTK_CTREE(ctree), row);        
-       debug_print(_("Message %d selected\n"),
-           msginfo->msgnum);
+       debug_print(_("Message %d selected\n"), msginfo->msgnum);
 }
 
 /* select current thread */
@@ -5230,24 +5181,22 @@ static void summaryview_subject_filter_init(PrefsFolderItem *prefs)
 
 void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview)
 {
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
-       GtkCList *clist = GTK_CLIST(summaryview->ctree);
-       GtkCTreeNode *node;
+       GtkWidget *ctree = summaryview->ctree;
        GtkWidget *pixmap; 
 
        gtk_widget_destroy(summaryview->folder_pixmap);
 
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_MARK, &markxpm, &markxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_DELETED, &deletedxpm, &deletedxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_NEW, &newxpm, &newxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_UNREAD, &unreadxpm, &unreadxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_REPLIED, &repliedxpm, &repliedxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_FORWARDED, &forwardedxpm, &forwardedxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_CLIP, &clipxpm, &clipxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_LOCKED, &lockedxpm, &lockedxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_IGNORETHREAD, &ignorethreadxpm, &ignorethreadxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_CLIP_KEY, &clipkeyxpm, &clipkeyxpmmask);
-       stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_KEY, &keyxpm, &keyxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_MARK, &markxpm, &markxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_DELETED, &deletedxpm, &deletedxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_NEW, &newxpm, &newxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_UNREAD, &unreadxpm, &unreadxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_REPLIED, &repliedxpm, &repliedxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_FORWARDED, &forwardedxpm, &forwardedxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_CLIP, &clipxpm, &clipxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_LOCKED, &lockedxpm, &lockedxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_IGNORETHREAD, &ignorethreadxpm, &ignorethreadxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_CLIP_KEY, &clipkeyxpm, &clipkeyxpmmask);
+       stock_pixmap_gdk(ctree, STOCK_PIXMAP_KEY, &keyxpm, &keyxpmmask);
 
        pixmap = stock_pixmap_widget(summaryview->hbox, STOCK_PIXMAP_DIR_OPEN);
        gtk_box_pack_start(GTK_BOX(summaryview->hbox), pixmap, FALSE, FALSE, 4);
index df92f55..08faebc 100644 (file)
@@ -657,7 +657,6 @@ static void textview_show_ertf(TextView *textview, FILE *fp,
 {
        ERTFParser *parser;
        gchar *str;
-       gchar* url = NULL;
 
        parser = ertf_parser_new(fp, conv);
        g_return_if_fail(parser != NULL);
@@ -1684,7 +1683,10 @@ static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
        return TRUE;
 }
 
-static gint show_url_timeout_cb(TextView    *textview ){
+static gint show_url_timeout_cb(gpointer data)
+{
+       TextView *textview = (TextView *)data;
+       
        if (textview->messageview->mainwin)
                if (textview->show_url_msgid)
                        gtk_statusbar_remove(GTK_STATUSBAR(
@@ -1747,7 +1749,6 @@ static gint textview_button_released(GtkWidget *widget, GdkEventButton *event,
                                if (!g_strncasecmp(uri->uri, "mailto:", 7)) {
                                        if (event->button == 3) {
                                                gchar *fromname, *fromaddress;
-                                               GdkEventButton tmpev;   
                                                
                                                /* extract url */
                                                fromaddress = g_strdup(uri->uri + 7);
index 43d71a7..55a8bed 100644 (file)
@@ -347,24 +347,6 @@ static gchar *vcard_get_tagvalue( gchar* line, gchar dlm ) {
        return value;
 }
 
-/*
-* Dump linked lists of character strings (for debug).
-*/
-static void vcard_dump_lists( GSList *listName, GSList *listAddr, GSList *listRem, GSList *listID, FILE *stream ) {
-       fprintf( stream, "dump name\n" );
-       fprintf( stream, "------------\n" );
-       mgu_print_list( listName, stdout );
-       fprintf( stream, "dump address\n" );
-       fprintf( stream, "------------\n" );
-       mgu_print_list( listAddr, stdout );
-       fprintf( stream, "dump remarks\n" );
-       fprintf( stdout, "------------\n" );
-       mgu_print_list( listRem, stdout );
-       fprintf( stream, "dump id\n" );
-       fprintf( stdout, "------------\n" );
-       mgu_print_list( listID, stdout );
-}
-
 /*
 * Build an address list entry and append to list of address items.
 */
index 07faa41..b3d3014 100644 (file)
@@ -198,7 +198,7 @@ gint xmlprops_save_file( XmlProperty *props ) {
 static void xmlprops_print_vis( gpointer key, gpointer value, gpointer data ) {
        FILE *stream = ( FILE * ) data;
 
-       fprintf( stream, "-\tname/value:\t%s / %s\n", key, value );
+       fprintf( stream, "-\tname/value:\t%s / %s\n", (char *)key, (char *)value );
 }
 
 void xmlprops_print( XmlProperty *props, FILE *stream ) {
@@ -292,7 +292,7 @@ gint xmlprops_load_file( XmlProperty *props ) {
 void xmlprops_set_property(
                XmlProperty *props, const gchar *name, const gchar *value )
 {
-       gchar *key;
+       gchar *key = NULL;
        gchar *val;
 
        g_return_if_fail( props != NULL );
@@ -388,7 +388,6 @@ void xmlprops_get_property_s(
 gint xmlprops_get_property_i( XmlProperty *props, const gchar *name ) {
        gchar *val;
        gchar *endptr;
-       gchar buffer[32];
        gint value;
 
        value = 0;