Review Request 127944: KDE Platform Theme: set file dialog overwrite option appropriately for saving

Martin Gräßlin mgraesslin at kde.org
Fri May 20 06:40:00 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127944/#review95639
-----------------------------------------------------------




autotests/kfiledialog_unittest.cpp (lines 220 - 223)
<https://git.reviewboard.kde.org/r/127944/#comment64776>

    what if the file doesn't exist? I would just use a QTemporaryFile to create a file and try to overwrite it.


- Martin Gräßlin


On May 18, 2016, 12:07 p.m., Jonathan Marten wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127944/
> -----------------------------------------------------------
> 
> (Updated May 18, 2016, 12:07 p.m.)
> 
> 
> Review request for kde-workspace and Plasma.
> 
> 
> Bugs: 360666
>     https://bugs.kde.org/show_bug.cgi?id=360666
> 
> 
> Repository: plasma-integration
> 
> 
> Description
> -------
> 
> 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.
> 
> 
> Diffs
> -----
> 
>   autotests/kfiledialog_unittest.cpp 59915da 
>   src/platformtheme/kdeplatformfiledialoghelper.cpp 139c35d 
>   tests/qfiledialogtest.cpp 1d69ea1 
> 
> Diff: https://git.reviewboard.kde.org/r/127944/diff/
> 
> 
> Testing
> -------
> 
> 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.
> 
> 
> Thanks,
> 
> Jonathan Marten
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160520/41d57af5/attachment.html>


More information about the Plasma-devel mailing list