Allow the default context menu for EntityTreeView to be specified
Review Request #104132 - Created March 1, 2012 and submitted - Latest diff uploaded
The referenced bug happens because EntityTreeView::contextMenuEvent() looks at the clicked item to see whether it is an Item or a Collection, and chooses the context menu accordingly. However, if the menu button click is over blank space then there is no item to test, so the code at present arbitrarily chooses the collection menu. This is incorrect for the middle column of KAddressBook. This change adds a Boolean flag to the EntityTreeView to specify whether it contains Items or Collections, and for a menu click over blank space this is used to choose the appropriate menu. For a menu click over an item this flag is not used. The default is true (i.e. Collections), so the operation of the library with unmodified applications is the same as before. Some discussion at http://lists.kde.org/?t=133035828400002&r=1&w=2
Built kdepimlibs with this change and modified KAddressBook to call setIsCollection(false) for the middle column. The correct context menu is displayed whether over an address item or over blank space.