Skip to content
Commit 154ee459 authored by Jon Mease's avatar Jon Mease Committed by Milian Wolff
Browse files

Fix "Find uses" action when invoked via shortcut.

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.

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 DeclarationPointer
for the item under the cursor and used 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.

BUG: 327959
REVIEW: 114130
parent 93e8be48
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment