mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 10:40:59 +00:00
Fix unchecked return value warnings using QIODevice::Open()
This commit is contained in:
@@ -32,7 +32,9 @@ QString Path::getQmlCacheDir()
|
||||
QByteArray Path::readDataFile(QString fileName)
|
||||
{
|
||||
QFile dataFile(getDataFilePath(fileName));
|
||||
dataFile.open(QIODevice::ReadOnly);
|
||||
if (!dataFile.open(QIODevice::ReadOnly)) {
|
||||
return {};
|
||||
}
|
||||
return dataFile.readAll();
|
||||
}
|
||||
|
||||
@@ -46,8 +48,9 @@ void Path::writeCacheFile(QString fileName, QByteArray data)
|
||||
}
|
||||
|
||||
QFile dataFile(cacheDir.absoluteFilePath(fileName));
|
||||
dataFile.open(QIODevice::WriteOnly);
|
||||
dataFile.write(data);
|
||||
if (dataFile.open(QIODevice::WriteOnly)) {
|
||||
dataFile.write(data);
|
||||
}
|
||||
}
|
||||
|
||||
void Path::deleteCacheFile(QString fileName)
|
||||
|
||||
Reference in New Issue
Block a user