plugin/cutils: fix copyfile when overwrite file doesn't exist
This commit is contained in:
parent
3ebd63df2b
commit
3bb58e6da8
1 changed files with 1 additions and 1 deletions
|
|
@ -100,7 +100,7 @@ bool CUtils::copyFile(const QUrl& source, const QUrl& target, bool overwrite) co
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overwrite) {
|
if (overwrite && QFile::exists(target.toLocalFile())) {
|
||||||
if (!QFile::remove(target.toLocalFile())) {
|
if (!QFile::remove(target.toLocalFile())) {
|
||||||
qWarning() << "CUtils::copyFile: overwrite was specified but failed to remove" << target.toLocalFile();
|
qWarning() << "CUtils::copyFile: overwrite was specified but failed to remove" << target.toLocalFile();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue