diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-01-25 06:53:07 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-01-25 06:53:07 +0000 |
commit | 34a24148d4315d15e092760c983ff45115a32e00 (patch) | |
tree | 0592ef51839ecb8ebc2d01ccff57bc11dcb91eb5 /libsylph | |
parent | eca7e29772e97171adbcdad759c11dbd945c7f66 (diff) |
don't show 'Empty trash' dialog if trashed messages don't exist.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@927 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/procmsg.c | 14 | ||||
-rw-r--r-- | libsylph/procmsg.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c index 26abee6a..3487bdf0 100644 --- a/libsylph/procmsg.c +++ b/libsylph/procmsg.c @@ -1188,6 +1188,20 @@ gboolean procmsg_msg_exist(MsgInfo *msginfo) return ret; } +gboolean procmsg_trash_messages_exist(void) +{ + FolderItem *trash; + GList *cur; + + for (cur = folder_get_list(); cur != NULL; cur = cur->next) { + trash = FOLDER(cur->data)->trash; + if (trash && trash->total > 0) + return TRUE; + } + + return FALSE; +} + void procmsg_empty_trash(FolderItem *trash) { if (trash && trash->total > 0) { diff --git a/libsylph/procmsg.h b/libsylph/procmsg.h index 87af5b75..19de310e 100644 --- a/libsylph/procmsg.h +++ b/libsylph/procmsg.h @@ -287,6 +287,7 @@ FILE *procmsg_open_message_decrypted (MsgInfo *msginfo, gboolean procmsg_msg_exist (MsgInfo *msginfo); +gboolean procmsg_trash_messages_exist (void); void procmsg_empty_trash (FolderItem *trash); void procmsg_empty_all_trash (void); |