Merge pull request #13909 from NissimHadar/fixFileUtils

Create correct folder.
This commit is contained in:
John Conklin II 2018-09-04 14:20:20 -07:00 committed by GitHub
commit 476887a224
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -156,10 +156,12 @@ bool FileUtils::canCreateFile(const QString& fullPath) {
qDebug(shared) << "unable to overwrite file '" << fullPath << "'";
return false;
}
QDir dir(fileInfo.absolutePath());
QString absolutePath = fileInfo.absolutePath();
QDir dir(absolutePath);
if (!dir.exists()) {
if (!dir.mkpath(fullPath)) {
qDebug(shared) << "unable to create dir '" << dir.absolutePath() << "'";
if (!dir.mkpath(absolutePath)) {
qDebug(shared) << "unable to create dir '" << absolutePath << "'";
return false;
}
}