[Kde-pim] EntityTreeView and context menus

Kevin Krammer kevin.krammer at gmx.at
Mon Feb 27 16:09:52 GMT 2012


On Monday, 2012-02-27, Jonathan Marten wrote:
> I've been investigating bug 259963 (wrong context menu when clicking
> over a blank area in the middle column in KAddressBook).  The problem
> seems to be in Akonadi::EntityTreeView::contextMenuEvent() where it
> looks at the clicked index to see whether it is a valid Item, and
> chooses the menu accordingly.  The problem is that, if the click is
> over blank space, there is no way to tell whether the item or
> collection menu should apply.
> 
> The only fix that I can think of so far is to add a property to the
> EntityTreeView to indicate whether the view is showing items or
> collections, to be set by the calling application.  It would only be
> used in the case of a click not over anything, and the default
> operation if this were not set would be the same as before so other
> applications should not break.

What about derving from EntityTreeView in KAddressBook and overwriting the 
event handler method, delegating to base class implementation when event 
position is on a valid item?

I am not sure clicking in empty space will always result in either collection 
or item context menu, an application could want different behavior.

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20120227/32905188/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list