diff --git a/src/frameworks/UBFileSystemUtils.cpp b/src/frameworks/UBFileSystemUtils.cpp index 6c5ae6d6..42915957 100644 --- a/src/frameworks/UBFileSystemUtils.cpp +++ b/src/frameworks/UBFileSystemUtils.cpp @@ -105,6 +105,11 @@ bool UBFileSystemUtils::copyFile(const QString &source, const QString &destinati if (QFileInfo(normalizedDestination).isFile() && overwrite) { QFile::remove(normalizedDestination); } + else + { + if (!overwrite) + return true; // don't try to copy an existing file if overwrite is false + } } else { normalizedDestination = normalizedDestination.replace(QString("\\"), QString("/")); int pos = normalizedDestination.lastIndexOf("/"); @@ -300,7 +305,7 @@ bool UBFileSystemUtils::copyDir(const QString& pSourceDirPath, const QString& pT { if (dirContent.isDir()) { - successSoFar = copyDir(pSourceDirPath + "/" + dirContent.fileName(), pTargetDirPath + "/" + dirContent.fileName()); + successSoFar = copyDir(pSourceDirPath + "/" + dirContent.fileName(), pTargetDirPath + "/" + dirContent.fileName(), overwite); } else {