Re: [evolution-patches] Patch to fix bug #61610, display a message count on draft folders.
- From: Félix Ortega <guile-listas hispafuentes com>
- To: evolution-patches lists ximian com
- Subject: Re: [evolution-patches] Patch to fix bug #61610, display a message count on draft folders.
- Date: Thu, 09 Dec 2004 12:54:30 +0100
El mié, 08-12-2004 a las 09:04 +0800, Not Zed escribió:
> On Tue, 2004-12-07 at 11:48 -0500, Jeffrey Stedfast wrote:
> > a couple things...
> >
> > - I'm not sure this is desirable behaviour? We'll need someone from the
> > UI design team to review this change and give us their opinions on
> > whether or not this should be done...
> Well i know my opnion is that it is desirable, but for some reason
> people want it to show only unread counts, even when it has no
> meaning, so ...
I don't understand this. What is the meaning of unread counts on Drafts
folders?
>
> > - your patch will only work for local folders but Drafts folders can be
> > changed to point to any folder, not just the local drafts folder (e.g.
> > the user might have a drafts folder on his/her imap server).
> There is a function em_utils_folder_is_drafts() for checking this.
>
Thanks for your help, I have changed my patch and now works for every
Draft folder.
> And we'd need a changelog entry too.
I have added this too
--
Félix Ortega Hortigüela <felix ortega hispafuentes com>
Hispafuentes, S.L.
diff -rc --unidirectional-new-file ../evolution-2.0.2/mail/ChangeLog ./mail/ChangeLog
*** ../evolution-2.0.2/mail/ChangeLog Tue Oct 12 05:40:55 2004
--- ./mail/ChangeLog Thu Dec 9 11:06:07 2004
***************
*** 1,3 ****
--- 1,11 ----
+ 2004-12-08 Félix Ortega <guile hispafuentes com>
+
+ ** See bug #61610
+
+ * em-folder-tree-model.c (em_folder_tree_model_set_folder_info): Display
+ the count of messages in Drafts folder(s).
+ * mail-folder-cache.c (update_1folder): Same.
+
2004-10-11 Not Zed <NotZed Ximian com>
** See bug #67408.
diff -rc --unidirectional-new-file ../evolution-2.0.2/mail/em-folder-tree-model.c ./mail/em-folder-tree-model.c
*** ../evolution-2.0.2/mail/em-folder-tree-model.c Fri Sep 24 17:49:29 2004
--- ./mail/em-folder-tree-model.c Thu Dec 9 11:05:16 2004
***************
*** 450,455 ****
--- 450,456 ----
g_hash_table_insert (si->full_hash, g_strdup (fi->full_name), path_row);
/* HACK: if we have the folder, and its the outbox folder, we need the total count, not unread */
+ /* HACK2: We do the same to the draft folder */
/* This is duplicated in mail-folder-cache too, should perhaps be functionised */
unread = fi->unread == -1 ? 0 : fi->unread;
if (mail_note_get_folder_from_uri(fi->uri, &folder) && folder) {
***************
*** 465,470 ****
--- 466,483 ----
unread = total > 0 ? total : 0;
}
+ if (em_utils_folder_is_drafts(folder, fi->uri)) {
+ int total;
+
+ if ((total = camel_folder_get_message_count (folder)) > 0) {
+ int deleted = camel_folder_get_deleted_message_count (folder);
+
+ if (deleted != -1)
+ total -= deleted;
+ }
+
+ unread = total > 0 ? total : 0;
+ }
camel_object_unref(folder);
}
diff -rc --unidirectional-new-file ../evolution-2.0.2/mail/mail-folder-cache.c ./mail/mail-folder-cache.c
*** ../evolution-2.0.2/mail/mail-folder-cache.c Thu Jul 29 05:00:42 2004
--- ./mail/mail-folder-cache.c Thu Dec 9 11:44:01 2004
***************
*** 330,339 ****
d(printf("update 1 folder '%s'\n", folder->full_name));
if ((count_trash && (CAMEL_IS_VTRASH_FOLDER (folder)))
|| folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX)
|| (count_sent && folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT))) {
d(printf(" total count\n"));
unread = camel_folder_get_message_count (folder);
! if (folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX)) {
if ((deleted = camel_folder_get_deleted_message_count (folder)) > 0)
unread -= deleted;
}
--- 330,341 ----
d(printf("update 1 folder '%s'\n", folder->full_name));
if ((count_trash && (CAMEL_IS_VTRASH_FOLDER (folder)))
|| folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX)
+ || em_utils_folder_is_drafts(folder, mfi->uri)
|| (count_sent && folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT))) {
d(printf(" total count\n"));
unread = camel_folder_get_message_count (folder);
! if (folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX)
! || em_utils_folder_is_drafts(folder, mfi->uri)) {
if ((deleted = camel_folder_get_deleted_message_count (folder)) > 0)
unread -= deleted;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]