<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/103577/">http://git.reviewboard.kde.org/r/103577/</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;">This review has been submitted with commit f8f07161e04f8ffececade97e8deaef7385dbaec by David Faure to branch KDE/4.8.</pre>
 <br />







<p>- Commit</p>


<br />
<p>On December 30th, 2011, 2:44 a.m., Anssi Hannula 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.</div>
<div>By Anssi Hannula.</div>


<p style="color: grey;"><i>Updated Dec. 30, 2011, 2:44 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;">KConfigIniBackend::isWritable() tries to handle cases where the config
file doesn't exist and one or more of the deepest directories don't
exist either, in which case 'true' is returned if the deepest directory
is writable.

However, this fails because the code tries to use QDir::cdUp() to go
upwards until an existing directory is found. As per documentation,
cdUp() will fail when the parent directory doesn't exist, causing
isWritable() to bail out and return false without checking further
parent directories.

This will cause e.g. KConfig::accessMode() to return ReadOnly if the
configuration directory structure doesn't exist yet, even if the KConfig
is actually writeable (the parent directories are automatically created
by KConfigIniBackend at writing time). This was observed at
https://bugs.mageia.org/show_bug.cgi?id=3601#c10

Fix that by walking through the tree using QFileInfo::absolutePath()
instead.
</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;">Built kdelibs 4.7.95 with the patch, the error message in the referenced Mageia bugreport comment (which is shown when accessMode() returns ReadOnly) doesn't show up anymore when the ~/.kde4 directory tree doesn't exist. Also, if I create an empty ~/.kde4 dir without any permissions, the accessMode() call still returns ReadOnly as expected.</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>kdecore/config/kconfigini.cpp <span style="color: grey">(5f7ba7c)</span></li>

</ul>

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




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








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