Get rid of parse flags
This commit is contained in:
parent
7c24bcc834
commit
053b938beb
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user