diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-12-02 11:55:18 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-12-02 11:55:18 +0800 |
commit | 787d1833c052cc1acf54a1d7fae5c350bdec4f94 (patch) | |
tree | d6408ab60d0c3f876ce04f3570ffa1e35b92206f /camel/camel-folder-summary.c | |
parent | cd372acdcf941fa20889518a4ff90180ef4f0a64 (diff) | |
download | gsoc2013-evolution-787d1833c052cc1acf54a1d7fae5c350bdec4f94.tar.gz gsoc2013-evolution-787d1833c052cc1acf54a1d7fae5c350bdec4f94.tar.zst gsoc2013-evolution-787d1833c052cc1acf54a1d7fae5c350bdec4f94.zip |
Added system_flag to CamelFolderSearchClass
2000-12-01 Jeffrey Stedfast <fejj@helixcode.com>
* camel-folder-search.h: Added system_flag to CamelFolderSearchClass
* camel-folder-summary.c (camel_system_flag_get): Convenience
function to return whether or not a flag is set using a string as
the flag name.
(camel_system_flag): Return the integer value of the flag string.
* camel-folder-search.c (search_system_flag): New ESExp callback
for allowing vfoldering on CamelMessageInfo flags.
svn path=/trunk/; revision=6763
Diffstat (limited to 'camel/camel-folder-summary.c')
-rw-r--r-- | camel/camel-folder-summary.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index b7b9b9c421..8ea51a7bbf 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -2138,6 +2138,56 @@ void camel_tag_list_free(CamelTag **list) *list = NULL; } +struct flag_names_t { + char *name; + guint32 value; +} flag_names[] = { + { "answered", CAMEL_MESSAGE_ANSWERED }, + { "deleted", CAMEL_MESSAGE_DELETED }, + { "draft", CAMEL_MESSAGE_DELETED }, + { "flagged", CAMEL_MESSAGE_FLAGGED }, + { "seen", CAMEL_MESSAGE_SEEN }, + { "attachments", CAMEL_MESSAGE_ATTACHMENTS }, + { NULL, 0 } +}; + +/** + * camel_system_flag: + * @name: + * + * Returns the integer value of the flag string. + **/ +guint32 +camel_system_flag (const char *name) +{ + struct flag_names_t *flag; + + g_return_val_if_fail (name != NULL, 0); + + for (flag = flag_names; *flag->name; flag++) + if (!g_strcasecmp (name, flag->name)) + return flag->value; + + return 0; +} + +/** + * camel_system_flag_get: + * @flags: + * @name: + * + * Find the state of the flag @name in @flags. + * + * Return value: The state of the flag (TRUE or FALSE). + **/ +gboolean +camel_system_flag_get (guint32 flags, const char *name) +{ + g_return_val_if_fail (name != NULL, FALSE); + + return flags & camel_system_flag (name); +} + /** * camel_message_info_new: |