mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Fix loadFromFile
This commit is contained in:
parent
c0f858c9c5
commit
3b558e2f99
@ -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 "";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user