Avoid double overwrite check
ClosedPublic

Authored by meven on May 25 2019, 1:34 PM.

Details

Summary

QFileDialog has by default an overwrite check, avoid the second one done by kate.

Related to D21401

Diff Detail

Repository
R40 Kate
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
meven created this revision.May 25 2019, 1:34 PM
Restricted Application added a project: Kate. · View Herald TranscriptMay 25 2019, 1:34 PM
Restricted Application added a subscriber: kwrite-devel. · View Herald Transcript
meven requested review of this revision.May 25 2019, 1:34 PM

Is this correct in all cases? Do we support KIO here? Does that depend on platform integration, i.e. gnome or Windows?

apol added a subscriber: apol.May 25 2019, 3:06 PM

That should work on every platform. In fact, it would be a bug if any platform didn't do it.

https://doc.qt.io/qt-5/qfiledialog.html#Option-enum
See QFileDialog::DontConfirmOverwrite.

cullmann accepted this revision.May 25 2019, 6:19 PM

Ok, then lets do this.

This revision is now accepted and ready to land.May 25 2019, 6:19 PM
This revision was automatically updated to reflect the committed changes.

As wm4 just pointed out on irc, this might need fallback code for older versions of KF, no? Currently Kate has KF5_DEP_VERSION 5.40, so you might either want to bump that min dep to match the version of ktexteditor which does the check itself, or add some (runtime/buildtime) check for the KF version.

Hmm, doesn't this only rely on the behavior of QFileDialog::getSaveFileUrl?