1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Fix loadFromFile

This commit is contained in:
Elias Steurer 2020-11-07 14:03:44 +01:00
parent c0f858c9c5
commit 3b558e2f99

View File

@ -164,9 +164,12 @@ QString BaseWindow::loadFromFile(const QString& filename)
QFile file;
file.setFileName(basePath() + "/" + filename);
qWarning() << " loadFromFile: " << file.fileName() << file.readAll();
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
return file.readAll();
if (file.open(QIODevice::ReadOnly)) {
const QString content = file.readAll();
file.close();
return content;
}
file.close();
qWarning() << "Could not loadFromFile: " << file.fileName();
return "";
}