Make 1.6+ work with new instance format.
This commit is contained in:
parent
92abe4c603
commit
69c3e7111f
29 changed files with 951 additions and 562 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue