2006-02-19 [colin] 2.0.0cvs62
authorColin Leroy <colin@colino.net>
Sun, 19 Feb 2006 23:46:49 +0000 (23:46 +0000)
committerColin Leroy <colin@colino.net>
Sun, 19 Feb 2006 23:46:49 +0000 (23:46 +0000)
* src/compose.c
* src/imap.c
* src/etpan/imap-thread.c
* src/etpan/imap-thread.h
(Future) IMAP speed improvement on sending
Will require a libetpan update
* src/summaryview.c
* src/gtk/quicksearch.c
Make quicksearch clearable while running.

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/etpan/imap-thread.c
src/etpan/imap-thread.h
src/gtk/quicksearch.c
src/imap.c
src/summaryview.c

index b7bb5b019b0860f92fa3bab6221d3199889349eb..e5aeae441e39d4c50cfb7d679c0259c8ea06eb38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-02-19 [colin]     2.0.0cvs62
+
+       * src/compose.c
+       * src/imap.c
+       * src/etpan/imap-thread.c
+       * src/etpan/imap-thread.h
+               (Future) IMAP speed improvement on sending
+               Will require a libetpan update
+       * src/summaryview.c
+       * src/gtk/quicksearch.c
+               Make quicksearch clearable while running.
+
 2006-02-17 [colin]     2.0.0cvs61
 
        * src/imap.c
index 1e7c4c225a4d9dfc432131b89b777d6d1cbe82a7..83cf2ff953ad3612fbe0636a5a10a03f9546f829 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.115.2.75 -r 1.115.2.76 src/main.c;  cvs diff -u -r 1.13.2.16 -r 1.13.2.17 src/common/plugin.c;  cvs diff -u -r 1.5.2.4 -r 1.5.2.5 src/common/plugin.h;  cvs diff -u -r 1.5.2.26 -r 1.5.2.27 src/gtk/pluginwindow.c;  ) > 2.0.0cvs59.patchset
 ( cvs diff -u -r 1.94.2.76 -r 1.94.2.77 src/messageview.c;  cvs diff -u -r 1.204.2.76 -r 1.204.2.77 src/prefs_common.c;  cvs diff -u -r 1.103.2.41 -r 1.103.2.42 src/prefs_common.h;  cvs diff -u -r 1.1.2.11 -r 1.1.2.12 src/prefs_message.c;  ) > 2.0.0cvs60.patchset
 ( cvs diff -u -r 1.179.2.92 -r 1.179.2.93 src/imap.c;  cvs diff -u -r 1.1.4.28 -r 1.1.4.29 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.7 -r 1.1.4.8 src/etpan/imap-thread.h;  ) > 2.0.0cvs61.patchset
+( cvs diff -u -r 1.382.2.242 -r 1.382.2.243 src/compose.c;  cvs diff -u -r 1.179.2.93 -r 1.179.2.94 src/imap.c;  cvs diff -u -r 1.395.2.170 -r 1.395.2.171 src/summaryview.c;  cvs diff -u -r 1.1.4.29 -r 1.1.4.30 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.8 -r 1.1.4.9 src/etpan/imap-thread.h;  cvs diff -u -r 1.1.2.33 -r 1.1.2.34 src/gtk/quicksearch.c;  ) > 2.0.0cvs62.patchset
index 22d8d08837748ca815f5b163c73a8d63c21a46ee..741a4dda9336ed1799282b7860fe3b7624111e42 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=61
+EXTRA_VERSION=62
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index e0cb0bfc37c1ee726fe094c078540746dae095d3..d54ec742eb903138eed86ad3602aad9db6bee160 100644 (file)
@@ -272,10 +272,12 @@ static gint compose_remove_reedit_target  (Compose        *compose,
 void compose_remove_draft                      (Compose        *compose);
 static gint compose_queue                      (Compose        *compose,
                                                 gint           *msgnum,
-                                                FolderItem     **item);
+                                                FolderItem     **item,
+                                                gchar          **msgpath);
 static gint compose_queue_sub                  (Compose        *compose,
                                                 gint           *msgnum,
                                                 FolderItem     **item,
+                                                gchar          **msgpath,
                                                 gboolean       check_subject);
 static void compose_add_attachments            (Compose        *compose,
                                                 MimeInfo       *parent);
@@ -3770,7 +3772,7 @@ gint compose_send(Compose *compose)
        gint msgnum;
        FolderItem *folder;
        gint val = -1;
-       gchar *msgpath;
+       gchar *msgpath = NULL;
 
        compose_allow_user_actions (compose, FALSE);
        compose->sending = TRUE;
