CMake: parse remote json files

Change-Id: I2dd8e160140e6eba35b9968d5afb0953c5cfa43c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
David Schulz
2021-09-09 12:29:22 +02:00
parent f12409fbd6
commit 335a74353f

View File

@@ -96,11 +96,7 @@ static QJsonDocument readJsonFile(const FilePath &filePath)
qCDebug(cmakeFileApi) << "readJsonFile:" << filePath; qCDebug(cmakeFileApi) << "readJsonFile:" << filePath;
QTC_ASSERT(!filePath.isEmpty(), return {}); QTC_ASSERT(!filePath.isEmpty(), return {});
QTC_CHECK(!filePath.needsDevice()); const QJsonDocument doc = QJsonDocument::fromJson(filePath.fileContents());
QFile file(filePath.path());
file.open(QIODevice::ReadOnly | QIODevice::Text);
const QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
return doc; return doc;
} }