<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/114130/">http://git.reviewboard.kde.org/r/114130/</a>
     </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for KDevelop.</div>
<div>By Jon Mease.</div>


<p style="color: grey;"><i>Updated Nov. 28, 2013, 9:37 a.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Fixed target branch.</pre>
  </td>
 </tr>
</table>





<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=327959">327959</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdevplatform
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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?
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>plugins/contextbrowser/contextbrowser.cpp <span style="color: grey">(a2124f7)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/114130/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>