diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-09-03 07:22:25 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-09-03 07:22:25 +0000 |
commit | d13865f1395d65bed655a800ccd6886a8e525951 (patch) | |
tree | aa05275fad774b0f2b947b13ff08eaea3d0f4645 /libsylph | |
parent | 28641e084acc8b042448c788fe32c74a983b4bc0 (diff) |
show progress when scanning folders.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2230 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/mh.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libsylph/mh.c b/libsylph/mh.c index 11099f76..5852e7c8 100644 --- a/libsylph/mh.c +++ b/libsylph/mh.c @@ -1279,8 +1279,12 @@ static GSList *mh_get_uncached_msgs(GHashTable *msg_table, FolderItem *item) MsgInfo *msginfo; gint n_newmsg = 0; gint num; + Folder *folder; g_return_val_if_fail(item != NULL, NULL); + g_return_val_if_fail(item->folder != NULL, NULL); + + folder = item->folder; path = folder_item_get_path(item); g_return_val_if_fail(path != NULL, NULL); @@ -1298,6 +1302,8 @@ static GSList *mh_get_uncached_msgs(GHashTable *msg_table, FolderItem *item) debug_print("Searching uncached messages...\n"); if (msg_table) { + gint count = 0; + while ((dir_name = g_dir_read_name(dp)) != NULL) { if ((num = to_number(dir_name)) <= 0) continue; @@ -1320,6 +1326,10 @@ static GSList *mh_get_uncached_msgs(GHashTable *msg_table, FolderItem *item) } n_newmsg++; } + + count++; + if (folder->ui_func) + folder->ui_func(folder, item, folder->ui_func_data ? folder->ui_func_data : GINT_TO_POINTER(count)); } } else { /* discard all previous cache */ @@ -1336,6 +1346,8 @@ static GSList *mh_get_uncached_msgs(GHashTable *msg_table, FolderItem *item) last = last->next; } n_newmsg++; + if (folder->ui_func) + folder->ui_func(folder, item, folder->ui_func_data ? folder->ui_func_data : GINT_TO_POINTER(n_newmsg)); } } |