diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-09-14 08:27:22 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-09-14 08:27:22 +0000 |
commit | 02bd27c2ad7c50f5d82c2d54bd060debba152c18 (patch) | |
tree | 8793b6e391ca69f1048cd090fb09762a1c470fdb /src/import.c | |
parent | 42b083e0e77ab7b930d0cfa04ab42663e80e79ae (diff) |
update summary cache on eml import.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2250 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/import.c')
-rw-r--r-- | src/import.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/import.c b/src/import.c index 0d5e757b..3ff67bad 100644 --- a/src/import.c +++ b/src/import.c @@ -51,6 +51,8 @@ #include "gtkutils.h" #include "manage_window.h" #include "folder.h" +#include "procmsg.h" +#include "procheader.h" #include "progressdialog.h" #include "alertpanel.h" @@ -240,6 +242,8 @@ static gint import_eml_folder(FolderItem *dest, const gchar *path) GDir *dir; const gchar *dir_name, *p; gchar *file; + MsgInfo *msginfo; + MsgFlags flags = {MSG_NEW|MSG_UNREAD, MSG_RECEIVED}; gint count = 0; gint ok = 0; @@ -262,11 +266,19 @@ static gint import_eml_folder(FolderItem *dest, const gchar *path) continue; } + msginfo = procheader_parse_file(file, flags, FALSE); + if (!msginfo) { + g_warning("import_eml_folder(): procheader_parse_file() failed."); + g_free(file); + continue; + } + msginfo->file_path = file; + file = NULL; count++; proc_mbox_func(dest->folder, dest, GINT_TO_POINTER(count)); - ok = folder_item_add_msg(dest, file, NULL, FALSE); - g_free(file); + ok = folder_item_add_msg_msginfo(dest, msginfo, FALSE); + procmsg_msginfo_free(msginfo); if (ok < 0) { g_warning("import_eml_folder(): folder_item_add_msg() failed."); break; |