summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/JarMod.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-05-11 12:37:21 +0200
committerPetr Mrázek <peterix@gmail.com>2014-06-09 01:38:30 +0200
commit69c3e7111f93290d1278d6116e9fd50079b4fe79 (patch)
treecbaed3022e8705f1da29777afea0fca16c1abe60 /logic/minecraft/JarMod.cpp
parent92abe4c603e1f4931cd02ae6b752cb7054d8e30d (diff)
downloadMultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.tar
MultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.tar.gz
MultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.tar.lz
MultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.tar.xz
MultiMC-69c3e7111f93290d1278d6116e9fd50079b4fe79.zip
Make 1.6+ work with new instance format.
Diffstat (limited to 'logic/minecraft/JarMod.cpp')
-rw-r--r--logic/minecraft/JarMod.cpp12
1 files changed, 12 insertions, 0 deletions
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())