2006-12-26 [colin] 2.6.1cvs76
authorColin Leroy <colin@colino.net>
Tue, 26 Dec 2006 22:37:41 +0000 (22:37 +0000)
committerColin Leroy <colin@colino.net>
Tue, 26 Dec 2006 22:37:41 +0000 (22:37 +0000)
* src/folder.c
* src/folderview.c
* src/imap.c
* src/statusbar.c
* src/etpan/imap-thread.c
Fix previous commit warnings
Make statusbar update every second if total < 20
Make IMAP APPEND faster by simplifying log

ChangeLog
PATCHSETS
configure.ac
src/etpan/imap-thread.c
src/folder.c
src/folderview.c
src/imap.c
src/statusbar.c

index 79600e88379fe9a67befc52595f2831aec245910..a52a7f264a823e73b9a5ce69117acf62ff9686af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-12-26 [colin]     2.6.1cvs76
+
+       * src/folder.c
+       * src/folderview.c
+       * src/imap.c
+       * src/statusbar.c
+       * src/etpan/imap-thread.c
+               Fix previous commit warnings
+               Make statusbar update every second if total < 20
+               Make IMAP APPEND faster by simplifying log              
+
 2006-12-26 [colin]     2.6.1cvs75
 
        * src/folder.c
index 6e02d8a6e3a7c304ccb68fdf5fbc60ba08773fac..0f221078c1b15d47b3863abbf1d822212cffd550 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.2.2.15 -r 1.2.2.16 src/folder_item_prefs.c;  ) > 2.6.1cvs73.patchset
 ( cvs diff -u -r 1.1.4.59 -r 1.1.4.60 src/etpan/imap-thread.c;  ) > 2.6.1cvs74.patchset
 ( cvs diff -u -r 1.213.2.126 -r 1.213.2.127 src/folder.c;  cvs diff -u -r 1.87.2.33 -r 1.87.2.34 src/folder.h;  cvs diff -u -r 1.207.2.138 -r 1.207.2.139 src/folderview.c;  cvs diff -u -r 1.20.2.14 -r 1.20.2.15 src/folderview.h;  cvs diff -u -r 1.1.2.32 -r 1.1.2.33 src/imap_gtk.c;  cvs diff -u -r 1.2.2.22 -r 1.2.2.23 src/mh_gtk.c;  ) > 2.6.1cvs75.patchset
+( cvs diff -u -r 1.213.2.127 -r 1.213.2.128 src/folder.c;  cvs diff -u -r 1.207.2.139 -r 1.207.2.140 src/folderview.c;  cvs diff -u -r 1.179.2.142 -r 1.179.2.143 src/imap.c;  cvs diff -u -r 1.5.2.12 -r 1.5.2.13 src/statusbar.c;  cvs diff -u -r 1.1.4.60 -r 1.1.4.61 src/etpan/imap-thread.c;  ) > 2.6.1cvs76.patchset
index bbde24746519ab9e9860bf03a00757685045b60a..174bbf3260ed67dece71485c5bfcc22bcd51d59a 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=6
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=75
+EXTRA_VERSION=76
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 686a4609992321b4f92d045f10c3eb727150be22..bfab03cc44305f9843898eac0399b5d71fe32f8a 100644 (file)
@@ -166,7 +166,10 @@ void imap_logger_append(int direction, const char * str, size_t size)
        if (size > 8192) {
                log_print("IMAP4%c [APPEND data - %zd bytes]\n", direction?'>':'<', size);
                return;
-       }
+       } else if (direction == 0 && size > 64) {
+               log_print("IMAP4%c [APPEND data - %zd bytes]\n", direction?'>':'<', size);
+               return;
+       } 
        buf = malloc(size+1);
        memset(buf, 0, size+1);
        strncpy(buf, str, size);
@@ -639,6 +642,7 @@ static void list_run(struct etpan_thread_op * op)
        clist * list;
        
        param = op->param;
+       result = op->result;
 
        CHECK_IMAP();
 
@@ -646,7 +650,6 @@ static void list_run(struct etpan_thread_op * op)
        r = mailimap_list(param->imap, param->base,
                          param->wildcard, &list);
        
