Commit 06ad8196 authored by Kai Koehne's avatar Kai Koehne
Browse files

sdktool: Check for return value of mkpath



Change-Id: I946e2d5195ea0f9813fe7ebaa7dc2434579abbe5
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 57a6f04c
...@@ -120,9 +120,14 @@ bool Operation::save(const QVariantMap &map, const QString &file) const ...@@ -120,9 +120,14 @@ bool Operation::save(const QVariantMap &map, const QString &file) const
return false; return false;
} }
Utils::FileName dir = path.parentDir(); Utils::FileName dirName = path.parentDir();
if (!dir.toFileInfo().exists()) QDir dir(dirName.toString());
QDir(dir.toString()).mkpath(dir.toString()); if (!dir.exists() && !dir.mkpath(dirName.toString())) {
std::cerr << "Error: Could not create directory " << qPrintable(dirName.toString())
<< "." << std::endl;
return false;
}
Utils::PersistentSettingsWriter writer(path, QLatin1String("unknown")); Utils::PersistentSettingsWriter writer(path, QLatin1String("unknown"));
return writer.save(map, 0) return writer.save(map, 0)
......
Markdown is supported
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