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
Loading
Please register or sign in to comment