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

Review Request #127944 - Created May 17, 2016 and submitted

Information
Jonathan Marten
plasma-integration
360666
Reviewers
kde-workspace, plasma
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.
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.

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Martin Flöser
Boudewijn Rempt
Jonathan Marten
Martin Flöser
Martin Flöser
Jonathan Marten
Martin Flöser
Jonathan Marten
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 31ead90605238dfc67c3dac0eb9fd9fd7d072051 by Jonathan Marten to branch Plasma/5.6.
Loading...