@@ -3778,7 +3780,7 @@ gint compose_send(Compose *compose)
        if (compose_check_entries(compose, TRUE) == FALSE)
                goto bail;
 
-       val = compose_queue(compose, &msgnum, &folder);
+       val = compose_queue(compose, &msgnum, &folder, &msgpath);
 
        if (val) {
                if (val == -4) {
@@ -3816,10 +3818,15 @@ gint compose_send(Compose *compose)
                return 0;
        }
        
-       msgpath = folder_item_fetch_msg(folder, msgnum);
-       val = procmsg_send_message_queue(msgpath);
-       g_free(msgpath);
-
+       if (msgpath == NULL) {
+               msgpath = folder_item_fetch_msg(folder, msgnum);
+               val = procmsg_send_message_queue(msgpath);
+               g_free(msgpath);
+       } else {
+               val = procmsg_send_message_queue(msgpath);
+               g_unlink(msgpath);
+               g_free(msgpath);
+       }
        if (prefs_common.send_dialog_mode == SEND_DIALOG_ALWAYS) {
                compose->sending = FALSE;
                compose_allow_user_actions (compose, TRUE);
@@ -4346,11 +4353,11 @@ void compose_remove_draft(Compose *compose)
 
 }
 
-static gint compose_queue(Compose *compose, gint *msgnum, FolderItem **item)
+static gint compose_queue(Compose *compose, gint *msgnum, FolderItem **item, gchar **msgpath)
 {
-       return compose_queue_sub (compose, msgnum, item, FALSE);
+       return compose_queue_sub (compose, msgnum, item, msgpath, FALSE);
 }
-static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item, gboolean check_subject)
+static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item, gchar **msgpath, gboolean check_subject)
 {
        FolderItem *queue;
        gchar *tmp;
@@ -4544,14 +4551,18 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                return -1;
        }
        folder_item_scan(queue);
-       if ((num = folder_item_add_msg(queue, tmp, NULL, TRUE)) < 0) {
+       if ((num = folder_item_add_msg(queue, tmp, NULL, FALSE)) < 0) {
                g_warning("can't queue the message\n");
                g_unlink(tmp);
                g_free(tmp);
                return -1;
        }
-       g_unlink(tmp);
-       g_free(tmp);
+       
+       if (msgpath == NULL) {
+               g_unlink(tmp);
+               g_free(tmp);
+       } else
+               *msgpath = tmp;
 
        if (compose->mode == COMPOSE_REEDIT) {
                compose_remove_reedit_target(compose, FALSE);
@@ -7105,7 +7116,7 @@ static void compose_send_later_cb(gpointer data, guint action,
        Compose *compose = (Compose *)data;
        gint val;
 
-       val = compose_queue_sub(compose, NULL, NULL, TRUE);
+       val = compose_queue_sub(compose, NULL, NULL, NULL, TRUE);
        if (!val) 
                compose_close(compose);
        else if (val == -2) {
index c7c3859f002237879c7e619aecaf72258268098b..77f06e42284c71bbb9b47478f2a94f6a44b320cc 100644 (file)
@@ -2026,6 +2026,7 @@ struct append_param {
 
 struct append_result {
        int error;
+       int uid;
 };
 
 static void append_run(struct etpan_thread_op * op)
@@ -2036,7 +2037,7 @@ static void append_run(struct etpan_thread_op * op)
        char * data;
        size_t size;
        struct stat stat_buf;
-       int fd;
+       int fd, uid = 0;
        
        param = op->param;
        result = op->result;
@@ -2063,19 +2064,20 @@ static void append_run(struct etpan_thread_op * op)
        
        r = mailimap_append(param->imap, param->mailbox,
                            param->flag_list, NULL,
-                           data, size);
+                           data, size/*, &uid */);
        
        munmap(data, size);
        close(fd);
        
        result->error = r;
-       
-       debug_print("imap append run - end %i\n", r);
+       result->uid = uid;
+       debug_print("imap append run - end %i uid %d\n", r, uid);
 }
 
 int imap_threaded_append(Folder * folder, const char * mailbox,
                         const char * filename,
-                        struct mailimap_flag_list * flag_list)
+                        struct mailimap_flag_list * flag_list,
+                        int *uid)
 {
        struct append_param param;
        struct append_result result;
@@ -2095,7 +2097,9 @@ int imap_threaded_append(Folder * folder, const char * mailbox,
                return result.error;
        
        debug_print("imap append - end\n");
-       
+       if (uid != NULL)
+               *uid = result.uid;
+
        return result.error;
 }
 
index b25f7282c1628fe39b75ce877b9d55a77f7b98ce..5f6ee4fd72a226dce3ca14f7960e839db2b7224a 100644 (file)
@@ -80,7 +80,8 @@ void imap_fetch_env_free(carray * env_list);
 
 int imap_threaded_append(Folder * folder, const char * mailbox,
                         const char * filename,
-                        struct mailimap_flag_list * flag_list);
+                        struct mailimap_flag_list * flag_list,
+                        int *uid);
 
 int imap_threaded_expunge(Folder * folder);
 
index 246a7a84335b6036c7899196a90260576d19797a..39ba4585010e593deb24a443a2ebbc52be9c0acf 100644 (file)
@@ -845,6 +845,9 @@ static gboolean quicksearch_match_subfolder(QuickSearch *quicksearch,
                        break;
                }
                procmsg_msginfo_free(msg);
+               GTK_EVENTS_FLUSH();
+               if (!quicksearch_is_active(quicksearch))
+                       break;
        }
 
        g_slist_free(msglist);
@@ -874,6 +877,8 @@ void quicksearch_search_subfolders(QuickSearch *quicksearch,
                                                      cur);
        }
        quicksearch->root_folder_item = folder_item;
