2005-08-08 [colin] 1.9.13cvs25
authorColin Leroy <colin@colino.net>
Mon, 8 Aug 2005 16:45:29 +0000 (16:45 +0000)
committerColin Leroy <colin@colino.net>
Mon, 8 Aug 2005 16:45:29 +0000 (16:45 +0000)
* src/folder.c
* src/folder.h
Cache parents' type to make folder_has_parent_of_type
faster
* src/folderview.c
Forbid DnD of special sub-folders
* src/procmsg.c
* src/procmsg.h
Add MAIL_POSTFILTERING_HOOK
* src/summaryview.c
Revert over-zealous deletion of the use_addr_book
code

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/folder.c
src/folder.h
src/folderview.c
src/procmsg.c
src/procmsg.h
src/summaryview.c

index f5a7edf9eae2cd59159a19eb41c94888ec2c3cbe..b5542712c3146ff43e56445a1144ea1d89fb4a2c 100644 (file)
@@ -1,3 +1,18 @@
+2005-08-08 [colin]     1.9.13cvs25
+
+       * src/folder.c
+       * src/folder.h
+               Cache parents' type to make folder_has_parent_of_type
+               faster
+       * src/folderview.c
+               Forbid DnD of special sub-folders
+       * src/procmsg.c
+       * src/procmsg.h
+               Add MAIL_POSTFILTERING_HOOK
+       * src/summaryview.c
+               Revert over-zealous deletion of the use_addr_book 
+               code
+
 2005-08-07 [colin]     1.9.13cvs24
 
        * src/folder.c
index 010e2c61edfc43fc094594151dbeb3fccb3a08ff..c16d3cea1b47d17dea7bde079de41dff9cc3981a 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.23 -r 1.60.2.24 src/addressbook.c;  ) > 1.9.13cvs22.patchset
 ( cvs diff -u -r 1.382.2.148 -r 1.382.2.149 src/compose.c;  cvs diff -u -r 1.213.2.45 -r 1.213.2.46 src/folder.c;  cvs diff -u -r 1.87.2.14 -r 1.87.2.15 src/folder.h;  cvs diff -u -r 1.26.2.18 -r 1.26.2.19 src/foldersel.c;  cvs diff -u -r 1.3.2.5 -r 1.3.2.6 src/folderutils.c;  cvs diff -u -r 1.207.2.53 -r 1.207.2.54 src/folderview.c;  cvs diff -u -r 1.179.2.57 -r 1.179.2.58 src/imap.c;  cvs diff -u -r 1.274.2.52 -r 1.274.2.53 src/mainwindow.c;  cvs diff -u -r 1.94.2.60 -r 1.94.2.61 src/messageview.c;  cvs diff -u -r 1.79.2.15 -r 1.79.2.16 src/mh.c;  cvs diff -u -r 1.16.2.23 -r 1.16.2.24 src/msgcache.c;  cvs diff -u -r 1.49.2.52 -r 1.49.2.53 src/procmime.c;  cvs diff -u -r 1.395.2.105 -r 1.395.2.106 src/summaryview.c;  ) > 1.9.13cvs23.patchset
 ( cvs diff -u -r 1.213.2.46 -r 1.213.2.47 src/folder.c;  ) > 1.9.13cvs24.patchset
