aboutsummaryrefslogtreecommitdiff
path: root/api/logic/meta
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/meta')
-rw-r--r--api/logic/meta/BaseEntity.cpp14
-rw-r--r--api/logic/meta/BaseEntity.h2
-rw-r--r--api/logic/meta/Index.cpp2
-rw-r--r--api/logic/meta/Index.h2
-rw-r--r--api/logic/meta/JsonFormat.cpp2
-rw-r--r--api/logic/meta/JsonFormat.h2
-rw-r--r--api/logic/meta/Version.cpp4
-rw-r--r--api/logic/meta/Version.h2
-rw-r--r--api/logic/meta/VersionList.cpp2
-rw-r--r--api/logic/meta/VersionList.h2
10 files changed, 20 insertions, 14 deletions
diff --git a/api/logic/meta/BaseEntity.cpp b/api/logic/meta/BaseEntity.cpp
index 9ea712fa..5ff7a59a 100644
--- a/api/logic/meta/BaseEntity.cpp
+++ b/api/logic/meta/BaseEntity.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,8 @@
#include "Env.h"
#include "Json.h"
+#include "BuildConfig.h"
+
class ParsingValidator : public Net::Validator
{
public: /* con/des */
@@ -53,7 +55,9 @@ public: /* methods */
auto fname = m_entity->localFilename();
try
{
- m_entity->parse(Json::requireObject(Json::requireDocument(data, fname), fname));
+ auto doc = Json::requireDocument(data, fname);
+ auto obj = Json::requireObject(doc, fname);
+ m_entity->parse(obj);
return true;
}
catch (const Exception &e)
@@ -74,7 +78,7 @@ Meta::BaseEntity::~BaseEntity()
QUrl Meta::BaseEntity::url() const
{
- return QUrl("https://v1.meta.multimc.org").resolved(localFilename());
+ return QUrl(BuildConfig.META_URL).resolved(localFilename());
}
bool Meta::BaseEntity::loadLocalFile()
@@ -87,7 +91,9 @@ bool Meta::BaseEntity::loadLocalFile()
// TODO: check if the file has the expected checksum
try
{
- parse(Json::requireObject(Json::requireDocument(fname, fname), fname));
+ auto doc = Json::requireDocument(fname, fname);
+ auto obj = Json::requireObject(doc, fname);
+ parse(obj);
return true;
}
catch (const Exception &e)
diff --git a/api/logic/meta/BaseEntity.h b/api/logic/meta/BaseEntity.h
index 19dd2c18..04a37420 100644
--- a/api/logic/meta/BaseEntity.h
+++ b/api/logic/meta/BaseEntity.h
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/meta/Index.cpp b/api/logic/meta/Index.cpp
index 4dbc0a86..6802470d 100644
--- a/api/logic/meta/Index.cpp
+++ b/api/logic/meta/Index.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/meta/Index.h b/api/logic/meta/Index.h
index c81b4c54..e9412e70 100644
--- a/api/logic/meta/Index.h
+++ b/api/logic/meta/Index.h
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/meta/JsonFormat.cpp b/api/logic/meta/JsonFormat.cpp
index 12da266f..796da4bb 100644
--- a/api/logic/meta/JsonFormat.cpp
+++ b/api/logic/meta/JsonFormat.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/meta/JsonFormat.h b/api/logic/meta/JsonFormat.h
index 62351ad6..93217b7e 100644
--- a/api/logic/meta/JsonFormat.h
+++ b/api/logic/meta/JsonFormat.h
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/meta/Version.cpp b/api/logic/meta/Version.cpp
index 05a76b41..a8dc3169 100644
--- a/api/logic/meta/Version.cpp
+++ b/api/logic/meta/Version.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
#include <QDateTime>
#include "JsonFormat.h"
-#include "minecraft/ComponentList.h"
+#include "minecraft/PackProfile.h"
Meta::Version::Version(const QString &uid, const QString &version)
: BaseVersion(), m_uid(uid), m_version(version)
diff --git a/api/logic/meta/Version.h b/api/logic/meta/Version.h
index 6506d486..a38d7bcd 100644
--- a/api/logic/meta/Version.h
+++ b/api/logic/meta/Version.h
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/meta/VersionList.cpp b/api/logic/meta/VersionList.cpp
index 526fe165..607007eb 100644
--- a/api/logic/meta/VersionList.cpp
+++ b/api/logic/meta/VersionList.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/api/logic/meta/VersionList.h b/api/logic/meta/VersionList.h
index 0be074dd..bba32ca3 100644
--- a/api/logic/meta/VersionList.h
+++ b/api/logic/meta/VersionList.h
@@ -1,4 +1,4 @@
-/* Copyright 2015-2018 MultiMC Contributors
+/* Copyright 2015-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.