-       result = op->result;
        result->error = r;
        result->list = list;
        debug_print("imap list run - end\n");
@@ -698,7 +701,8 @@ static void login_run(struct etpan_thread_op * op)
 #endif
        
        param = op->param;
-       
+       result = op->result;
+
        CHECK_IMAP();
 
 #ifdef DISABLE_LOG_DURING_LOGIN
@@ -722,7 +726,6 @@ static void login_run(struct etpan_thread_op * op)
        mailstream_debug = old_debug;
 #endif
        
-       result = op->result;
        result->error = r;
        debug_print("imap login run - end %i\n", r);
 }
@@ -846,12 +849,12 @@ static void noop_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
+       result = op->result;
 
        CHECK_IMAP();
 
        r = mailimap_noop(param->imap);
        
-       result = op->result;
        result->error = r;
        debug_print("imap noop run - end %i\n", r);
 }
@@ -893,12 +896,12 @@ static void starttls_run(struct etpan_thread_op * op)
        int r;
 
        param = op->param;
+       result = op->result;
 
        CHECK_IMAP();
 
        r = mailimap_starttls(param->imap);
        
-       result = op->result;
        result->error = r;
        debug_print("imap starttls run - end %i\n", r);
        
@@ -972,12 +975,12 @@ static void create_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
+       result = op->result;
 
        CHECK_IMAP();
 
        r = mailimap_create(param->imap, param->mb);
        
-       result = op->result;
        result->error = r;
        debug_print("imap create run - end %i\n", r);
 }
@@ -1019,12 +1022,12 @@ static void rename_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
+       result = op->result;
 
        CHECK_IMAP();
 
        r = mailimap_rename(param->imap, param->mb, param->new_name);
        
-       result = op->result;
        result->error = r;
        debug_print("imap rename run - end %i\n", r);
 }
@@ -1067,12 +1070,12 @@ static void delete_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
+       result = op->result;
 
        CHECK_IMAP();
 
        r = mailimap_delete(param->imap, param->mb);
        
-       result = op->result;
        result->error = r;
        debug_print("imap delete run - end %i\n", r);
 }
@@ -1112,12 +1115,12 @@ static void select_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
+       result = op->result;
 
        CHECK_IMAP();
 
        r = mailimap_select(param->imap, param->mb);
        
-       result = op->result;
        result->error = r;
        debug_print("imap select run - end %i\n", r);
 }
@@ -1172,12 +1175,12 @@ static void examine_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
+       result = op->result;
 
        CHECK_IMAP();
 
        r = mailimap_examine(param->imap, param->mb);
        
-       result = op->result;
        result->error = r;
        debug_print("imap examine run - end %i\n", r);
 }
@@ -1259,7 +1262,8 @@ static void search_run(struct etpan_thread_op * op)
        clist * search_result;
        
        param = op->param;
-       
+       result = op->result;
+
        CHECK_IMAP();
 
        /* we copy the mailimap_set because freeing the key is recursive */
@@ -1346,7 +1350,6 @@ static void search_run(struct etpan_thread_op * op)
                /* free the key (with the imapset) */
                mailimap_search_key_free(key);
 
-               result = op->result;
                result->error = r;
                result->search_result = search_result;
        }
@@ -1537,14 +1540,14 @@ static void fetch_uid_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
-       
+       result = op->result;
+
        CHECK_IMAP();
 
        fetch_result = NULL;
        r = imap_get_messages_list(param->imap, param->first_index,
                                   &fetch_result);
        
-       result = op->result;
        result->error = r;
        result->fetch_result = fetch_result;
        debug_print("imap fetch_uid run - end %i\n", r);
@@ -1817,7 +1820,8 @@ static void fetch_content_run(struct etpan_thread_op * op)
        FILE * f;
        
        param = op->param;
-       
+       result = op->result;
+
        CHECK_IMAP();
 
        content = NULL;
@@ -1829,7 +1833,6 @@ static void fetch_content_run(struct etpan_thread_op * op)
                r = imap_fetch_header(param->imap, param->msg_index,
                                      &content, &content_size);
        
