diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-01-27 22:31:07 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-02 00:14:06 +0200 |
commit | 791221e923586bb717396ecf18bd13e57034df99 (patch) | |
tree | 9f608af07375b38626c8964671620477158341ba /logic/minecraft/JarMod.cpp | |
parent | 593111b14463e9d5d08256061b981b5ab1cfb710 (diff) | |
download | MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar.gz MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar.lz MultiMC-791221e923586bb717396ecf18bd13e57034df99.tar.xz MultiMC-791221e923586bb717396ecf18bd13e57034df99.zip |
NOISSUE Refactors and moving of things
Diffstat (limited to 'logic/minecraft/JarMod.cpp')
-rw-r--r-- | logic/minecraft/JarMod.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/logic/minecraft/JarMod.cpp b/logic/minecraft/JarMod.cpp index 18a9411c..fce8a492 100644 --- a/logic/minecraft/JarMod.cpp +++ b/logic/minecraft/JarMod.cpp @@ -11,30 +11,6 @@ JarmodPtr Jarmod::fromJson(const QJsonObject &libObj, const QString &filename) "contains a jarmod that doesn't have a 'name' field"); } out->name = libObj.value("name").toString(); - - auto readString = [libObj, filename](const QString & key, QString & variable) - { - if (libObj.contains(key)) - { - QJsonValue val = libObj.value(key); - if (!val.isString()) - { - QLOG_WARN() << key << "is not a string in" << filename << "(skipping)"; - } - else - { - variable = val.toString(); - } - } - }; - - readString("url", out->baseurl); - readString("MMC-hint", out->hint); - readString("MMC-absoluteUrl", out->absoluteUrl); - if(!out->baseurl.isEmpty() && out->absoluteUrl.isEmpty()) - { - out->absoluteUrl = out->baseurl + out->name; - } return out; } @@ -42,15 +18,5 @@ 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()) - return absoluteUrl; - else return baseurl + name; -} |