From d13865f1395d65bed655a800ccd6886a8e525951 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 3 Sep 2009 07:22:25 +0000 Subject: show progress when scanning folders. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2230 ee746299-78ed-0310-b773-934348b2243d --- libsylph/mh.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libsylph/mh.c') 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)); } } -- cgit v1.2.3