-       result = op->result;
        result->error = r;
        
        if (r == MAILIMAP_NO_ERROR) {
@@ -2194,14 +2197,14 @@ static void fetch_env_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
-       
+       result = op->result;
+
        CHECK_IMAP();
 
        env_list = NULL;
        r = imap_get_envelopes_list(param->imap, param->set,
                                    &env_list);
        
-       result = op->result;
        result->error = r;
        result->fetch_env_result = env_list;
        
@@ -2379,12 +2382,12 @@ static void expunge_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
+       result = op->result;
 
        CHECK_IMAP();
 
        r = mailimap_expunge(param->imap);
        
-       result = op->result;
        result->error = r;
        debug_print("imap expunge run - end %i\n", r);
 }
@@ -2427,13 +2430,13 @@ static void copy_run(struct etpan_thread_op * op)
        struct mailimap_set *source = NULL, *dest = NULL;
 
        param = op->param;
-       
+       result = op->result;
+
        CHECK_IMAP();
 
        r = mailimap_uidplus_uid_copy(param->imap, param->set, param->mb,
                &val, &source, &dest);
        
-       result = op->result;
        result->error = r;
        if (r == 0) {
                result->source = source;
@@ -2494,13 +2497,13 @@ static void store_run(struct etpan_thread_op * op)
        int r;
        
        param = op->param;
-       
+       result = op->result;
+
        CHECK_IMAP();
 
        r = mailimap_uid_store(param->imap, param->set,
                               param->store_att_flags);
        
-       result = op->result;
        result->error = r;
        
        debug_print("imap store run - end %i\n", r);
index db4f9b412a84448ec9e15c11134c206755995900..d03f34b8fb7a06fdccd537f5461aeddd0b6ad12f 100644 (file)
@@ -2779,7 +2779,7 @@ gint folder_item_add_msgs(FolderItem *dest, GSList *file_list,
 
         return lastnum;
 }
-               
+
 static FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest, gboolean copy) 
 {
        GSList *mlist;
index 8ebbffa78c48dec8cf1ca12cd81bba20454b53a1..69a49240d8009d68da3551e6a986db59f31ced03 100644 (file)
@@ -2462,7 +2462,8 @@ void folderview_move_folder(FolderView *folderview, FolderItem *from_folder,
        gtk_widget_set_sensitive(GTK_WIDGET(folderview->ctree), FALSE);
        inc_lock();
        main_window_cursor_wait(folderview->mainwin);
-       statusbar_verbosity_set(TRUE);
+
+       statusbar_verbosity_set(FALSE);
        folder_item_update_freeze();
        if ((status = folder_item_move_to(from_folder, to_folder, &new_folder, copy)) == F_MOVE_OK) {
                statusbar_verbosity_set(FALSE);
index 72bf7cf5ddb70006d104d1ed4f37d5ae1edfc787..0b7060bfa2fce51794b49c26d4d05a5005971183 100644 (file)
@@ -1095,7 +1095,7 @@ static gint imap_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
                gchar *real_file = NULL;
                fileinfo = (MsgFileInfo *)cur->data;
 
-               statusbar_progress_all(curnum, total, 1);
+               statusbar_progress_all(curnum, total, total < 10 ? 1:10);
                curnum++;
 
                if (fileinfo->flags) {
index 63905660aa3e1107f6499a18e0ff0119769b64d4..c4d88859f9b692e57e2793323ad8dfa38707a102 100644 (file)
@@ -161,14 +161,18 @@ void statusbar_verbosity_set(gboolean verbose)
 void statusbar_progress_all (gint done, gint total, gint step) 
 {
        gchar buf[32];
-       if (total && done % step == 0) {
+       static time_t last_update = (time_t)NULL;
+       time_t now = time(NULL);
+       if (total && (now - last_update > 0 || total < 20)) {
                g_snprintf(buf, sizeof(buf), "%d / %d", done, total);
                gtk_progress_bar_set_text
                        (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar), buf);
                gtk_progress_bar_set_fraction
                        (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar),
                         (total == 0) ? 0 : (gfloat)done / (gfloat)total);
+               last_update = now;
        } else if (total == 0) {
+               last_update = (time_t)NULL;
                gtk_progress_bar_set_text
                        (GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar), "");
                gtk_progress_bar_set_fraction