summaryrefslogtreecommitdiffstats
path: root/logic/OneSixVersionBuilder.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-03-01 23:06:47 +0100
committerPetr Mrázek <peterix@gmail.com>2014-03-01 23:06:47 +0100
commit7c24bcc83476dcbdd7f7acbe14ecef4398962689 (patch)
tree4ab7e7020927d05274f079c3045bd572c218fa21 /logic/OneSixVersionBuilder.h
parent7dfd6aa051c582e26125e17e1d6eed5e675e1027 (diff)
downloadMultiMC-7c24bcc83476dcbdd7f7acbe14ecef4398962689.tar
MultiMC-7c24bcc83476dcbdd7f7acbe14ecef4398962689.tar.gz
MultiMC-7c24bcc83476dcbdd7f7acbe14ecef4398962689.tar.lz
MultiMC-7c24bcc83476dcbdd7f7acbe14ecef4398962689.tar.xz
MultiMC-7c24bcc83476dcbdd7f7acbe14ecef4398962689.zip
Reorganize the version-related code.
Diffstat (limited to 'logic/OneSixVersionBuilder.h')
-rw-r--r--logic/OneSixVersionBuilder.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/logic/OneSixVersionBuilder.h b/logic/OneSixVersionBuilder.h
index 8cf6f32f..8ca2551a 100644
--- a/logic/OneSixVersionBuilder.h
+++ b/logic/OneSixVersionBuilder.h
@@ -18,7 +18,7 @@
#include <QString>
#include <QMap>
-class OneSixVersion;
+class VersionFinal;
class OneSixInstance;
class QWidget;
class QJsonObject;
@@ -29,8 +29,9 @@ class OneSixVersionBuilder
{
OneSixVersionBuilder();
public:
- static bool build(OneSixVersion *version, OneSixInstance *instance, QWidget *widgetParent, const bool onlyVanilla, const QStringList &external);
- static bool read(OneSixVersion *version, const QJsonObject &obj);
+ static bool build(VersionFinal *version, OneSixInstance *instance, QWidget *widgetParent, const bool onlyVanilla, const QStringList &external);
+ static bool readJsonAndApplyToVersion(VersionFinal *version, const QJsonObject &obj);
+
static QMap<QString, int> readOverrideOrders(OneSixInstance *instance);
static bool writeOverrideOrders(const QMap<QString, int> &order, OneSixInstance *instance);
@@ -42,14 +43,14 @@ public:
Q_DECLARE_FLAGS(ParseFlags, ParseFlag)
private:
- OneSixVersion *m_version;
+ VersionFinal *m_version;
OneSixInstance *m_instance;
QWidget *m_widgetParent;
- bool build(const bool onlyVanilla, const QStringList &external);
- bool read(const QJsonObject &obj);
+ bool buildInternal(const bool onlyVanilla, const QStringList &external);
+ bool readJsonAndApply(const QJsonObject &obj);
- bool read(const QFileInfo &fileInfo, const bool requireOrder, VersionFile *out, const ParseFlags flags = NoFlags);
+ bool parseJsonFile(const QFileInfo &fileInfo, const bool requireOrder, VersionFile *out, const ParseFlags flags = NoFlags);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(OneSixVersionBuilder::ParseFlags)