diff options
author | Not Zed <NotZed@Ximian.com> | 2004-02-06 14:31:02 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-02-06 14:31:02 +0800 |
commit | 734a27187b7c4495f377c8533f9affdcf860dbbc (patch) | |
tree | d4e7496e6844564a592706e0fd3f74e5d4d0e4c6 /camel/camel-folder.c | |
parent | 9fe2942fe8ed2a561c9a3098f8a3655ae2691fcd (diff) | |
download | gsoc2013-evolution-734a27187b7c4495f377c8533f9affdcf860dbbc.tar.gz gsoc2013-evolution-734a27187b7c4495f377c8533f9affdcf860dbbc.tar.zst gsoc2013-evolution-734a27187b7c4495f377c8533f9affdcf860dbbc.zip |
changed to return a boolean to indicate if the flags were actually changed
2004-02-06 Not Zed <NotZed@Ximian.com>
* camel-folder.c (camel_folder_set_message_flags): changed to
return a boolean to indicate if the flags were actually changed or
not. Fixed all implementors.
svn path=/trunk/; revision=24643
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r-- | camel/camel-folder.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c index b3a7b93713..602f8afdd1 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -62,18 +62,16 @@ static const gchar *get_name (CamelFolder *folder); static const gchar *get_full_name (CamelFolder *folder); static CamelStore *get_parent_store (CamelFolder *folder); -static guint32 get_permanent_flags (CamelFolder *folder); -static guint32 get_message_flags (CamelFolder *folder, const char *uid); -static void set_message_flags (CamelFolder *folder, const char *uid, - guint32 flags, guint32 set); -static gboolean get_message_user_flag (CamelFolder *folder, const char *uid, const char *name); -static void set_message_user_flag (CamelFolder *folder, const char *uid, - const char *name, gboolean value); +static guint32 get_permanent_flags(CamelFolder *folder); +static guint32 get_message_flags(CamelFolder *folder, const char *uid); +static gboolean set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set); +static gboolean get_message_user_flag(CamelFolder *folder, const char *uid, const char *name); +static void set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gboolean value); static const char *get_message_user_tag(CamelFolder *folder, const char *uid, const char *name); static void set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value); -static gint get_message_count (CamelFolder *folder); -static gint get_unread_message_count (CamelFolder *folder); +static gint get_message_count(CamelFolder *folder); +static gint get_unread_message_count(CamelFolder *folder); static void expunge (CamelFolder *folder, CamelException *ex); @@ -681,29 +679,31 @@ camel_folder_get_message_flags (CamelFolder *folder, const char *uid) return ret; } -static void +static gboolean set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set) { CamelMessageInfo *info; guint32 new; - g_return_if_fail(folder->summary != NULL); + g_return_val_if_fail(folder->summary != NULL, FALSE); info = camel_folder_summary_uid(folder->summary, uid); if (info == NULL) - return; + return FALSE; new = (info->flags & ~flags) | (set & flags); if (new == info->flags) { camel_folder_summary_info_free(folder->summary, info); - return; + return FALSE; } info->flags = new | CAMEL_MESSAGE_FOLDER_FLAGGED; camel_folder_summary_touch(folder->summary); camel_folder_summary_info_free(folder->summary, info); - camel_object_trigger_event (folder, "message_changed", (char *) uid); + camel_object_trigger_event(folder, "message_changed", (char *) uid); + + return TRUE; } /** @@ -716,17 +716,17 @@ set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 s * Sets those flags specified by @set to the values specified by @flags * on the indicated message. (This may or may not persist after the * folder or store is closed. See camel_folder_get_permanent_flags().) + * + * Return Value: TRUE if the flags were changed, false otherwise. **/ -void -camel_folder_set_message_flags (CamelFolder *folder, const char *uid, - guint32 flags, guint32 set) +gboolean +camel_folder_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set) { - g_return_if_fail (CAMEL_IS_FOLDER (folder)); + g_return_val_if_fail(CAMEL_IS_FOLDER(folder), FALSE); - CF_CLASS (folder)->set_message_flags (folder, uid, flags, set); + return CF_CLASS(folder)->set_message_flags(folder, uid, flags, set); } - static gboolean get_message_user_flag(CamelFolder *folder, const char *uid, const char *name) { |