mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Recall: Copy instead of move recalled file #5150
That was an unintentional change in
2662203fb7
Also expand the test case to cover this.
This commit is contained in:
parent
c97d8aa8fd
commit
af9c4d0e2f
2 changed files with 7 additions and 2 deletions
|
@ -64,6 +64,10 @@ csync();
|
|||
assert( -e glob(localDir().'dir/file2_.sys.admin#recall#-*.dat' ) );
|
||||
assert( -e glob(localDir().'dir/file3_.sys.admin#recall#-*.dat' ) );
|
||||
|
||||
# verify that the original files still exist
|
||||
assert( -e glob(localDir().'dir/file2.dat' ) );
|
||||
assert( -e glob(localDir().'dir/file3.dat' ) );
|
||||
|
||||
#Remove the recall file
|
||||
unlink(localDir() . ".sys.admin#recall#");
|
||||
|
||||
|
|
|
@ -637,8 +637,9 @@ static void handleRecallFile(const QString &fn)
|
|||
QString rpath = makeRecallFileName(fpath);
|
||||
|
||||
qDebug() << "Copy recall file: " << fpath << " -> " << rpath;
|
||||
QString error;
|
||||
FileSystem::uncheckedRenameReplace(fpath, rpath, &error);
|
||||
// Remove the target first, QFile::copy will not overwrite it.
|
||||
FileSystem::remove(rpath);
|
||||
QFile::copy(fpath, rpath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue