1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-06 19:12:30 +01:00

Add warning on file open error

This commit is contained in:
Elias Steurer 2021-05-02 17:45:36 +02:00
parent 22047bfe6e
commit c7dcb968f1

View File

@ -65,6 +65,7 @@ std::optional<QString> openJsonFileToString(const QString& path)
QFile file;
file.setFileName(path);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning() << "Unable to open file: " << path << file.errorString();
return std::nullopt;
}
QString fileContent = file.readAll();