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:
parent
22047bfe6e
commit
c7dcb968f1
@ -65,6 +65,7 @@ std::optional<QString> openJsonFileToString(const QString& path)
|
|||||||
QFile file;
|
QFile file;
|
||||||
file.setFileName(path);
|
file.setFileName(path);
|
||||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
|
qWarning() << "Unable to open file: " << path << file.errorString();
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
QString fileContent = file.readAll();
|
QString fileContent = file.readAll();
|
||||||
|
Loading…
Reference in New Issue
Block a user