summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-03-02 01:51:40 +0100
committerPetr Mrázek <peterix@gmail.com>2014-03-02 01:51:40 +0100
commit053b938beb7bb47fc63ec1ec2df519573629e32b (patch)
treec0ed73a62a8400bc2ecb63fe82ee983545e2d421 /logic
parent7c24bcc83476dcbdd7f7acbe14ecef4398962689 (diff)
downloadMultiMC-053b938beb7bb47fc63ec1ec2df519573629e32b.tar
MultiMC-053b938beb7bb47fc63ec1ec2df519573629e32b.tar.gz
MultiMC-053b938beb7bb47fc63ec1ec2df519573629e32b.tar.lz
MultiMC-053b938beb7bb47fc63ec1ec2df519573629e32b.tar.xz
MultiMC-053b938beb7bb47fc63ec1ec2df519573629e32b.zip
Get rid of parse flags
Diffstat (limited to 'logic')
-rw-r--r--logic/OneSixVersionBuilder.cpp8
-rw-r--r--logic/OneSixVersionBuilder.h11
2 files changed, 4 insertions, 15 deletions
diff --git a/logic/OneSixVersionBuilder.cpp b/logic/OneSixVersionBuilder.cpp
index 0d4d66a2..2b05e45a 100644
--- a/logic/OneSixVersionBuilder.cpp
+++ b/logic/OneSixVersionBuilder.cpp
@@ -68,7 +68,7 @@ bool OneSixVersionBuilder::buildInternal(const bool onlyVanilla, const QStringLi
{
QLOG_INFO() << "Reading" << fileName;
VersionFile file;
- if (!parseJsonFile(QFileInfo(fileName), false, &file, fileName.endsWith("pack.json") ? IsFTBPackJson : NoFlags))
+ if (!parseJsonFile(QFileInfo(fileName), false, &file, fileName.endsWith("pack.json")))
{
return false;
}
@@ -230,8 +230,7 @@ bool OneSixVersionBuilder::readJsonAndApply(const QJsonObject &obj)
return true;
}
-bool OneSixVersionBuilder::parseJsonFile(const QFileInfo &fileInfo, const bool requireOrder,
- VersionFile *out, const ParseFlags flags)
+bool OneSixVersionBuilder::parseJsonFile(const QFileInfo& fileInfo, const bool requireOrder, VersionFile* out, bool isFTB)
{
QFile file(fileInfo.absoluteFilePath());
if (!file.open(QFile::ReadOnly))
@@ -252,14 +251,13 @@ bool OneSixVersionBuilder::parseJsonFile(const QFileInfo &fileInfo, const bool r
return false;
}
bool isError = false;
- *out = VersionFile::fromJson(doc, file.fileName(), requireOrder, isError, flags);
+ *out = VersionFile::fromJson(doc, file.fileName(), requireOrder, isError, isFTB);
if (isError)
{
QMessageBox::critical(
m_widgetParent, QObject::tr("Error"),
QObject::tr("Error while reading %1. Please check MultiMC-0.log for more info.")
.arg(file.fileName()));
- ;
}
return true;
}
diff --git a/logic/OneSixVersionBuilder.h b/logic/OneSixVersionBuilder.h
index 8ca2551a..fe77ed9d 100644
--- a/logic/OneSixVersionBuilder.h
+++ b/logic/OneSixVersionBuilder.h
@@ -35,13 +35,6 @@ public:
static QMap<QString, int> readOverrideOrders(OneSixInstance *instance);
static bool writeOverrideOrders(const QMap<QString, int> &order, OneSixInstance *instance);
- enum ParseFlag
- {
- NoFlags = 0x0,
- IsFTBPackJson = 0x1
- };
- Q_DECLARE_FLAGS(ParseFlags, ParseFlag)
-
private:
VersionFinal *m_version;
OneSixInstance *m_instance;
@@ -50,7 +43,5 @@ private:
bool buildInternal(const bool onlyVanilla, const QStringList &external);
bool readJsonAndApply(const QJsonObject &obj);
- bool parseJsonFile(const QFileInfo &fileInfo, const bool requireOrder, VersionFile *out, const ParseFlags flags = NoFlags);
+ bool parseJsonFile(const QFileInfo &fileInfo, const bool requireOrder, VersionFile *out, bool isFTB = false);
};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(OneSixVersionBuilder::ParseFlags)