Commit 19cbd1ac authored by Eike Ziller's avatar Eike Ziller
Browse files

Sdktool: Report settings write errors instead of silently failing



Change-Id: Icf344652593bc868dce8f66e8f4ab11970c87204
Reviewed-by: default avatarhjk <hjk@qt.io>
parent de7e0c58
......@@ -126,8 +126,18 @@ bool Operation::save(const QVariantMap &map, const QString &file) const
Utils::PersistentSettingsWriter writer(path, QLatin1String("QtCreator")
+ file[0].toUpper() + file.mid(1));
return writer.save(map, 0)
&& QFile::setPermissions(path.toString(),
QFile::ReadOwner | QFile::WriteOwner
| QFile::ReadGroup | QFile::ReadOther);
QString errorMessage;
if (!writer.save(map, &errorMessage)) {
std::cerr << "Error: Could not save settings " << qPrintable(path.toString())
<< "." << std::endl;
return false;
}
if (!QFile::setPermissions(path.toString(),
QFile::ReadOwner | QFile::WriteOwner
| QFile::ReadGroup | QFile::ReadOther)) {
std::cerr << "Error: Could not set permissions for " << qPrintable(path.toString())
<< "." << std::endl;
return false;
}
return true;
}
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