I noticed that the unread message count in mailbox-view is not updated
correctly - most of the time not when new mail arrives and seemingly
never
when the flag of a message is changed to isSeen (i.e. by activating the
item in the
message listview).
Before I continue: I just started getting to know trojita's source so
the fix I am
proposing below might be completely off-place, I just stepped through
trojita with
GDB and tried to find the most suitable place in the execution path...
I could resolve the first issue by:
diff --git a/src/Imap/Tasks/ObtainSynchronizedMailboxTask.cpp
b/src/Imap/Tasks/ObtainSynchronizedMailboxTask.cpp
index cc68afe..1f07dcd 100644
--- a/src/Imap/Tasks/ObtainSynchronizedMailboxTask.cpp
+++ b/src/Imap/Tasks/ObtainSynchronizedMailboxTask.cpp
@@ -719,6 +719,7 @@ void
ObtainSynchronizedMailboxTask::notifyInterestingMessages(
TreeItemMailbox *
Q_ASSERT(mailbox);
TreeItemMsgList *list =
dynamic_cast<Imap::Mailbox::TreeItemMsgList*>(
mailbox->_children[0] );
Q_ASSERT(list);
+ list->recalcUnreadMessageCount();
QModelIndex listIndex = model->createIndex( 0, 0, list );
Q_ASSERT(listIndex.isValid());
QModelIndex firstInterestingMessage = model->index( mailbox-
>syncState.unSeenOffset(), 0, listIndex );
For the second issue it seems that in MailboxTree.cpp, method void
TreeItemMessage::setFlags(TreeItemMsgList *list, const QStringList
&flags) (line
859) the check:
if ( list->_numberFetchingStatus == DONE ) {
fails because _numberFetchingStatus seems to be =LOADING about 99% of
the
time when this method is invoked. So either this is a bug or it is OK
but somehow
_unreadMessageCount needs to be updated as soon as _numberFetchingStatus
changes from LOADING to DONE...
Any ideas?