+2002-04-21
+
+ * src/mh.c: mh_get_new_msg_filename(): new. It returns the filename
+ for new message.
+ mh_add_msg()
+ mh_do_move()
+ mh_do_move_msgs_with_dest()
+ mh_copy_msg()
+ mh_copy_msgs_with_dest(): use mh_get_new_msg_filename().
+ * src/utils.[ch]: added is_file_entry_exist() which returns TRUE
+ if stat() succeeded.
+ * src/imap.c:
+ imap_fetch_msg(): SELECT mailbox before FETCH if required.
+ imap_scan_folder(): set last_num using the value of UIDNEXT.
+ imap_select(): return immediately if there is no need for SELECT.
+ preserve the path of currently selected mailbox.
+ imap_status(): added UIDNEXT.
+
+2002-04-20
+
+ * src/folder.c: folder_item_scan(): removed the warning.
+ * src/inputdialog.[ch]: input_dialog_combo(): added an argument for
+ setting case sensitivity.
+
2002-04-17
* src/mainwindow.c: main_window_create(): restrict the minimum size.
+2002-04-21 [paul] 0.7.4claws85
+
+ * sync with 0.7.4cvs49
+ see ChangeLog entries 2002-04-20 and 2002-04-21
+
+ * src/Makefile.am
+ clean up: remove old 'stock_' element from xpm
+ filenames.
+
2002-04-21 [alfons] 0.7.4claws84
apply sync patch from Paul
+2002-04-21
+
+ * src/mh.c: mh_get_new_msg_filename(): ¿·µ¬¡£¿·µ¬¥á¥Ã¥»¡¼¥¸¤Î¥Õ¥¡¥¤¥ë
+ ̾¤òÊÖ¤¹¡£
+ mh_add_msg()
+ mh_do_move()
+ mh_do_move_msgs_with_dest()
+ mh_copy_msg()
+ mh_copy_msgs_with_dest(): mh_get_new_msg_filename() ¤ò»ÈÍÑ¡£
+ * src/utils.[ch]: is_file_entry_exist() ¤òÄɲᣠstat() ¤¬À®¸ù¤·¤¿¤é
+ TRUE ¤òÊÖ¤¹¡£
+ * src/imap.c:
+ imap_fetch_msg(): ɬÍפǤ¢¤ì¤Ð FETCH ¤ÎÁ°¤Ë¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤ò SELECT
+ ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+ imap_scan_folder(): UIDNEXT ¤ÎÃͤòÍѤ¤¤Æ last_num ¤ò¥»¥Ã¥È¡£
+ imap_select(): SELECT ¤ÎɬÍפ¬¤Ê¤±¤ì¤Ð¤¹¤°¤ËÊÖ¤ë¤è¤¦¤Ë¤·¤¿¡£
+ ¸½ºßÁªÂòÃæ¤Î¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤Î¥Ñ¥¹¤òÊݸ¡£
+ imap_status(): UIDNEXT ¤òÄɲá£
+
+2002-04-20
+
+ * src/folder.c: folder_item_scan(): ·Ù¹ð¤ò½üµî¡£
+ * src/inputdialog.[ch]: input_dialog_combo(): Â羮ʸ»ú¤Î¶èÊ̤λØÄê¤Î
+ ¤¿¤á¤Î°ú¿ô¤òÄɲá£
+
2002-04-17
* src/mainwindow.c: main_window_create(): ºÇ¾®¥µ¥¤¥º¤òÀ©¸Â¡£
MICRO_VERSION=4
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws84
+EXTRA_VERSION=claws85
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
pixmaps/continue.xpm \
pixmaps/complete.xpm \
pixmaps/error.xpm \
- pixmaps/stock_mail.xpm \
- pixmaps/stock_mail_attach.xpm \
- pixmaps/stock_mail_receive.xpm \
- pixmaps/stock_mail_receive_all.xpm \
- pixmaps/stock_mail_send.xpm \
- pixmaps/stock_mail_send_queue.xpm \
- pixmaps/stock_mail_compose.xpm \
- pixmaps/stock_news_compose.xpm \
- pixmaps/stock_mail_reply.xpm \
- pixmaps/stock_mail_reply_to_all.xpm \
- pixmaps/stock_mail_reply_to_author.xpm \
- pixmaps/stock_mail_forward.xpm \
- pixmaps/stock_preferences.xpm \
- pixmaps/stock_properties.xpm \
- pixmaps/stock_search.xpm \
- pixmaps/stock_close.xpm \
- pixmaps/stock_exec.xpm \
- pixmaps/stock_trash.xpm \
- pixmaps/stock_up_arrow.xpm \
- pixmaps/stock_down_arrow.xpm \
- pixmaps/stock_paste.xpm \
+ pixmaps/mail.xpm \
+ pixmaps/mail_attach.xpm \
+ pixmaps/mail_receive.xpm \
+ pixmaps/mail_receive_all.xpm \
+ pixmaps/mail_send.xpm \
+ pixmaps/mail_send_queue.xpm \
+ pixmaps/mail_compose.xpm \
+ pixmaps/news_compose.xpm \
+ pixmaps/mail_reply.xpm \
+ pixmaps/mail_reply_to_all.xpm \
+ pixmaps/mail_reply_to_author.xpm \
+ pixmaps/mail_forward.xpm \
+ pixmaps/preferences.xpm \
+ pixmaps/properties.xpm \
+ pixmaps/search.xpm \
+ pixmaps/close.xpm \
+ pixmaps/exec.xpm \
+ pixmaps/trash.xpm \
+ pixmaps/up_arrow.xpm \
+ pixmaps/down_arrow.xpm \
+ pixmaps/paste.xpm \
pixmaps/tb_address_book.xpm \
pixmaps/sylpheed-logo.xpm \
pixmaps/address.xpm \
{
Folder *folder;
- g_return_if_fail(item != NULL);
+ g_return_val_if_fail(item != NULL, -1);
folder = item->folder;
return folder->scan(folder, item);
const gchar *path,
gint *messages,
gint *recent,
- gint *unseen,
- guint32 *uid_validity);
+ guint32 *uid_next,
+ guint32 *uid_validity,
+ gint *unseen);
static void imap_parse_namespace (IMAPSession *session,
IMAPFolder *folder);
return NULL;
}
+ ok = imap_select(session, IMAP_FOLDER(folder), item->path,
+ NULL, NULL, NULL, NULL);
+ statusbar_pop_all();
+ if (ok != IMAP_SUCCESS) {
+ g_warning(_("can't select mailbox %s\n"), item->path);
+ g_free(filename);
+ return NULL;
+ }
+
debug_print(_("getting message %d...\n"), uid);
ok = imap_cmd_fetch(SESSION(session)->sock, (guint32)uid, filename);
{
IMAPSession *session;
gint messages, recent, unseen;
- guint32 uid_validity;
+ guint32 uid_next, uid_validity;
gint ok;
g_return_val_if_fail(folder != NULL, -1);
if (!session) return -1;
ok = imap_status(session, IMAP_FOLDER(folder), item->path,
- &messages, &recent, &unseen, &uid_validity);
+ &messages, &recent, &uid_next, &uid_validity, &unseen);
statusbar_pop_all();
if (ok != IMAP_SUCCESS) return -1;
item->new = unseen > 0 ? recent : 0;
item->unread = unseen;
item->total = messages;
+ item->last_num = (messages > 0 && uid_next > 0) ? uid_next - 1 : 0;
/* item->mtime = uid_validity; */
return 0;
real_oldpath = imap_get_real_path(IMAP_FOLDER(folder), item->path);
+ g_free(session->mbox);
+ session->mbox = NULL;
ok = imap_cmd_examine(SESSION(session)->sock, "INBOX",
&exists, &recent, &unseen, &uid_validity);
statusbar_pop_all();
{
gchar *real_path;
gint ok;
+ gint exists_, recent_, unseen_, uid_validity_;
+
+ if (!exists || !recent || !unseen || !uid_validity) {
+ if (session->mbox && strcmp(session->mbox, path) == 0)
+ return IMAP_SUCCESS;
+ exists = &exists_;
+ recent = &recent_;
+ unseen = &unseen_;
+ uid_validity = &uid_validity_;
+ }
+
+ g_free(session->mbox);
+ session->mbox = NULL;
real_path = imap_get_real_path(folder, path);
ok = imap_cmd_select(SESSION(session)->sock, real_path,
exists, recent, unseen, uid_validity);
if (ok != IMAP_SUCCESS)
log_warning(_("can't select folder: %s\n"), real_path);
+ else
+ session->mbox = g_strdup(path);
g_free(real_path);
return ok;
static gint imap_status(IMAPSession *session, IMAPFolder *folder,
const gchar *path,
- gint *messages, gint *recent, gint *unseen,
- guint32 *uid_validity)
+ gint *messages, gint *recent,
+ guint32 *uid_next, guint32 *uid_validity,
+ gint *unseen)
{
gchar *real_path;
gchar *real_path_;
GPtrArray *argbuf;
gchar *str;
- *messages = *recent = *unseen = *uid_validity = 0;
+ *messages = *recent = *uid_next = *uid_validity = *unseen = 0;
argbuf = g_ptr_array_new();
real_path = imap_get_real_path(folder, path);
QUOTE_IF_REQUIRED(real_path_, real_path);
imap_cmd_gen_send(SESSION(session)->sock, "STATUS %s "
- "(MESSAGES RECENT UNSEEN UIDVALIDITY)", real_path_);
+ "(MESSAGES RECENT UIDNEXT UIDVALIDITY UNSEEN)",
+ real_path_);
ok = imap_cmd_ok(SESSION(session)->sock, argbuf);
if (ok != IMAP_SUCCESS) THROW(ok);
} else if (!strncmp(str, "RECENT ", 7)) {
str += 7;
*recent = strtol(str, &str, 10);
- } else if (!strncmp(str, "UNSEEN ", 7)) {
- str += 7;
- *unseen = strtol(str, &str, 10);
+ } else if (!strncmp(str, "UIDNEXT ", 8)) {
+ str += 8;
+ *uid_next = strtoul(str, &str, 10);
} else if (!strncmp(str, "UIDVALIDITY ", 12)) {
str += 12;
*uid_validity = strtoul(str, &str, 10);
+ } else if (!strncmp(str, "UNSEEN ", 7)) {
+ str += 7;
+ *unseen = strtol(str, &str, 10);
} else {
g_warning("invalid STATUS response: %s\n", str);
break;
}
gchar *input_dialog_combo(const gchar *title, const gchar *message,
- const gchar *default_string, GList *list)
+ const gchar *default_string, GList *list,
+ gboolean case_sensitive)
{
if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
} else
gtk_combo_set_popdown_strings(GTK_COMBO(combo), list);
+ gtk_combo_set_case_sensitive(GTK_COMBO(combo), case_sensitive);
+
return input_dialog_open(title, message, default_string);
}
gchar *input_dialog_combo (const gchar *title,
const gchar *message,
const gchar *default_string,
- GList *list);
+ GList *list,
+ gboolean case_sensitive);
gchar *input_dialog_query_password (const gchar *server,
const gchar *user);
const gchar *name,
const gchar *path);
+static gchar *mh_get_new_msg_filename (FolderItem *dest);
+
static GSList *mh_get_uncached_msgs (GHashTable *msg_table,
FolderItem *item);
static MsgInfo *mh_parse_msg (const gchar *file,
return file;
}
-gchar *mh_get_newmsg_filename(FolderItem *dest)
+static gchar *mh_get_new_msg_filename(FolderItem *dest)
{
gchar *destfile;
gchar *destpath;
- gboolean found = FALSE;
destpath = folder_item_get_path(dest);
g_return_val_if_fail(destpath != NULL, NULL);
+
if (!is_dir_exist(destpath))
make_dir_hier(destpath);
- do {
+ for (;;) {
destfile = g_strdup_printf("%s%c%d", destpath, G_DIR_SEPARATOR,
dest->last_num + 1);
- if(is_file_exist(destfile)) {
+ if (is_file_entry_exist(destfile)) {
dest->last_num++;
g_free(destfile);
- } else {
- found = TRUE;
- }
- } while(!found);
+ } else
+ break;
+ }
+
g_free(destpath);
return destfile;
if (dest->last_num < 0) return -1;
}
- destfile = mh_get_newmsg_filename(dest);
- if(!destfile) return -1;
+ destfile = mh_get_new_msg_filename(dest);
+ g_return_val_if_fail(destfile != NULL, -1);
if (link(file, destfile) < 0) {
if (copy_file(file, destfile) < 0) {
prefs = dest->prefs;
- destdir = folder_item_get_path(dest);
+ destfile = mh_get_new_msg_filename(dest);
+ g_return_val_if_fail(destfile != NULL, -1);
debug_print(_("Moving message %s%c%d to %s ...\n"),
msginfo->folder->path, G_DIR_SEPARATOR,
msginfo->msgnum, dest->path);
srcfile = procmsg_get_message_file(msginfo);
- destfile = mh_get_newmsg_filename(dest);
+ destfile = mh_get_new_msg_filename(dest);
if(!destfile) return -1;
+ srcfile = procmsg_get_message_file(msginfo);
if (move_file(srcfile, destfile) < 0) {
g_free(srcfile);
g_free(destfile);
- g_free(destdir);
return -1;
}
g_free(destfile);
dest->last_num++;
+ destdir = folder_item_get_path(dest);
if ((fp = procmsg_open_mark_file(destdir, TRUE)) == NULL)
g_warning(_("Can't open mark file.\n"));
else {
msginfo->folder->path, G_DIR_SEPARATOR,
msginfo->msgnum, dest->path);
+ destfile = mh_get_new_msg_filename(dest);
+ if (!destfile) break;
srcfile = procmsg_get_message_file(msginfo);
- destfile = mh_get_newmsg_filename(dest);
+ destfile = mh_get_new_msg_filename(dest);
if(!destfile) return -1;
if (move_file(srcfile, destfile) < 0) {
prefs = dest->prefs;
- destdir = folder_item_get_path(dest);
- if (!is_dir_exist(destdir))
- make_dir_hier(destdir);
+ destfile = mh_get_new_msg_filename(dest);
+ g_return_val_if_fail(destfile != NULL, -1);
debug_print(_("Copying message %s%c%d to %s ...\n"),
msginfo->folder->path, G_DIR_SEPARATOR,
msginfo->msgnum, dest->path);
+
srcfile = procmsg_get_message_file(msginfo);
- destfile = mh_get_newmsg_filename(dest);
- if(!destfile) {
- g_free(srcfile);
- if (fp) fclose(fp);
- return -1;
- }
-
- dest->op_count--;
if (copy_file(srcfile, destfile) < 0) {
FILE_OP_ERROR(srcfile, "copy");
g_free(srcfile);
g_free(destfile);
- g_free(destdir);
return -1;
}
g_free(destfile);
dest->last_num++;
+ destdir = folder_item_get_path(dest);
if ((fp = procmsg_open_mark_file(destdir, TRUE)) == NULL)
g_warning(_("Can't open mark file.\n"));
else {
msginfo->folder->path, G_DIR_SEPARATOR,
msginfo->msgnum, dest->path);
+ destfile = mh_get_new_msg_filename(dest);
+ if (!destfile) break;
srcfile = procmsg_get_message_file(msginfo);
- destfile = mh_get_newmsg_filename(dest);
- if(!destfile) {
- g_free(srcfile);
- break;
- }
if (copy_file(srcfile, destfile) < 0) {
FILE_OP_ERROR(srcfile, "copy");
_("Enter the command line to open file:\n"
"(`%s' will be replaced with file name)"),
prefs_common.mime_open_cmd,
- prefs_common.mime_open_cmd_history);
+ prefs_common.mime_open_cmd_history,
+ TRUE);
if (cmd) {
mimeview_view_file(filename, partinfo, cmd);
g_free(prefs_common.mime_open_cmd);
return FALSE;
}
+gboolean is_file_entry_exist(const gchar *file)
+{
+ struct stat s;
+
+ if (stat(file, &s) < 0) {
+ if (ENOENT != errno) FILE_OP_ERROR(file, "stat");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
gint change_dir(const gchar *dir)
{
gchar *prevdir = NULL;
off_t get_file_size (const gchar *file);
off_t get_file_size_as_crlf (const gchar *file);
off_t get_left_file_size (FILE *fp);
+
gboolean file_exist (const gchar *file,
gboolean allow_fifo);
gboolean is_dir_exist (const gchar *dir);
+gboolean is_file_entry_exist (const gchar *file);
+
+#define is_file_exist(file) file_exist(file, FALSE)
+#define is_file_or_fifo_exist(file) file_exist(file, TRUE)
+
gint change_dir (const gchar *dir);
gint make_dir_hier (const gchar *dir);
gint remove_all_files (const gchar *dir);
FILE *my_tmpfile (void);
FILE *str_open_as_stream (const gchar *str);
-#define is_file_exist(file) file_exist(file, FALSE)
-#define is_file_or_fifo_exist(file) file_exist(file, TRUE)
-
/* process execution */
gint execute_async (gchar *const argv[]);
gint execute_sync (gchar *const argv[]);