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













<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">KDirOperator is called from KFileWidget which is called from KFileDialog. Guess what the parent->window() would give you in this case ? The KFileDialog because it is the next valid ancestor widget that has a window-system frame. If we used that we would improve the current situation from keep the password for a short duration (~10 sec) to keep it until the file dialog is closed, but that is not what we want. We want to keep the password until the application that invoked the KFileDialog is closed. That is why we topLevelWindow to iteration through the parent widgets to find the top most level widget with a window-system frame. Failing that it falls back to parent->window().</pre>
<br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On November 24th, 2011, 8:35 a.m., <b>Aaron J. Seigo</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://git.reviewboard.kde.org/r/103226/diff/2/?file=41891#file41891line384" style="color: black; font-weight: bold; text-decoration: underline;">kfile/kdiroperator.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">KDirOperator::Private::~Private()</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">384</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">d</span><span class="o">-></span><span class="n">windowWidget</span> <span class="o">=</span> <span class="n">topLevelWindow</span><span class="p">(</span><span class="n">parent</span><span class="p">);</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">how is this different just calling widget->window()?</pre>
 </blockquote>



 <p>On November 24th, 2011, 12:56 p.m., <b>Thomas Lübking</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;">As far as I can say it scans for the oldest ancestor across window borders and returns the window for this widget.

QWidget *w1 = new QWidget; // is implicitly window
QWidget *w2 = new QWidget(w1, Qt::Window); // is explicitly window
QWidget *w3 = new QWidget(w2); // not a window

w3->window() == w2;
topLevelWindow(w3) == w1;

Just this:
 return (w ? w->window() : (widget ? widget->window() : 0));
is to me actually
 return w ? w->window() : 0; // w != 0 || widget == 0</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Just this:
 return (w ? w->window() : (widget ? widget->window() : 0));
is to me actually
 return w ? w->window() : 0; // w != 0 || widget == 0

Actually that is true since I changed the while loop to (w && w->parentWidget()). I forgot to update the return statement. Will fix that as well.</pre>
<br />




<p>- Dawit</p>


<br />
<p>On November 24th, 2011, 7:37 a.m., Dawit Alemayehu 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 kdelibs and David Faure.</div>
<div>By Dawit Alemayehu.</div>


<p style="color: grey;"><i>Updated Nov. 24, 2011, 7:37 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 attached patch fixes the scenario outlined in bug# 179663 by making the best effort to identify and use the top most window when invoking KIO functions. That way any password information supplied by the user is cached, even if the user did not check the "Remember password" checkbox, for the duration of the application instead of just the lifetime of the file dialog. 

Right now almost all KFileDialog's KIO access does not set the widget parameter. If a site then requires authentication, no window-id information will be passed to it. That in turn results in the user supplied password being cached for only a very very short duration, ~10 secs. Afterwards, the password is removed and the user is inevitably re-prompted to supply the same credentials again.</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;">Tested with the scenario outlined in the afforementioned bug report using a publicly available demo webdav server, webdav://demo.sabredav.org.</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=179663">179663</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>kfile/kdiroperator.cpp <span style="color: grey">(4c93ac9)</span></li>

 <li>kfile/kdirselectdialog.cpp <span style="color: grey">(0212e58)</span></li>

 <li>kfile/kfilewidget.cpp <span style="color: grey">(09b86d4)</span></li>

 <li>kfile/knewfilemenu.cpp <span style="color: grey">(ac54041)</span></li>

</ul>

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




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








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