Solve a bug which can happen with multiple files with the same name.
Needs ReviewPublic

Authored by bdevries on Fri, Nov 8, 9:44 PM.


Group Reviewers

In case there are two or more files with the same name in the source
(e.g. in separate subfolders), and if an identical file with that
name also exists in the destination, then a dialog will pop up asking
for user intervention (overwrite, ignore, cancel).

The reason is the following:

  • File1 will get copied into the temporary import folder. In case an identical file with that name already exists in the destination, this file will be skipped. I.e. the file will not be moved, and stays in the temporary folder.
  • File2 (with identical name) gets copied into the temporary folder. However, a file with that name will already exist, so a dialog box will pop up to ask for user input.

Since this can only happen if file1 has been skipped (otherwise
it would have been moved out of the temporary folder), file2 should
always overwrite file1. Otherwise, if file1 and file2 share the
same name but are not identical, unexpected things might happen and
data might be lost.

Test Plan

Tested with the situation described above: multiple files with the
same name in the source and destination folders, with or without
identical contents.
With this patch, no dialog box pops up, and the correct import
action is done.

Diff Detail

R260 Gwenview
copy-bug (branched from master)
No Linters Available
No Unit Test Coverage
Build Status
Buildable 18641
Build 18659: arc lint + arc unit