<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 />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On November 28th, 2013, 11:23 a.m. UTC, <b>Milian Wolff</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">For 1.6 you can fixup the small issues I note below and then commit. For 1.7/master, I'd also like to see this function moved to language/duchain/duchainutils.h and be used in more places throughout the codebase.</pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Thanks for the feedback Milian.  I've made the updates for version 1.6, but I'm going to leave it to someone more experience to make the updates you suggest for 1.7/master.</pre>
<br />










<p>- Jon</p>


<br />
<p>On December 1st, 2013, 1:24 a.m. UTC, Jon Mease wrote:</p>








<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 Dec. 1, 2013, 1:24 a.m.</i></p>







<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">(5c27756)</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>