Review Request 114130: A potential fix for Bug 327959
Commit Hook
null at kde.org
Sun Dec 1 15:10:59 UTC 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/114130/#review44938
-----------------------------------------------------------
This review has been submitted with commit 154ee459768d6dc7cd6ebbfb10e8abcf48c3dd98 by Milian Wolff on behalf of Jon Mease to branch 1.6.
- Commit Hook
On Dec. 1, 2013, 1:24 a.m., Jon Mease wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/114130/
> -----------------------------------------------------------
>
> (Updated Dec. 1, 2013, 1:24 a.m.)
>
>
> Review request for KDevelop.
>
>
> Bugs: 327959
> http://bugs.kde.org/show_bug.cgi?id=327959
>
>
> Repository: kdevplatform
>
>
> Description
> -------
>
> Bug Summary: When the "Find uses" action is bound to a keystroke (Such as Ctrl+M), executing that keystroke has no effect even though executing "Find Uses" from the context menu works as expected.
>
> Problem: The ContextBrowserPlugin::findUses() function relies on the sender() object being a QAction whose data() is an IndexedDeclaration. The setData() method for this QAction is only called in the ContextBrowserPlugin::contextMenuExtension() function, however this function is not called when the Find Uses action is invoked with a keyboard shortcut.
>
> Potential Solution: As a potential solution, this patch removes the calls to setData() and data() on the QAction. Instead, I copied the cursorDeclaration() function that is used in quickopenplugin.cpp. This function returns a Declaration for the item under the cursor, which I then wrap in an IndexedDeclaration and use in place of the prior result of data() on the QAction.
>
> This solution fixes the bug, and preserves the past behavior of Find Uses from the context menu and the documentation popup.
>
> Questions: Is there a better way to fix this? Is there an appropriate place to put the cursorDeclaration() function so that it can be used by multiple plugins without copying it?
>
>
> Diffs
> -----
>
> plugins/contextbrowser/contextbrowser.cpp 5c27756
>
> Diff: http://git.reviewboard.kde.org/r/114130/diff/
>
>
> Testing
> -------
>
> I bound the Find Uses action to Ctrl+M and tested it on a variety of C++ source files. When the cursor is not on a declaration the shortcut does nothing and when the cursor is on a declaration the find uses window is displayed. I also tested that executing 'Find Uses' from the context menu and 'Show Uses' from the documentation popup behave as before.
>
>
> Thanks,
>
> Jon Mease
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20131201/806dca76/attachment.html>
More information about the KDevelop-devel
mailing list