Commit a7d5e675 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

windeployqt: Clear read-only attribute when copying files.


The deletion of the empty QML directories fails when not doing so.

Task-number: QTBUG-40152
Change-Id: I0ff78440646239897b4867c3b3cfe1af8b2769f9
Reviewed-by: default avatarOliver Wolff <oliver.wolff@digia.com>
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
Showing with 14 additions and 4 deletions
......@@ -337,13 +337,23 @@ bool updateFile(const QString &sourceFileName,
QFile file(sourceFileName);
if (optVerboseLevel)
std::wcout << "Updating " << sourceFileInfo.fileName() << ".\n";
if (!(flags & SkipUpdateFile) && !file.copy(targetFileName)) {
*errorMessage = QString::fromLatin1("Cannot copy %1 to %2: %3")
if (!(flags & SkipUpdateFile)) {
if (!file.copy(targetFileName)) {
*errorMessage = QString::fromLatin1("Cannot copy %1 to %2: %3")
.arg(QDir::toNativeSeparators(sourceFileName),
QDir::toNativeSeparators(targetFileName),
file.errorString());
return false;
}
return false;
}
if (!(file.permissions() & QFile::WriteUser)) { // QTBUG-40152, clear inherited read-only attribute
QFile targetFile(targetFileName);
if (!targetFile.setPermissions(targetFile.permissions() | QFile::WriteUser)) {
*errorMessage = QString::fromLatin1("Cannot set write permission on %1: %2")
.arg(QDir::toNativeSeparators(targetFileName), file.errorString());
return false;
}
} // Check permissions
} // !SkipUpdateFile
if (json)
json->addFile(sourceFileName, targetDirectory);
return true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment