Use native dialog overwrite check
ClosedPublic

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

Details

Summary

Past review https://git.reviewboard.kde.org/r/128452/ avoided double overwrite check by disabling the dialog one, it should have been the opposite, reusing QFileDialog.

Diff Detail

Repository
R39 KTextEditor
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:30 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptMay 25 2019, 1:30 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
meven requested review of this revision.May 25 2019, 1:30 PM
cullmann accepted this revision.May 25 2019, 6:23 PM
cullmann added a subscriber: cullmann.

Sounds reasonable.

This revision is now accepted and ready to land.May 25 2019, 6:23 PM

checkOverwrite decl. should be removed, too.

This will work fine for a KDE environment where we know that the file dialog correctly handles the overwrite use case. Do we know that the GTK file dialog does the same for when Kate is run on GNOME, XFCE, or MATE?

meven added a comment.May 26 2019, 6:46 AM

This will work fine for a KDE environment where we know that the file dialog correctly handles the overwrite use case. Do we know that the GTK file dialog does the same for when Kate is run on GNOME, XFCE, or MATE?

I believe it will be fine. https://developer.gnome.org/gtk3/stable/GtkFileChooserDialog.html GtkFileChooserDialog has a gtk_file_chooser_set_do_overwrite_confirmation (since 2005's gtk 2.8) so I would expect QFileDialog to use this feature.
So given GNOME, XFCE and MATE uses gtk >= 2.8, I don't foresee an issue on those DE.
Also bug https://bugreports.qt.io/browse/QTBUG-11539 mentions it works under GNOME at least.

On the QFileDialog side, I wish it would be better documented : https://doc.qt.io/archives/qt-4.8/qfiledialog.html#details mentioned GNOME and KDE but not anymore in qt5 stable documentation https://doc.qt.io/qt-5/qfiledialog.html#details

I think this is fine then, please remove the decl. of bool KTextEditor::DocumentPrivate::checkOverwrite(QUrl u, QWidget *parent), too and push this, thanks!

meven updated this revision to Diff 58708.May 27 2019, 8:24 AM

Remove decl of removed function checkOverwrite

meven added a comment.May 27 2019, 8:26 AM

Good part is that the overwrite check dialog will now be a native one analog to other apps instead of a KMessageBox, providing consistency outside of KDE.

This revision was automatically updated to reflect the committed changes.