1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Replace {} with explicit std::nullopt

This commit is contained in:
Elias Steurer 2019-10-28 18:01:16 +01:00
parent bbb70ece42
commit c7d93b3fae

View File

@ -49,7 +49,7 @@ std::optional<QJsonObject> Util::openJsonFileToObject(const QString& path)
auto jsonString = openJsonFileToString(path);
if (!jsonString.has_value()) {
return {};
return std::nullopt;
}
QJsonDocument jsonDocument;
@ -58,7 +58,7 @@ std::optional<QJsonObject> Util::openJsonFileToObject(const QString& path)
if (!(parseError.error == QJsonParseError::NoError)) {
qWarning() << "Settings Json Parse Error: " << parseError.errorString();
return {};
return std::nullopt;
}
return jsonDocument.object();
@ -69,7 +69,7 @@ std::optional<QString> Util::openJsonFileToString(const QString& path)
QFile file;
file.setFileName(path);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
return {};
return std::nullopt;
}
QString fileContent = file.readAll();
file.flush();