Summary: | Mark message as ... submenu grows way too big when user has defined many tags | ||
---|---|---|---|
Product: | [Applications] kmail2 | Reporter: | Christian (Fuchs) <kde> |
Component: | message list | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | domlyons, mail, wstephenson |
Priority: | NOR | ||
Version: | 2.0.90 | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.8 | |
Sentry Crash Report: | |||
Attachments: |
Tags filling the whole screen
Patch that extends the Tag::compare() method First attempt to split the tags menu into multiple pages |
Description
Christian (Fuchs)
2011-05-23 22:17:39 UTC
Created attachment 63863 [details]
Tags filling the whole screen
This screenshot shows the problem. The whole screen is filled with the tags menu. Please note that the menu leaves the visible space, and: the Tags seem to be not sorted.
Sorry, I had to pixelize the tags, since most of them are people tags from digikam, i.e. full names.
I use digikam to manage my photos and recently started tagging people, places, objects etc. So I have a lot of tags. And entering the context menu for a message can be quite stunning when hovering over the "Mark Message" entry. I attached an screenshot of my full screen (!) when opening the menu. Please note that on the right side the menu leaves the visible screen. And there is no possibility to show those entries that doesn't find on the screen. An additional problem is that the entries don't appear to be sorted. Which is quite strange, because in the source code it says that it should be sorted (tagactionmanager.cpp, line 107): --- snip --- // Build a sorted list of tags QList<Tag::Ptr> tagList; foreach( const Nepomuk::Tag &nepomukTag, Nepomuk::Tag::allTags() ) { [...] } qSort( tagList.begin(), tagList.end(), KMail::Tag::compare ); (Source code: https://projects.kde.org/projects/kde/kdepim/repository/revisions/master/entry/kmail/tagactionmanager.cpp#L107 ) If you check Tag.cpp for the compare() method, you will find that it sorts only for priority... ( https://projects.kde.org/projects/kde/kdepim/repository/revisions/master/entry/kmail/tag.cpp#L101 ) I don't know if this is really a good idea. Couldn't you add something like the top 5 or top 10 most important tags, and then add the other tags alphabetically? It would already help a lot if the Tags would be grouped, i.e. hierarchical structured, like digikam does. Is that something digikam internal, or is there a way to use this hierarchy? KMail version: 4.7.1 Created attachment 63872 [details]
Patch that extends the Tag::compare() method
This patch tries (!) to extend the compare() method.
The current version of tag.cpp sorts based on the priority of the tags only. But it seems to be seldom (never? I used nepomukshell to find a tag that had a priority property...) set, and therefore a default value (-1) is used. And thus, the sort order is more or less arbitrary.
The patch makes the compare() method use also the tags' names, when the priority is equal.
Additionally a second compare method is introduced: compareName(). This method ignores the priority and compares only based on tag name.
The patch was written against the source code of the 4.7.1 version, but it should also apply in the trunk, because there haven't been any changes on tag.{h,cpp} for quite some time.
Question: What is the priority for, and why does no one uses it? The source code states "sort order of the tag", but I couldn't see that.
(Would be great if it would be something like a measure of uses or recently uses...)
Created attachment 63873 [details]
First attempt to split the tags menu into multiple pages
This second patch (it needs the first one, because of the compareName() method) does two things:
1. It adds a small set of the most prioritized tags (atm: 7).
2. It adds the alphabetically sorted tags in sets of 20 tags to a menu, then adds a submenu "More Tags" which also includes 20 tags and another submenu...
Note to 1.: This is currently completely useless! Since there seems to be no tags with a priority property set. And therefore, the "Top Tags" are the first in the alphabet... :(
Note to 2.: This is rather a dirty hack. Now there are a lot of submenus, which makes it quite painful to find a specific tag.
Maybe a search field could help...
Disclaimer: Please note, that this patch is a mere attempt to help some real developer to actually better the situation. Please do not even consider to apply this patch! I didn't even took the time to check if I need to clean up the memory...
In KMail 2 settings it's possible to remove tags (just for KMAil, they won't be removed from Digikam). So it's some sort of opt-out. I think it should be the other way round: Opt-In for the few tags you really need. Git commit de2571460c0e568757ce7c401a3d1084bc737991 by Montel Laurent. Committed on 28/10/2011 at 09:40. Pushed by mlaurent into branch 'master'. Add menu "More..." when we have too many entry CCBUG: 273991 M +1 -0 kmail/CMakeLists.txt M +13 -1 kmail/kmmainwidget.cpp M +1 -0 kmail/kmmainwidget.h M +21 -2 kmail/tagactionmanager.cpp M +4 -1 kmail/tagactionmanager.h A +86 -0 kmail/tagselectdialog.cpp [License: GPL (v2) (+Qt exception)] A +50 -0 kmail/tagselectdialog.h [License: GPL (v2) (+Qt exception)] http://commits.kde.org/kdepim/de2571460c0e568757ce7c401a3d1084bc737991 Git commit 8160e893647bb82ede1be49c66ffc9eb0a1d039c by Montel Laurent. Committed on 28/10/2011 at 10:05. Pushed by mlaurent into branch 'master'. Fix Bug 273991 - Mark message as ... submenu grows way too big when user has defined many tags FIXED-IN: 4.8 BUG: 273991 M +24 -15 kmail/kmcommands.cpp M +3 -3 kmail/kmcommands.h M +9 -1 kmail/kmmainwidget.cpp http://commits.kde.org/kdepim/8160e893647bb82ede1be49c66ffc9eb0a1d039c Thank you! |