From 8d4e508f40ad5910d240868b6885ab9473751b78 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 5 Dec 2000 16:46:15 +0000 Subject: Fix the check for "flags aren't actually changing". * providers/imap/camel-imap-folder.c (imap_set_message_flags): Fix the check for "flags aren't actually changing". * providers/local/camel-local-folder.c (local_set_message_flags, local_set_message_user_flag, local_set_message_user_tag): Don't emit message_changed unless the flags actually changed. * providers/nntp/camel-nntp-folder.c (nntp_folder_set_message_flags): Don't emit message_changed unless the flags actually changed. Fix the check for marked as seen. svn path=/trunk/; revision=6797 --- camel/camel-folder-summary.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'camel/camel-folder-summary.c') diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 8ea51a7bbf..9a6a96c273 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -1977,8 +1977,10 @@ camel_flag_get(CamelFlag **list, const char *name) * @value: * * Set the state of a flag @name in the list @list to @value. + * + * Return value: Whether or not it changed. **/ -void +gboolean camel_flag_set(CamelFlag **list, const char *name, gboolean value) { CamelFlag *flag, *tmp; @@ -1992,7 +1994,7 @@ camel_flag_set(CamelFlag **list, const char *name, gboolean value) flag->next = tmp->next; g_free(tmp); } - return; + return !value; } flag = tmp; } @@ -2003,6 +2005,7 @@ camel_flag_set(CamelFlag **list, const char *name, gboolean value) tmp->next = 0; flag->next = tmp; } + return value; } /** @@ -2046,7 +2049,8 @@ camel_flag_list_free(CamelFlag **list) *list = NULL; } -const char *camel_tag_get(CamelTag **list, const char *name) +const char +*camel_tag_get(CamelTag **list, const char *name) { CamelTag *tag; @@ -2066,8 +2070,11 @@ const char *camel_tag_get(CamelTag **list, const char *name) * @value: * * Set the tag @name in the tag list @list to @value. + * + * Return value: whether or not it changed **/ -void camel_tag_set(CamelTag **list, const char *name, const char *value) +gboolean +camel_tag_set(CamelTag **list, const char *name, const char *value) { CamelTag *tag, *tmp; @@ -2080,11 +2087,13 @@ void camel_tag_set(CamelTag **list, const char *name, const char *value) tag->next = tmp->next; g_free(tmp->value); g_free(tmp); + return TRUE; } else if (strcmp(tmp->value, value)) { /* has it changed? */ g_free(tmp->value); tmp->value = g_strdup(value); + return TRUE; } - return; + return FALSE; } tag = tmp; } @@ -2095,7 +2104,9 @@ void camel_tag_set(CamelTag **list, const char *name, const char *value) tmp->value = g_strdup(value); tmp->next = 0; tag->next = tmp; + return TRUE; } + return FALSE; } /** -- cgit v1.2.3