+( cvs diff -u -r 1.213.2.47 -r 1.213.2.48 src/folder.c;  cvs diff -u -r 1.87.2.15 -r 1.87.2.16 src/folder.h;  cvs diff -u -r 1.207.2.54 -r 1.207.2.55 src/folderview.c;  cvs diff -u -r 1.150.2.33 -r 1.150.2.34 src/procmsg.c;  cvs diff -u -r 1.60.2.13 -r 1.60.2.14 src/procmsg.h;  cvs diff -u -r 1.395.2.106 -r 1.395.2.107 src/summaryview.c;  cvs diff -u -r 1.8.2.4 -r 1.8.2.5 src/plugins/Makefile.am;  ) > 1.9.13cvs25.patchset
index 225689dd28f51d3ef2dcaa939cb80c9876fe3f31..b6192eece5d058942ff497be72ccd9e9e42531c4 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=24
+EXTRA_VERSION=25
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c6f30b530d0374ac47deaf95762aa59e650c0cde..af1983312f71b9b5397ec80c3a81bf2d78b42c71 100644 (file)
@@ -3560,8 +3560,10 @@ gboolean folder_has_parent_of_type(FolderItem *item,
 {
        FolderItem *cur = item;
        while (cur) {
-               if (cur->stype == type)
+               if (cur->stype == type || cur->parent_stype == type) {
+                       item->parent_stype == type;
                        return TRUE;
+               }
                cur = folder_item_parent(cur);
        }
        return FALSE;
index 5534b46bea89e51ec80f356685e5ef2294ee88d8..f3afb9a6d4aaa70a5cfde3f2aeffb4215611d630 100644 (file)
@@ -623,6 +623,9 @@ struct _FolderItem
        gpointer data;
 
        FolderItemPrefs * prefs;
+       
+       /* for faster search of special parents */
+       SpecialFolderItemType parent_stype;
 };
 
 struct _PersistPrefs
index 6a139686179b3661ba5979e45fd355d722ada641..21e613820cf55d6642f19f6679b4102c47e71a3d 100644 (file)
@@ -2376,6 +2376,7 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
        } else {
                /* comes from folderview */
                char *source;
+               gboolean folder_is_normal = TRUE;
                
                source = data->data + 17;
                if (gtk_clist_get_selection_info
@@ -2388,7 +2389,15 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
                item = gtk_ctree_node_get_row_data(GTK_CTREE(widget), node);
                src_item = folder_find_item_from_identifier(source);
 
-               if (!item || item->no_select || !src_item || src_item->stype != F_NORMAL) {
+               folder_is_normal = 
+                       src_item != NULL &&
+                       src_item->stype == F_NORMAL &&
+                       !folder_has_parent_of_type(src_item, F_OUTBOX) &&
+                       !folder_has_parent_of_type(src_item, F_DRAFT) &&
+                       !folder_has_parent_of_type(src_item, F_QUEUE) &&
+                       !folder_has_parent_of_type(src_item, F_TRASH);
+               if (!item || item->no_select || !src_item 
+               ||  !folder_is_normal) {
                        gtk_drag_finish(drag_context, FALSE, FALSE, time);                      
                        return;
                }
index 45f85c8cee6b3d1c83dbe8ee12099c53cd5a6bba..9559de6ac0ca43872a916fe8b7b852777438463c 100644 (file)
@@ -1856,6 +1856,8 @@ gboolean procmsg_msginfo_filter(MsgInfo *msginfo)
        if((filtering_rules != NULL) &&
           filter_message_by_msginfo(filtering_rules, msginfo))
                return TRUE;
+               
+       hooks_invoke(MAIL_POSTFILTERING_HOOKLIST, msginfo);
 
        return FALSE;
 }
index d73309759a0512bf22292e0d574e98b1547967c3..68e4e29736a80f64529c25635c29205a5fa7f34e 100644 (file)
@@ -147,6 +147,7 @@ typedef guint32 MsgTmpFlags;
 
 #define MSGINFO_UPDATE_HOOKLIST "msginfo_update"
 #define MAIL_FILTERING_HOOKLIST "mail_filtering_hooklist"
+#define MAIL_POSTFILTERING_HOOKLIST "mail_postfiltering_hooklist"
 
 typedef enum {
        MSGINFO_UPDATE_FLAGS = 1 << 0,
index 55dcb2123c1aa130d42676468cf0e0ddf3d467fa..bb070190948c2d7c3e2ee886777fa4aff398d6cc 100644 (file)
@@ -2286,6 +2286,31 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
        END_TIMING();
 }
 
+static gchar *summary_complete_address(const gchar *addr)
+{
+       gint count;
+       gchar *res, *tmp, *email_addr;
+       
+       if (addr == NULL)
+               return NULL;
+
+       Xstrdup_a(email_addr, addr, return NULL);
+       extract_address(email_addr);
+       g_return_val_if_fail(*email_addr, NULL);
+
+       /*
+        * completion stuff must be already initialized
+        */
+       res = NULL;
+       if (1 < (count = complete_address(email_addr))) {
+               tmp = get_complete_address(1);
+               res = procheader_get_fromname(tmp);
+               g_free(tmp);
+       }
+
+       return res;
+}
+
 static void summary_set_header(SummaryView *summaryview, gchar *text[],
                               MsgInfo *msginfo)
 {
@@ -2313,9 +2338,17 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
        else
                text[col_pos[S_COL_DATE]] = _("(No Date)");
 
-       text[col_pos[S_COL_FROM]] = msginfo->fromname ? msginfo->fromname :
-               _("(No From)");
-       text[col_pos[S_COL_TO]] = msginfo->to ? msginfo->to :
+       if (!prefs_common.use_addr_book) {
+               text[col_pos[S_COL_FROM]] = msginfo->fromname ? 
+                                               msginfo->fromname :
+                                               _("(No From)");
+       } else {
+               gchar *tmp = summary_complete_address(msginfo->fromname);
+               text[col_pos[S_COL_FROM]] = tmp ? tmp : (msginfo->fromname ?
+                                                        msginfo->fromname: 
+                                                               _("(No From)"));
+       }
+       text[col_pos[S_COL_TO]] = msginfo->to ? msginfo->to : 
                _("(No Recipient)");
        
        if (msginfo->folder && msginfo->folder->folder)