+       if (!quicksearch_is_active(quicksearch))
+               quicksearch_reset_cur_folder_item(quicksearch);
 }
 
 static void quicksearch_reset_folder_items(QuickSearch *quicksearch,
index c6be77426b0958faf7d8b10e9c698878aba70d37..f7a5cea66aa040db67ae64019bde8a47980378bc 100644 (file)
@@ -951,6 +951,11 @@ static gchar *imap_fetch_msg_full(Folder *folder, FolderItem *item, gint uid,
                        procmsg_msginfo_free(msginfo);
                        file_strip_crs(filename);
                        return filename;
+               } else if (!cached) {
+                       debug_print("message not cached, considering file complete\n");
+                       procmsg_msginfo_free(msginfo);
+                       file_strip_crs(filename);
+                       return filename;
                } else {
                        procmsg_msginfo_free(cached);
                        procmsg_msginfo_free(msginfo);
@@ -2676,10 +2681,8 @@ static gint imap_cmd_append(IMAPSession *session, const gchar *destfolder,
 
        flag_list = imap_flag_to_lep(flags);
        r = imap_threaded_append(session->folder, destfolder,
-                        file, flag_list);
+                        file, flag_list, new_uid);
        mailimap_flag_list_free(flag_list);
-       if (new_uid != NULL)
-               *new_uid = 0;
 
        if (r != MAILIMAP_NO_ERROR) {
                debug_print("append err %d\n", r);
index 90698bb5066d45fc47a76095ef0f09884363c2aa..7d55de6df5ca184f9fee158d5a9022dc7153fb5a 100644 (file)
@@ -1017,7 +1017,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 
        if (quicksearch_is_active(summaryview->quicksearch)) {
                GSList *not_killed;
-               
+               int n = 0;
                not_killed = NULL;
                for (cur = mlist ; cur != NULL && cur->data != NULL ; cur = g_slist_next(cur)) {
                        MsgInfo * msginfo = (MsgInfo *) cur->data;
@@ -1026,6 +1026,10 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                                not_killed = g_slist_prepend(not_killed, msginfo);
                        else
                                procmsg_msginfo_free(msginfo);
+                       GTK_EVENTS_FLUSH();
+                       if (!quicksearch_is_active(summaryview->quicksearch)) {
+                               break;
+                       }
                }
                hidden_removed = TRUE;
                if (quicksearch_is_running(summaryview->quicksearch)) {
@@ -1038,7 +1042,17 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                                              summaryview->folder_item);
                        main_window_cursor_normal(summaryview->mainwin);
                }
-               
+
+               if (!quicksearch_is_active(summaryview->quicksearch)) {
+                       debug_print("search cancelled!\n");
+                       gtk_clist_thaw(GTK_CLIST(ctree));
+                       STATUSBAR_POP(summaryview->mainwin);
+                       main_window_cursor_normal(summaryview->mainwin);
+                       summary_unlock(summaryview);
+                       inc_unlock();
+                       summary_show(summaryview, summaryview->folder_item);
+                       return FALSE;
+               }
                g_slist_free(mlist);
                mlist = not_killed;
        }
@@ -1126,7 +1140,6 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
        toolbar_main_set_sensitive(summaryview->mainwin);
        
        gtk_clist_thaw(GTK_CLIST(ctree));
-
        debug_print("\n");
        STATUSBAR_PUSH(summaryview->mainwin, _("Done."));
        STATUSBAR_POP(summaryview->mainwin);