<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/127944/">https://git.reviewboard.kde.org/r/127944/</a>
</td>
</tr>
</table>
<br />
<div>
<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="https://git.reviewboard.kde.org/r/127944/diff/3/?file=465113#file465113line220" style="color: black; font-weight: bold; text-decoration: underline;">autotests/kfiledialog_unittest.cpp</a>
<span style="font-weight: normal;">
(Diff revision 3)
</span>
</th>
</tr>
</thead>
<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">220</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> <span class="p">(</span><span class="n">qtOverwriteOption</span><span class="p">)</span> <span class="n">dialog</span><span class="p">.</span><span class="n">setOption</span><span class="p">(</span><span class="n">QFileDialog</span><span class="o">::</span><span class="n">DontConfirmOverwrite</span><span class="p">);</span></pre></td>
</tr>
<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">221</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">dialog</span><span class="p">.</span><span class="n">setDirectory</span><span class="p">(</span><span class="s">"/etc"</span><span class="p">);</span></pre></td>
</tr>
<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">222</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">dialog</span><span class="p">.</span><span class="n">selectFile</span><span class="p">(</span><span class="s">"services"</span><span class="p">);</span></pre></td>
</tr>
<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">223</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">dialog</span><span class="p">.</span><span class="n">open</span><span class="p">();</span></pre></td>
</tr>
</tbody>
</table>
<div style="margin-left: 2em;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">what if the file doesn't exist? I would just use a QTemporaryFile to create a file and try to overwrite it.</p></pre>
</div>
</div>
<br />
<p>- Martin Gräßlin</p>
<br />
<p>On May 18th, 2016, 12:07 p.m. CEST, Jonathan Marten wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for kde-workspace and Plasma.</div>
<div>By Jonathan Marten.</div>
<p style="color: grey;"><i>Updated May 18, 2016, 12:07 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://bugs.kde.org/show_bug.cgi?id=360666">360666</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-integration
</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;">The referenced bug says that, by default, there is no file overwrite check when using QFileDialog to save a file. Indeed, on closer investigating it appears that there is no way to even explictly force an overwrite check when using the KDE platform theme, because of this code in plasma-integration/src/platformtheme/kdeplatformfiledialoghelper.cpp:
// overwrite option
if (options()->testOption(QFileDialogOptions::FileDialogOption::DontConfirmOverwrite)) {
dialog->m_fileWidget->setConfirmOverwrite(false);
}
The default for KFileWidget is already for no overwrite check (as set in kio/src/filewidgets/kfilewidget.cpp which initialises KFileWidgetPrivate::confirmOverwrite to false). There is no way to override this from the calling application through the platform plugin.
Suggest that the default option should be the same as that defined by Qt for QFileDialog: always perform an ovewrwrite check on saving, unless the caller has set the QFileDialog::DontConfirmOverwrite option. This is also a sensible default to have from the user's point of view. This change does that in the platform theme plugin, for all saving operations.</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 plasma-intergration with this change, confirmed correct operation of file dialogues and that confirmation is requested when overwriting an existing file, unless the QFileDialog::DontConfirmOverwrite option is specified.</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>autotests/kfiledialog_unittest.cpp <span style="color: grey">(59915da)</span></li>
<li>src/platformtheme/kdeplatformfiledialoghelper.cpp <span style="color: grey">(139c35d)</span></li>
<li>tests/qfiledialogtest.cpp <span style="color: grey">(1d69ea1)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/127944/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>