<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/104193/">http://git.reviewboard.kde.org/r/104193/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On March 9th, 2012, 3:36 p.m., <b>Kurt Hindenburg</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;">Since the loop is only when showing the shortcut dialog, can you just check for dups in the loop?

I don't like the 'show menubar' at the bottom.  Can you add it in the same position as it is now?</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;">"Since the loop is only when showing the shortcut dialog, can you just check for dups in the loop?"

I tried, but it didn't work. I know and can detect the duplication in the code, but the problem is there is no way to tell KShortcutsDialog : "ignore duplicate".

I even tried removing "show-menubar" manually from the actionCollection() of SessionController, but the result is crash when configuring shortcut.


"I don't like the 'show menubar' at the bottom.  Can you add it in the same position as it is now?"

That would make the code more coupled with the exact layout of the context menu. If we later adds or removes another action before that "Show Menubar" action, this part of code should also be updated. 
</pre>
<br />








<p>- Jekyll</p>


<br />
<p>On March 8th, 2012, 6:42 a.m., Jekyll Wu wrote:</p>






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

<div>Review request for Konsole.</div>
<div>By Jekyll Wu.</div>


<p style="color: grey;"><i>Updated March 8, 2012, 6:42 a.m.</i></p>






<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;">The cause of that bug is "show-menubar" is contained in both konsoleui.rc(used by MainWindow) and sessionui.rc(used by SessionController). In MainWindow::showShortcutsDialog(), the following code adds that 'show-menubar' action twice since it is contained in the 'actionCollection()' of both MainWindow and SessionController.

    foreach(KXMLGUIClient * client, guiFactory()->clients()) {
        dialog.addCollection(client->actionCollection());
    }

The patch removes "show-menubar" from sessionui.rc. Instead, it adds or removes that action into/from context menu dynamically depending upon whether the window currently has menubar or not. The result is the content menu contains that "Show Menubar" action only when the menubar is hidden.

I feel this is not an ideal solution. Is there some way to tell KShortcutsDialog: "If the same action is added twice, Just count it as one single action"? That would make the code easier . 

And I'm not sure appending the "Show Menubar" action is nice or ugly. Should a separator be added before 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;">seems fine in stand-alone konsole and hosts of konsolepart.</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=214493">214493</a>


</div>


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

 <li>desktop/sessionui.rc <span style="color: grey">(0dd1b66)</span></li>

 <li>src/SessionController.h <span style="color: grey">(46714c0)</span></li>

 <li>src/SessionController.cpp <span style="color: grey">(f437d9b)</span></li>

</ul>

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



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

<div>

 <a href="http://git.reviewboard.kde.org/r/104193/s/452/"><img src="http://git.reviewboard.kde.org/media/uploaded/images/2012/03/08/when-menubar-is-visible_400x100.png" style="border: 1px black solid;" alt="when menubar is visible" /></a>

 <a href="http://git.reviewboard.kde.org/r/104193/s/453/"><img src="http://git.reviewboard.kde.org/media/uploaded/images/2012/03/08/when-menubar-is-hidden_400x100.png" style="border: 1px black solid;" alt="when menubar is hidden" /></a>

</div>


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








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