plugin/cutils: warn on overwrite fail
This commit is contained in:
parent
0691dfb95f
commit
11dc993f4b
1 changed files with 4 additions and 1 deletions
|
|
@ -101,7 +101,10 @@ bool CUtils::copyFile(const QUrl& source, const QUrl& target, bool overwrite) co
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overwrite) {
|
if (overwrite) {
|
||||||
QFile::remove(target.toLocalFile());
|
if (!QFile::remove(target.toLocalFile())) {
|
||||||
|
qWarning() << "CUtils::copyFile: overwrite was specified but failed to remove" << target.toLocalFile();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QFile::copy(source.toLocalFile(), target.toLocalFile());
|
return QFile::copy(source.toLocalFile(), target.toLocalFile());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue