Check if destination exists also when pasting binary data
ClosedPublic

Authored by elvisangelaccio on May 27 2018, 11:01 AM.

Details

Summary

Currently we check whether the destination URL exists only if we are
pasting text (or if the mimedata has only one format).

If we are pasting e.g. images copied from Spectacle, we unconditionally
overwrite the destination URL.

This patch moves the StatJob+RenameDialog from getNewFileName() to a
new getDestinationUrl() function, which we can also call from chooseFormatAndUrl().

BUG: 394318
FIXED-IN: 5.47

Test Plan
  • Paste some image into an existing file and check the rename dialog.
  • Check that pasting text still shows the rename dialog.

Diff Detail

Repository
R241 KIO
Branch
fix-image-pasting (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 27 2018, 11:01 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
elvisangelaccio requested review of this revision.May 27 2018, 11:01 AM
dfaure accepted this revision.May 29 2018, 7:29 AM
This revision is now accepted and ready to land.May 29 2018, 7:29 AM
This revision was automatically updated to reflect the committed changes.