From 20cb97a35af5097e9d3b2062c0dfcb5f2e5fff5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 6 Sep 2014 18:16:56 +0200 Subject: Sync from quickmods --- logic/minecraft/MinecraftVersionList.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'logic/minecraft/MinecraftVersionList.cpp') diff --git a/logic/minecraft/MinecraftVersionList.cpp b/logic/minecraft/MinecraftVersionList.cpp index bde2170b..598fecdb 100644 --- a/logic/minecraft/MinecraftVersionList.cpp +++ b/logic/minecraft/MinecraftVersionList.cpp @@ -116,15 +116,10 @@ void MinecraftVersionList::loadBuiltinList() { QLOG_INFO() << "Loading builtin version list."; // grab the version list data from internal resources. - QResource versionList(":/versions/minecraft.json"); - QFile filez(versionList.absoluteFilePath()); - filez.open(QIODevice::ReadOnly); - auto data = filez.readAll(); - - // parse the data as json - QJsonParseError jsonError; - QJsonDocument jsonDoc = QJsonDocument::fromJson(data, &jsonError); - QJsonObject root = jsonDoc.object(); + const QJsonDocument doc = + MMCJson::parseFile(":/versions/minecraft.json", + "builtin version list"); + const QJsonObject root = doc.object(); // parse all the versions for (const auto version : MMCJson::ensureArray(root.value("versions"))) -- cgit v1.2.3