From 69c3e7111f93290d1278d6116e9fd50079b4fe79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 11 May 2014 12:37:21 +0200 Subject: Make 1.6+ work with new instance format. --- logic/minecraft/JarMod.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'logic/minecraft/JarMod.cpp') diff --git a/logic/minecraft/JarMod.cpp b/logic/minecraft/JarMod.cpp index 99a30aa5..18a9411c 100644 --- a/logic/minecraft/JarMod.cpp +++ b/logic/minecraft/JarMod.cpp @@ -1,5 +1,6 @@ #include "JarMod.h" #include "logic/MMCJson.h" +using namespace MMCJson; JarmodPtr Jarmod::fromJson(const QJsonObject &libObj, const QString &filename) { @@ -28,6 +29,7 @@ JarmodPtr Jarmod::fromJson(const QJsonObject &libObj, const QString &filename) }; readString("url", out->baseurl); + readString("MMC-hint", out->hint); readString("MMC-absoluteUrl", out->absoluteUrl); if(!out->baseurl.isEmpty() && out->absoluteUrl.isEmpty()) { @@ -36,6 +38,16 @@ JarmodPtr Jarmod::fromJson(const QJsonObject &libObj, const QString &filename) return out; } +QJsonObject Jarmod::toJson() +{ + QJsonObject out; + writeString(out, "name", name); + writeString(out, "url", baseurl); + writeString(out, "MMC-absoluteUrl", absoluteUrl); + writeString(out, "MMC-hint", hint); + return out; +} + QString Jarmod::url() { if(!absoluteUrl.isEmpty()) -- cgit v1.2.3