Summary: | Go to next/previous unread won't find unread in collapsed threads | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | Magnus Holmgren <holmgren> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | lex.lists, qpadla |
Priority: | NOR | ||
Version: | 1.11.0 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
New findUnread (sketchy)
Make readSortOrder() (re)use the very useful findUnread() method |
Description
Magnus Holmgren
2005-12-02 23:05:21 UTC
(The version I'm looking at now is 1.9.1 (KDE 3.5.1).)
This is no wonder as KMHeaders::findUnread() and KMHeaders::findUnreadAux() uses QListViewItem::itemAbove() and QListViewItem::itemBelow() to step through the message list. I have written a new implementation using an iterator. I hope QListViewItemIterator::operator--() isn't as slow as QListViewItem::itemAbove().
I also found a couple of peculiarities (they look like bugs, but it also appears they will never be executed):
In KMHeaders::findUnreadAux():
> while (item)
> {
> msgBase = mFolder->getMsgBase(item->msgId());
> if (!msgBase) continue;
Looks like an infinite loop should msgBase ever be null.
The code in KMHeaders::findUnread() that forces the thread where the first new or unread message was found to be sorted appears to terminate too early in some cases. It stops when next == item, but item is the item found that is "not necessary the first unread item". When looking for the previous unread message there could be more unread messages in the unsorted branches below.
I don't know if there are any threading issues, but if no unread item is found the first time there doesn't seem to be much point in doing the second pass.
The sorting-enforcing bit would be more elegant using an iterator.
Created attachment 15348 [details]
New findUnread (sketchy)
There is duplicated code because I didn't want to create a new method or change
the signature of an existing one myself.
The two last remarks in my last comment haven't been implemented.
Created attachment 15442 [details]
Make readSortOrder() (re)use the very useful findUnread() method
Appears to be working in all three cases of
GlobalSettings::self()->actionEnterFolder().
Maybe you already had this in mind when findUnread() got its onlyNew parameter?
No, I read bug 50806 before filing this bug and found that it was not the same thing. At least this bug wasn't fixed. And it still isn't. *** Bug 151509 has been marked as a duplicate of this bug. *** Working with kde 4.2. version. |