aboutsummaryrefslogtreecommitdiff
path: root/libsylph/imap.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-09-05 10:40:39 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-09-05 10:40:39 +0000
commitf93364c744fcb1c8b9cdc9bbe29fa4e1416be3b2 (patch)
tree0be10a6ab0769014541badb07b5c5e6298f34a75 /libsylph/imap.c
parent3bf24b9336184fe9e28f7e09b9c5200a5f82b7d2 (diff)
imap.c: show progress when executing operations which takes long time.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@549 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/imap.c')
-rw-r--r--libsylph/imap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libsylph/imap.c b/libsylph/imap.c
index a179c23c..007c232c 100644
--- a/libsylph/imap.c
+++ b/libsylph/imap.c
@@ -1147,6 +1147,8 @@ static gint imap_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
guint32 last_uid = 0;
GSList *cur;
MsgFileInfo *fileinfo;
+ gint count = 1;
+ gint total;
gint ok;
g_return_val_if_fail(folder != NULL, -1);
@@ -1170,6 +1172,8 @@ static gint imap_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
if (first)
*first = uid_next;
+ total = g_slist_length(file_list);
+
for (cur = file_list; cur != NULL; cur = cur->next) {
IMAPFlags iflags = 0;
guint32 new_uid = 0;
@@ -1191,6 +1195,8 @@ static gint imap_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
dest->stype == F_TRASH)
iflags |= IMAP_FLAG_SEEN;
+ print_status(_("appending message (%d / %d)"), count++, total);
+
ok = imap_cmd_append(session, destdir, fileinfo->file, iflags,
&new_uid);
@@ -2228,6 +2234,7 @@ static GSList *imap_get_uncached_messages(IMAPSession *session,
GString *str;
MsgInfo *msginfo;
gchar seq_set[22];
+ gint count = 1;
g_return_val_if_fail(session != NULL, NULL);
g_return_val_if_fail(item != NULL, NULL);
@@ -2248,6 +2255,8 @@ static GSList *imap_get_uncached_messages(IMAPSession *session,
str = g_string_new(NULL);
for (;;) {
+ print_status(_("getting headers of message %d"), count++);
+
if (sock_getline(SESSION(session)->sock, &tmp) < 0) {
log_warning(_("error occurred while getting envelope.\n"));
g_string_free(str, TRUE);