2004-08-27 [paul] 0.9.12cvs83
authorPaul Mangan <paul@claws-mail.org>
Fri, 27 Aug 2004 07:29:20 +0000 (07:29 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 27 Aug 2004 07:29:20 +0000 (07:29 +0000)
* src/mh.c
* src/procheader.c
* src/procmsg.c
* src/procmsg.h
* src/common/utils.c
* src/gtk/menu.h
sync with main 0.9.12cvs6, see ChangeLog
2004-08-24, 2004-08-25, 2004-08-26

ChangeLog
ChangeLog.claws
ChangeLog.jp
PATCHSETS
configure.ac
src/common/utils.c
src/gtk/menu.h
src/mh.c
src/procheader.c
src/procmsg.c
src/procmsg.h

index 75046b3..9d5faf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,75 @@
+2004-08-27
+
+       * src/prefs_filter.c: auto-scroll when a new rule is added.
+         open edit dialog when a rule is double-clicked.
+         prefs_filter_copy_cb(): implemented.
+       * src/prefs_filter_edit.c: implemented action "Stop rule evaluation".
+
+2004-08-26
+
+       * src/filter.[ch]
+         src/inc.c
+         src/mbox.c
+         src/prefs_filter_edit.c
+         src/summaryview.c: renamed FilterResult to FilterInfo, and added
+         account to its members.
+         Implemented command test, size, age, account, and on-receive
+         condition.
+       * src/mh.c
+         src/procheader.c: procheader_parse_file(): also get file size and
+         timestamp.
+       * src/utils.c:
+         execute_async()
+         execute_sync()
+         execute_command_line(): return exit status.
+
+2004-08-26
+
+       * src/filter.[ch]
+         src/inc.c: save all types of performed actions.
+         filter_rule_rename_dest_path(): modified for the new system.
+         filter_rule_delete_action_by_dest_path(): delete actions that
+         matches with a path.
+       * src/mbox.c: proc_mbox(): ignore FLT_ACTION_NOT_RECEIVE.
+       * src/prefs_filter.c: prefs_filter_delete_path(): modified for the new
+         system.
+       * src/summaryview.c:
+         summary_filter()
+         summary_filter_func(): modified for the new system.
+
+2004-08-25
+
+       * src/filter.[ch]: implemented message body match.
+       * src/procmime.[ch]:
+         procmime_find_string_part()
+         procmime_find_string(): take function pointer for matching.
+       * src/procmsg.[ch]: added file_path (which is only used for temporary
+         messages) to MsgInfo.
+         procmsg_msginfo_copy()
+         procmsg_msginfo_free(): handle extra members.
+       * src/summary_search.c: modified for procmime_find_string().
+       * src/summaryview.c: filter_apply_local() -> filter_apply_msginfo().
+       * src/utils.[ch]: added function for string match.
+       * src/compose.c
+         src/undo.c: removed redundant debug messages.
+
+2004-08-24
+
+       * implemented the new filtering system (still in progress).
+       * src/defs.h
+         src/filter.[ch]: implemented reading/writing of filter XML data.
+       * src/prefs_filter.[ch]
+         src/prefs_filter_edit.[ch]: implemented UI for the new filtering
+         system.
+       * src/inc.c
+         src/main.c
+         src/mbox.c
+         src/pop.c
+         src/summaryview.c: modified for the new filtering system.
+       * src/menu.h: MENUITEM_ADD(): create separator if label is NULL.
+       * src/procheader.[ch]: added some utility functions.
+       * src/utils.c: open_uri(): modified warning message.
+
 2004-08-09
 
        * src/main.c: removed parsing of "./gtkrc".
 
 2004-06-23
 
-       * src/compose.[ch]: autowrap can be switchd on/off from the compose
+       * src/compose.[ch]: autowrap can be switched on/off from the compose
          window.
 
 2004-06-17
index 8f24cbc..b364306 100644 (file)
@@ -1,3 +1,15 @@
+2004-08-27 [paul]      0.9.12cvs83
+
+       * src/mh.c
+       * src/procheader.c
+       * src/procmsg.c
+       * src/procmsg.h
+       * src/common/utils.c
+       * src/gtk/menu.h
+               sync with main 0.9.12cvs6, see ChangeLog
+               2004-08-24, 2004-08-25, 2004-08-26
+
+
 2004-08-26 [paul]
 
        * po/ja.po
index d70b88f..3eda9ea 100644 (file)
@@ -1,3 +1,76 @@
+2004-08-27
+
+       * src/prefs_filter.c: ¿·µ¬¥ë¡¼¥ë¤¬Äɲ䵤줿¤é¼«Æ°¥¹¥¯¥í¡¼¥ë¤¹¤ë
+         ¤è¤¦¤Ë¤·¤¿¡£
+         ¥ë¡¼¥ë¤¬¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¤µ¤ì¤¿¤éÊÔ½¸¥À¥¤¥¢¥í¥°¤ò³«¤¯¤è¤¦¤Ë¤·¤¿¡£
+         prefs_filter_copy_cb(): ¼ÂÁõ¡£
+       * src/prefs_filter_edit.c: ¥¢¥¯¥·¥ç¥ó¡Ö¥ë¡¼¥ë¤Îɾ²Á¤òÄä»ß¡×¤ò¼ÂÁõ¡£
+
+2004-08-26
+
+       * src/filter.[ch]
+         src/inc.c
+         src/mbox.c
+         src/prefs_filter_edit.c
+         src/summaryview.c: FilterResult ¤ò FilterInfo ¤Ë²þ̾¤·¡¢¥á¥ó¥Ð¤Ë
+         account ¤òÄɲá£
+         command test, size, age, account, on-receive ¾ò·ï¤ò¼ÂÁõ¡£
+       * src/mh.c
+         src/procheader.c: procheader_parse_file(): ¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤È
+         ¥¿¥¤¥à¥¹¥¿¥ó¥×¤âÆÀ¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/utils.c:
+         execute_async()
+         execute_sync()
+         execute_command_line(): ½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹¤è¤¦¤Ë¤·¤¿¡£
+
+2004-08-26
+
+       * src/filter.[ch]
+         src/inc.c: ¼Â¹Ô¤·¤¿Á´¤Æ¤Î¥¢¥¯¥·¥ç¥ó¥¿¥¤¥×¤òÊݸ¡£
+         filter_rule_rename_dest_path(): ¿·¥·¥¹¥Æ¥à¤Ë¹ç¤ï¤»¤Æ½¤Àµ¡£
+         filter_rule_delete_action_by_dest_path(): ¥Ñ¥¹¤Ë¥Þ¥Ã¥Á¤¹¤ë
+         ¥¢¥¯¥·¥ç¥ó¤òºï½ü¡£
+       * src/mbox.c: proc_mbox(): FLT_ACTION_NOT_RECEIVE ¤ò̵»ë¤¹¤ë¤è¤¦¤Ë
+         ¤·¤¿¡£
+       * src/prefs_filter.c: prefs_filter_delete_path(): ¿·¥·¥¹¥Æ¥à¤Ë
+         ¹ç¤ï¤»¤Æ½¤Àµ¡£
+       * src/summaryview.c:
+         summary_filter()
+         summary_filter_func(): ¿·¥·¥¹¥Æ¥à¤Ë¹ç¤ï¤»¤Æ½¤Àµ¡£
+
+2004-08-25
+
+       * src/filter.[ch]: ¥á¥Ã¥»¡¼¥¸ËÜʸ¤Ø¤Î¥Þ¥Ã¥Á¤ò¼ÂÁõ¡£
+       * src/procmime.[ch]:
+         procmime_find_string_part()
+         procmime_find_string(): ¥Þ¥Ã¥Á¥ó¥°´Ø¿ô¥Ý¥¤¥ó¥¿¤ò¼õ¤±¼è¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/procmsg.[ch]: file_path (°ì»þ¥á¥Ã¥»¡¼¥¸¤Î¤ß¤Ë»ÈÍÑ)¤ò MsgInfo
+         ¤ËÄɲá£
+         procmsg_msginfo_copy()
+         procmsg_msginfo_free(): »Ä¤ê¤Î¥á¥ó¥Ð¤ò°·¤¦¤è¤¦¤Ë¤·¤¿¡£
+       * src/summary_search.c: procmime_find_string() ¤Î¤¿¤á¤Î½¤Àµ¡£
+       * src/summaryview.c: filter_apply_local() -> filter_apply_msginfo().
+       * src/utils.[ch]: Ê¸»úÎó¥Þ¥Ã¥ÁÍÑ´Ø¿ô¤òÄɲá£
+       * src/compose.c
+         src/undo.c: Í¾Ê¬¤Ê¥Ç¥Ð¥Ã¥°¥á¥Ã¥»¡¼¥¸¤òºï½ü¡£
+
+2004-08-24
+
+       * ¿·¥Õ¥£¥ë¥¿¥ê¥ó¥°¥·¥¹¥Æ¥à¤ò¼ÂÁõ(¸½ºß¿Ê¹ÔÃæ)¡£
+       * src/defs.h
+         src/filter.[ch]: ¥Õ¥£¥ë¥¿¥ê¥ó¥°¤Î XML ¥Ç¡¼¥¿¤ÎÆɤ߽ñ¤­¤ò¼ÂÁõ¡£
+       * src/prefs_filter.[ch]
+         src/prefs_filter_edit.[ch]: ¿·¥Õ¥£¥ë¥¿¥ê¥ó¥°¥·¥¹¥Æ¥à¤Î UI ¤ò¼ÂÁõ¡£
+       * src/inc.c
+         src/main.c
+         src/mbox.c
+         src/pop.c
+         src/summaryview.c: ¿·¥Õ¥£¥ë¥¿¥ê¥ó¥°¥·¥¹¥Æ¥à¤Ë¹ç¤ï¤»¤Æ½¤Àµ¡£
+       * src/menu.h: MENUITEM_ADD(): label ¤¬ NULL ¤Î¾ì¹ç¥»¥Ñ¥ì¡¼¥¿¤òºîÀ®
+         ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/procheader.[ch]: ¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô¤òÄɲá£
+       * src/utils.c: open_uri(): ·Ù¹ð¥á¥Ã¥»¡¼¥¸¤ò½¤Àµ¡£
+
 2004-08-09
 
        * src/main.c: "./gtkrc" ¤ò¥Ñ¡¼¥¹¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
index 4babf1c..3e21bae 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
@@ -65,3 +65,4 @@
 ( cvs diff -u -r 1.256 -r 1.257 src/folder.c; ) > 0.9.12cvs80.patchset
 ( cvs diff -u -r 1.1 -r 1.2 src/plugins/pgpmime/pgpmime.c; cvs diff -u -r 1.1 -r 1.2 src/plugins/pgpmime/sgpgme.c; cvs diff -u -r 1.1 -r 1.2 src/plugins/pgpmime/sgpgme.h; ) > 0.9.12cvs81.patchset
 ( cvs diff -u -r 1.2 -r 1.3 src/plugins/pgpmime/pgpmime.c; ) > 0.9.12cvs82.patchset
+( cvs diff -u -r 1.441 -r 1.442 ChangeLog; cvs diff -u -r 1.436 -r 1.437 ChangeLog.jp; cvs diff -u -r 1.85 -r 1.86 src/mh.c; cvs diff -u -r 1.58 -r 1.59 src/procheader.c; cvs diff -u -r 1.165 -r 1.166 src/procmsg.c; cvs diff -u -r 1.69 -r 1.70 src/procmsg.h; cvs diff -u -r 1.51 -r 1.52 src/common/utils.c; cvs diff -u -r 1.7 -r 1.8 src/gtk/menu.h; ) > 0.9.12cvs83.patchset
index 59eba31..42a3b25 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=82
+EXTRA_VERSION=83
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index 6bbc316..c0b6cf7 100644 (file)
@@ -3020,6 +3020,7 @@ gchar *file_read_stream_to_str(FILE *fp)
 gint execute_async(gchar *const argv[])
 {
        pid_t pid;
+       gint status;
 
        if ((pid = fork()) < 0) {
                perror("fork");
@@ -3044,14 +3045,18 @@ gint execute_async(gchar *const argv[])
                _exit(0);
        }
 
-       waitpid(pid, NULL, 0);
+       waitpid(pid, &status, 0);
 
-       return 0;
+       if (WIFEXITED(status))
+               return WEXITSTATUS(status);
+       else
+               return -1;
 }
 
 gint execute_sync(gchar *const argv[])
 {
        pid_t pid;
+       gint status;
 
        if ((pid = fork()) < 0) {
                perror("fork");
@@ -3065,9 +3070,12 @@ gint execute_sync(gchar *const argv[])
                _exit(1);
        }
 
-       waitpid(pid, NULL, 0);
+       waitpid(pid, &status, 0);
 
-       return 0;
+       if (WIFEXITED(status))
+               return WEXITSTATUS(status);
+       else
+               return -1;
 }
 
 gint execute_command_line(const gchar *cmdline, gboolean async)
@@ -3075,12 +3083,15 @@ gint execute_command_line(const gchar *cmdline, gboolean async)
        gchar **argv;
        gint ret;
 
+       debug_print("executing: %s\n", cmdline);
+
        argv = strsplit_with_quote(cmdline, " ", 0);
 
        if (async)
                ret = execute_async(argv);
        else
                ret = execute_sync(argv);
+
        g_strfreev(argv);
 
        return ret;
@@ -3167,11 +3178,12 @@ gint open_uri(const gchar *uri, const gchar *cmdline)
                g_snprintf(buf, sizeof(buf), cmdline, encoded_uri);
        else {
                if (cmdline)
-                       g_warning("Open URI command line is invalid: `%s'",
+                       g_warning("Open URI command line is invalid "
+                                 "(there must be only one '%%s'): %s",
                                  cmdline);
                g_snprintf(buf, sizeof(buf), DEFAULT_BROWSER_CMD, encoded_uri);
        }
-       
+
        execute_command_line(buf, TRUE);
 
        return 0;
index 2d3771c..00e780f 100644 (file)
 #include <gtk/gtkmenushell.h>
 #include <gtk/gtkoptionmenu.h>
 
-#define MENUITEM_ADD(menu, menuitem, label, data) \
-{ \
-       menuitem = gtk_menu_item_new_with_label(label); \
-       gtk_widget_show(menuitem); \
-       gtk_menu_append(GTK_MENU(menu), menuitem); \
-       if (data) \
-               gtk_object_set_user_data(GTK_OBJECT(menuitem), \
+#define MENUITEM_ADD(menu, menuitem, label, data)               \
+{                                                               \
+       if (label)                                               \
+               menuitem = gtk_menu_item_new_with_label(label);  \
+       else {                                                   \
+               menuitem = gtk_menu_item_new();                  \
+               gtk_widget_set_sensitive(menuitem, FALSE);       \
+       }                                                        \
+       gtk_widget_show(menuitem);                               \
+       gtk_menu_append(GTK_MENU(menu), menuitem);               \
+       if (data)                                                \
+               gtk_object_set_user_data(GTK_OBJECT(menuitem),   \
                                         GINT_TO_POINTER(data)); \
 }
 
index c9dd920..f2dc8aa 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
@@ -689,7 +689,6 @@ static gint mh_remove_folder(Folder *folder, FolderItem *item)
 
 static MsgInfo *mh_parse_msg(const gchar *file, FolderItem *item)
 {
-       struct stat s;
        MsgInfo *msginfo;
        MsgFlags flags;
 
@@ -705,20 +704,11 @@ static MsgInfo *mh_parse_msg(const gchar *file, FolderItem *item)
                MSG_SET_TMP_FLAGS(flags, MSG_DRAFT);
        }
 
-       if (stat(file, &s) < 0) {
-               FILE_OP_ERROR(file, "stat");
-               return NULL;
-       }
-       if (!S_ISREG(s.st_mode))
-               return NULL;
-
        msginfo = procheader_parse_file(file, flags, FALSE, FALSE);
        if (!msginfo) return NULL;
 
        msginfo->msgnum = atoi(file);
        msginfo->folder = item;
-       msginfo->size = s.st_size;
-       msginfo->mtime = s.st_mtime;
 
        return msginfo;
 }
index e54f296..f9f5784 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2004 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>
+#include <sys/stat.h>
 
 #include "intl.h"
 #include "procheader.h"
@@ -465,9 +466,17 @@ void procheader_get_header_fields(FILE *fp, HeaderEntry hentry[])
 MsgInfo *procheader_parse_file(const gchar *file, MsgFlags flags,
                               gboolean full, gboolean decrypted)
 {
+       struct stat s;
        FILE *fp;
        MsgInfo *msginfo;
 
+       if (stat(file, &s) < 0) {
+               FILE_OP_ERROR(file, "stat");
+               return NULL;
+       }
+       if (!S_ISREG(s.st_mode))
+               return NULL;
+
        if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return NULL;
@@ -475,6 +484,12 @@ MsgInfo *procheader_parse_file(const gchar *file, MsgFlags flags,
 
        msginfo = procheader_parse_stream(fp, flags, full, decrypted);
        fclose(fp);
+
+       if (msginfo) {
+               msginfo->size = s.st_size;
+               msginfo->mtime = s.st_mtime;
+       }
+
        return msginfo;
 }
 
index f6b71f1..2ba52b1 100644 (file)
@@ -850,6 +850,7 @@ MsgInfo *procmsg_msginfo_copy(MsgInfo *msginfo)
        MEMBCOPY(size);
        MEMBCOPY(mtime);
        MEMBCOPY(date_t);
+
        MEMBCOPY(flags);
 
        MEMBDUP(fromname);
@@ -874,6 +875,7 @@ MsgInfo *procmsg_msginfo_copy(MsgInfo *msginfo)
 
        MEMBCOPY(score);
        MEMBCOPY(threadscore);
+       MEMBDUP(plaintext_file);
 
        return newmsginfo;
 }
@@ -955,6 +957,8 @@ void procmsg_msginfo_free(MsgInfo *msginfo)
        g_free(msginfo->partial_recv);
        g_free(msginfo->account_server);
        g_free(msginfo->account_login);
+       
+       g_free(msginfo->plaintext_file);
 
        g_free(msginfo);
 }
index d084427..f1e3582 100644 (file)
@@ -203,7 +203,6 @@ struct _MsgInfo
 
        /* used only for encrypted messages */
        gchar *plaintext_file;
-       guint decryption_failed : 1;
         
         gint hidden;