diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-08-03 09:00:07 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-08-03 09:00:07 +0000 |
commit | 7977d19f80b9e1b901bb00d507681126e279d0f1 (patch) | |
tree | 829c71bd7fe1be1dacdbc8c93bc0a1d4029813c8 /libsylph | |
parent | bfbde319d3c708eb10031534725034c675dbe35a (diff) |
reflect account preference for trash folder.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2931 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/folder.c | 20 | ||||
-rw-r--r-- | libsylph/folder.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/libsylph/folder.c b/libsylph/folder.c index 3d29740f..fb5b983d 100644 --- a/libsylph/folder.c +++ b/libsylph/folder.c @@ -986,6 +986,26 @@ void folder_set_junk(Folder *folder, FolderItem *item) priv->junk = item; } +gboolean folder_item_is_trash(FolderItem *item) +{ + PrefsAccount *ac; + FolderItem *trash; + + g_return_val_if_fail(item != NULL, FALSE); + + if (item->stype == F_TRASH) + return TRUE; + + ac = account_find_from_item_property(item); + if (ac && ac->set_trash_folder && ac->trash_folder) { + trash = folder_find_item_from_identifier(ac->trash_folder); + if (trash == item) + return TRUE; + } + + return FALSE; +} + #define CREATE_FOLDER_IF_NOT_EXIST(member, dir, type) \ { \ if (!folder->member) { \ diff --git a/libsylph/folder.h b/libsylph/folder.h index e989f9bb..221f3e23 100644 --- a/libsylph/folder.h +++ b/libsylph/folder.h @@ -390,6 +390,8 @@ FolderItem *folder_get_default_queue (void); FolderItem *folder_get_default_trash (void); FolderItem *folder_get_default_junk (void); +gboolean folder_item_is_trash (FolderItem *item); + FolderItem *folder_get_junk (Folder *folder); void folder_set_junk (Folder *folder, FolderItem *item); |