Merge branch 'fix_json_version' into integration_json_and_tools
Conflicts: logic/OneSixInstance.cpp logic/OneSixVersionBuilder.cpp Some fixage. Yay for conflicts.
This commit is contained in:
commit
49dc9695f5
@ -357,6 +357,7 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
|
||||
|
||||
QMenu myMenu;
|
||||
myMenu.addActions(actions);
|
||||
myMenu.setEnabled(m_selectedInstance->canLaunch());
|
||||
myMenu.exec(view->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
@ -1464,7 +1465,7 @@ void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex &
|
||||
(BaseInstance *)current.data(InstanceList::InstancePointerRole)
|
||||
.value<void *>()))
|
||||
{
|
||||
ui->instanceToolBar->setEnabled(true);
|
||||
ui->instanceToolBar->setEnabled(m_selectedInstance->canLaunch());
|
||||
renameButton->setText(m_selectedInstance->name());
|
||||
ui->actionChangeInstLWJGLVersion->setEnabled(
|
||||
m_selectedInstance->menuActionEnabled("actionChangeInstLWJGLVersion"));
|
||||
|
@ -37,6 +37,7 @@ BaseInstance::BaseInstance(BaseInstancePrivate *d_in, const QString &rootDir,
|
||||
I_D(BaseInstance);
|
||||
d->m_settings = settings_obj;
|
||||
d->m_rootDir = rootDir;
|
||||
d->m_flags = 0;
|
||||
|
||||
settings().registerSetting("name", "Unnamed Instance");
|
||||
settings().registerSetting("iconKey", "default");
|
||||
@ -146,6 +147,28 @@ SettingsObject &BaseInstance::settings() const
|
||||
return *d->m_settings;
|
||||
}
|
||||
|
||||
BaseInstance::InstanceFlags BaseInstance::flags() const
|
||||
{
|
||||
I_D(const BaseInstance);
|
||||
return InstanceFlags(d->m_flags);
|
||||
}
|
||||
|
||||
void BaseInstance::setFlags(const BaseInstance::InstanceFlags flags)
|
||||
{
|
||||
I_D(BaseInstance);
|
||||
if (flags != d->m_flags)
|
||||
{
|
||||
d->m_flags = flags;
|
||||
emit flagsChanged();
|
||||
emit propertiesChanged(this);
|
||||
}
|
||||
}
|
||||
|
||||
bool BaseInstance::canLaunch() const
|
||||
{
|
||||
return !(flags() & VersionBrokenFlag);
|
||||
}
|
||||
|
||||
QString BaseInstance::baseJar() const
|
||||
{
|
||||
I_D(BaseInstance);
|
||||
|
@ -179,6 +179,17 @@ public:
|
||||
/// FIXME: this really should be elsewhere...
|
||||
virtual QString instanceConfigFolder() const = 0;
|
||||
|
||||
enum InstanceFlag
|
||||
{
|
||||
NoFlags = 0x00,
|
||||
VersionBrokenFlag = 0x01
|
||||
};
|
||||
Q_DECLARE_FLAGS(InstanceFlags, InstanceFlag)
|
||||
InstanceFlags flags() const;
|
||||
void setFlags(const BaseInstance::InstanceFlags flags);
|
||||
|
||||
bool canLaunch() const;
|
||||
|
||||
signals:
|
||||
/*!
|
||||
* \brief Signal emitted when properties relevant to the instance view change
|
||||
@ -193,6 +204,8 @@ signals:
|
||||
*/
|
||||
void nuked(BaseInstance *inst);
|
||||
|
||||
void flagsChanged();
|
||||
|
||||
protected slots:
|
||||
void iconUpdated(QString key);
|
||||
|
||||
@ -202,3 +215,5 @@ protected:
|
||||
|
||||
// pointer for lazy people
|
||||
typedef std::shared_ptr<BaseInstance> InstancePtr;
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(BaseInstance::InstanceFlags)
|
||||
|
@ -26,4 +26,5 @@ struct BaseInstancePrivate
|
||||
QString m_rootDir;
|
||||
QString m_group;
|
||||
SettingsObject *m_settings;
|
||||
int m_flags;
|
||||
};
|
@ -7,6 +7,10 @@ LegacyFTBInstance::LegacyFTBInstance(const QString &rootDir, SettingsObject *set
|
||||
|
||||
QString LegacyFTBInstance::getStatusbarDescription()
|
||||
{
|
||||
if (flags() & VersionBrokenFlag)
|
||||
{
|
||||
return "Legacy FTB: " + intendedVersionId() + " (broken)";
|
||||
}
|
||||
return "Legacy FTB: " + intendedVersionId();
|
||||
}
|
||||
|
||||
|
@ -268,13 +268,23 @@ QString LegacyInstance::defaultCustomBaseJar() const
|
||||
|
||||
bool LegacyInstance::menuActionEnabled(QString action_name) const
|
||||
{
|
||||
if (action_name == "actionChangeInstMCVersion")
|
||||
if (flags() & VersionBrokenFlag)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (action_name == "actionChangeInstMCVersion")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QString LegacyInstance::getStatusbarDescription()
|
||||
{
|
||||
if (flags() & VersionBrokenFlag)
|
||||
{
|
||||
return "Legacy : " + intendedVersionId() + " (broken)";
|
||||
}
|
||||
if (shouldUpdate())
|
||||
return "Legacy : " + currentVersionId() + " -> " + intendedVersionId();
|
||||
else
|
||||
|
@ -23,6 +23,10 @@ NostalgiaInstance::NostalgiaInstance(const QString &rootDir, SettingsObject *set
|
||||
|
||||
QString NostalgiaInstance::getStatusbarDescription()
|
||||
{
|
||||
if (flags() & VersionBrokenFlag)
|
||||
{
|
||||
return "Nostalgia : " + intendedVersionId() + " (broken)";
|
||||
}
|
||||
return "Nostalgia : " + intendedVersionId();
|
||||
}
|
||||
|
||||
|
@ -182,6 +182,10 @@ bool OneSixFTBInstance::providesVersionFile() const
|
||||
|
||||
QString OneSixFTBInstance::getStatusbarDescription()
|
||||
{
|
||||
if (flags() & VersionBrokenFlag)
|
||||
{
|
||||
return "OneSix FTB: " + intendedVersionId() + " (broken)";
|
||||
}
|
||||
return "OneSix FTB: " + intendedVersionId();
|
||||
}
|
||||
bool OneSixFTBInstance::menuActionEnabled(QString action_name) const
|
||||
|
@ -325,8 +325,15 @@ bool OneSixInstance::reloadVersion(QWidget *widgetParent)
|
||||
{
|
||||
ret = d->vanillaVersion->reload(widgetParent, true, externalPatches());
|
||||
}
|
||||
|
||||
emit versionReloaded();
|
||||
if (ret)
|
||||
{
|
||||
setFlags(flags() & ~VersionBrokenFlag);
|
||||
emit versionReloaded();
|
||||
}
|
||||
else
|
||||
{
|
||||
setFlags(flags() | VersionBrokenFlag);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -362,8 +369,14 @@ QString OneSixInstance::defaultCustomBaseJar() const
|
||||
|
||||
bool OneSixInstance::menuActionEnabled(QString action_name) const
|
||||
{
|
||||
if (action_name == "actionChangeInstLWJGLVersion")
|
||||
if (flags() & VersionBrokenFlag)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (action_name == "actionChangeInstLWJGLVersion")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -372,7 +385,11 @@ QString OneSixInstance::getStatusbarDescription()
|
||||
QString descr = "OneSix : " + intendedVersionId();
|
||||
if (versionIsCustom())
|
||||
{
|
||||
descr + " (custom)";
|
||||
descr += " (custom)";
|
||||
}
|
||||
if (flags() & VersionBrokenFlag)
|
||||
{
|
||||
descr += " (broken)";
|
||||
}
|
||||
return descr;
|
||||
}
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include "modutils.h"
|
||||
#include "logger/QsLog.h"
|
||||
|
||||
#define CURRENT_MINIMUM_LAUNCHER_VERSION 14
|
||||
|
||||
struct VersionFile
|
||||
{
|
||||
int order;
|
||||
@ -95,6 +97,13 @@ struct VersionFile
|
||||
QList<Library> addLibs;
|
||||
QList<QString> removeLibs;
|
||||
|
||||
enum ApplyError
|
||||
{
|
||||
LauncherVersionError,
|
||||
OtherError,
|
||||
NoApplyError
|
||||
};
|
||||
|
||||
static Library fromLibraryJson(const QJsonObject &libObj, const QString &filename,
|
||||
bool &isError)
|
||||
{
|
||||
@ -547,15 +556,26 @@ struct VersionFile
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
void applyTo(OneSixVersion *version, bool &isError)
|
||||
ApplyError applyTo(OneSixVersion *version)
|
||||
{
|
||||
isError = true;
|
||||
if (minimumLauncherVersion != -1)
|
||||
{
|
||||
if (minimumLauncherVersion > CURRENT_MINIMUM_LAUNCHER_VERSION)
|
||||
{
|
||||
QLOG_ERROR() << filename << "is for a different launcher version ("
|
||||
<< minimumLauncherVersion << "), current supported is"
|
||||
<< CURRENT_MINIMUM_LAUNCHER_VERSION;
|
||||
return LauncherVersionError;
|
||||
}
|
||||
}
|
||||
|
||||
if (!version->id.isNull() && !mcVersion.isNull())
|
||||
{
|
||||
if (QRegExp(mcVersion, Qt::CaseInsensitive, QRegExp::Wildcard).indexIn(version->id) == -1)
|
||||
if (QRegExp(mcVersion, Qt::CaseInsensitive, QRegExp::Wildcard)
|
||||
.indexIn(version->id) == -1)
|
||||
{
|
||||
QLOG_ERROR() << filename << "is for a different version of Minecraft";
|
||||
return;
|
||||
return OtherError;
|
||||
}
|
||||
}
|
||||
|
||||
@ -706,7 +726,7 @@ struct VersionFile
|
||||
QLOG_ERROR() << "Error resolving library dependencies between"
|
||||
<< otherLib->rawName() << "and" << lib.name << "in"
|
||||
<< filename;
|
||||
return;
|
||||
return OtherError;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -734,7 +754,7 @@ struct VersionFile
|
||||
QLOG_ERROR() << "Error resolving library dependencies between"
|
||||
<< otherLib->rawName() << "and" << lib.name << "in"
|
||||
<< filename;
|
||||
return;
|
||||
return OtherError;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -778,7 +798,7 @@ struct VersionFile
|
||||
versionFile.order = order;
|
||||
version->versionFiles.append(versionFile);
|
||||
|
||||
isError = false;
|
||||
return NoApplyError;
|
||||
}
|
||||
};
|
||||
|
||||
@ -812,166 +832,111 @@ bool OneSixVersionBuilder::build(const bool onlyVanilla, const QStringList &exte
|
||||
QDir root(m_instance->instanceRoot());
|
||||
QDir patches(root.absoluteFilePath("patches/"));
|
||||
|
||||
if (external.isEmpty())
|
||||
// if we do external files, do just those.
|
||||
if(!external.isEmpty()) for (auto fileName : external)
|
||||
{
|
||||
if (QFile::exists(root.absoluteFilePath("custom.json")))
|
||||
QLOG_INFO() << "Reading" << fileName;
|
||||
VersionFile file;
|
||||
ParseFlags flags = fileName.endsWith("pack.json") ? IsFTBPackJson : NoFlags;
|
||||
if (!read(QFileInfo(fileName), false, &file, flags))
|
||||
{
|
||||
QLOG_INFO() << "Reading custom.json";
|
||||
return false;
|
||||
}
|
||||
file.name = QFileInfo(fileName).fileName();
|
||||
file.fileId = "org.multimc.external." + file.name;
|
||||
file.version = QString();
|
||||
file.mcVersion = QString();
|
||||
bool isError = false;
|
||||
auto errorcode = file.applyTo(m_version);
|
||||
if(errorcode != VersionFile::NoApplyError)
|
||||
return false;
|
||||
}
|
||||
// else, if there's custom json, we just do that.
|
||||
else if (QFile::exists(root.absoluteFilePath("custom.json")))
|
||||
{
|
||||
QLOG_INFO() << "Reading custom.json";
|
||||
VersionFile file;
|
||||
if (!read(QFileInfo(root.absoluteFilePath("custom.json")), false, &file))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
file.name = "custom.json";
|
||||
file.filename = "custom.json";
|
||||
file.fileId = "org.multimc.custom.json";
|
||||
file.version = QString();
|
||||
auto errorcode = file.applyTo(m_version);
|
||||
if(errorcode != VersionFile::NoApplyError)
|
||||
return false;
|
||||
// QObject::tr("The version descriptors of this instance are not compatible with the current version of MultiMC"));
|
||||
// QObject::tr("Error while applying %1. Please check MultiMC-0.log for more info.")
|
||||
}
|
||||
// version.json -> patches/*.json -> user.json
|
||||
else do
|
||||
{
|
||||
// version.json
|
||||
QLOG_INFO() << "Reading version.json";
|
||||
VersionFile file;
|
||||
if (!read(QFileInfo(root.absoluteFilePath("version.json")), false, &file))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
file.name = "version.json";
|
||||
file.fileId = "org.multimc.version.json";
|
||||
file.version = m_instance->intendedVersionId();
|
||||
file.mcVersion = m_instance->intendedVersionId();
|
||||
auto error = file.applyTo(m_version);
|
||||
if (error != VersionFile::NoApplyError)
|
||||
{
|
||||
QMessageBox::critical(
|
||||
m_widgetParent, QObject::tr("Error"),
|
||||
QObject::tr(
|
||||
"Error while applying %1. Please check MultiMC-0.log for more info.")
|
||||
.arg(root.absoluteFilePath("version.json")));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (onlyVanilla)
|
||||
break;
|
||||
|
||||
// patches/
|
||||
// load all, put into map for ordering, apply in the right order
|
||||
QMap<QString, int> overrideOrder = readOverrideOrders(m_instance);
|
||||
|
||||
QMap<int, QPair<QString, VersionFile>> files;
|
||||
for (auto info : patches.entryInfoList(QStringList() << "*.json", QDir::Files))
|
||||
{
|
||||
QLOG_INFO() << "Reading" << info.fileName();
|
||||
VersionFile file;
|
||||
if (!read(QFileInfo(root.absoluteFilePath("custom.json")), false, &file))
|
||||
if (!read(info, true, &file))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
file.name = "custom.json";
|
||||
file.filename = "custom.json";
|
||||
file.fileId = "org.multimc.custom.json";
|
||||
file.version = QString();
|
||||
bool isError = false;
|
||||
file.applyTo(m_version, isError);
|
||||
if (isError)
|
||||
if (overrideOrder.contains(file.fileId))
|
||||
{
|
||||
file.order = overrideOrder.value(file.fileId);
|
||||
}
|
||||
if (files.contains(file.order))
|
||||
{
|
||||
QLOG_ERROR() << file.fileId << "has the same order as" << files[file.order].second.fileId;
|
||||
return false;
|
||||
}
|
||||
files.insert(file.order, qMakePair(info.fileName(), file));
|
||||
}
|
||||
for (auto order : files.keys())
|
||||
{
|
||||
QLOG_DEBUG() << "Applying file with order" << order;
|
||||
auto filePair = files[order];
|
||||
auto error = filePair.second.applyTo(m_version);
|
||||
if (error != VersionFile::NoApplyError)
|
||||
{
|
||||
QMessageBox::critical(
|
||||
m_widgetParent, QObject::tr("Error"),
|
||||
QObject::tr(
|
||||
"Error while applying %1. Please check MultiMC-0.log for more info.")
|
||||
.arg(root.absoluteFilePath("custom.json")));
|
||||
QObject::tr("Error while applying %1. Please check MultiMC-0.log "
|
||||
"for more info.").arg(filePair.first));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// version.json -> patches/*.json -> user.json
|
||||
|
||||
// version.json
|
||||
{
|
||||
QLOG_INFO() << "Reading version.json";
|
||||
VersionFile file;
|
||||
if (!read(QFileInfo(root.absoluteFilePath("version.json")), false, &file))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
file.name = "version.json";
|
||||
file.fileId = "org.multimc.version.json";
|
||||
file.version = m_instance->intendedVersionId();
|
||||
file.mcVersion = m_instance->intendedVersionId();
|
||||
bool isError = false;
|
||||
file.applyTo(m_version, isError);
|
||||
if (isError)
|
||||
{
|
||||
QMessageBox::critical(
|
||||
m_widgetParent, QObject::tr("Error"),
|
||||
QObject::tr(
|
||||
"Error while applying %1. Please check MultiMC-0.log for more info.")
|
||||
.arg(root.absoluteFilePath("version.json")));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!onlyVanilla)
|
||||
{
|
||||
|
||||
// patches/
|
||||
{
|
||||
// load all, put into map for ordering, apply in the right order
|
||||
QMap<QString, int> overrideOrder = readOverrideOrders(m_instance);
|
||||
|
||||
QMap<int, QPair<QString, VersionFile>> files;
|
||||
for (auto info : patches.entryInfoList(QStringList() << "*.json", QDir::Files))
|
||||
{
|
||||
QLOG_INFO() << "Reading" << info.fileName();
|
||||
VersionFile file;
|
||||
if (!read(info, true, &file))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (overrideOrder.contains(file.fileId))
|
||||
{
|
||||
file.order = overrideOrder.value(file.fileId);
|
||||
}
|
||||
if (files.contains(file.order))
|
||||
{
|
||||
QLOG_ERROR() << file.fileId << "has the same order as" << files[file.order].second.fileId;
|
||||
return false;
|
||||
}
|
||||
files.insert(file.order, qMakePair(info.fileName(), file));
|
||||
}
|
||||
for (auto order : files.keys())
|
||||
{
|
||||
QLOG_DEBUG() << "Applying file with order" << order;
|
||||
auto filePair = files[order];
|
||||
bool isError = false;
|
||||
filePair.second.applyTo(m_version, isError);
|
||||
if (isError)
|
||||
{
|
||||
QMessageBox::critical(
|
||||
m_widgetParent, QObject::tr("Error"),
|
||||
QObject::tr("Error while applying %1. Please check MultiMC-0.log "
|
||||
"for more info.").arg(filePair.first));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// user.json
|
||||
{
|
||||
if (QFile::exists(root.absoluteFilePath("user.json")))
|
||||
{
|
||||
QLOG_INFO() << "Reading user.json";
|
||||
VersionFile file;
|
||||
if (!read(QFileInfo(root.absoluteFilePath("user.json")), false, &file))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
file.name = "user.json";
|
||||
file.fileId = "org.multimc.user.json";
|
||||
file.version = QString();
|
||||
file.mcVersion = QString();
|
||||
bool isError = false;
|
||||
file.applyTo(m_version, isError);
|
||||
if (isError)
|
||||
{
|
||||
QMessageBox::critical(
|
||||
m_widgetParent, QObject::tr("Error"),
|
||||
QObject::tr(
|
||||
"Error while applying %1. Please check MultiMC-0.log for more info.")
|
||||
.arg(root.absoluteFilePath("user.json")));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto fileName : external)
|
||||
{
|
||||
QLOG_INFO() << "Reading" << fileName;
|
||||
VersionFile file;
|
||||
ParseFlags flags = fileName.endsWith("pack.json") ? IsFTBPackJson : NoFlags;
|
||||
if (!read(QFileInfo(fileName), false, &file, flags))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
file.name = QFileInfo(fileName).fileName();
|
||||
file.fileId = "org.multimc.external." + file.name;
|
||||
file.version = QString();
|
||||
file.mcVersion = QString();
|
||||
bool isError = false;
|
||||
file.applyTo(m_version, isError);
|
||||
if (isError)
|
||||
{
|
||||
QMessageBox::critical(
|
||||
m_widgetParent, QObject::tr("Error"),
|
||||
QObject::tr(
|
||||
"Error while applying %1. Please check MultiMC-0.log for more info.")
|
||||
.arg(fileName));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} while(0);
|
||||
|
||||
// some final touches
|
||||
{
|
||||
@ -1016,14 +981,21 @@ bool OneSixVersionBuilder::read(const QJsonObject &obj)
|
||||
QObject::tr("Error while reading. Please check MultiMC-0.log for more info."));
|
||||
return false;
|
||||
}
|
||||
file.applyTo(m_version, isError);
|
||||
if (isError)
|
||||
VersionFile::ApplyError error = file.applyTo(m_version);
|
||||
if (error == VersionFile::OtherError)
|
||||
{
|
||||
QMessageBox::critical(
|
||||
m_widgetParent, QObject::tr("Error"),
|
||||
QObject::tr("Error while applying. Please check MultiMC-0.log for more info."));
|
||||
return false;
|
||||
}
|
||||
else if (error == VersionFile::LauncherVersionError)
|
||||
{
|
||||
QMessageBox::critical(
|
||||
m_widgetParent, QObject::tr("Error"),
|
||||
QObject::tr("The version descriptors of this instance are not compatible with the current version of MultiMC"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1070,7 +1042,8 @@ QMap<QString, int> OneSixVersionBuilder::readOverrideOrders(OneSixInstance *inst
|
||||
QFile orderFile(instance->instanceRoot() + "/order.json");
|
||||
if (!orderFile.open(QFile::ReadOnly))
|
||||
{
|
||||
QLOG_ERROR() << "Couldn't open" << orderFile.fileName() << " for reading:" << orderFile.errorString();
|
||||
QLOG_ERROR() << "Couldn't open" << orderFile.fileName()
|
||||
<< " for reading:" << orderFile.errorString();
|
||||
QLOG_WARN() << "Ignoring overriden order";
|
||||
}
|
||||
else
|
||||
@ -1079,7 +1052,8 @@ QMap<QString, int> OneSixVersionBuilder::readOverrideOrders(OneSixInstance *inst
|
||||
QJsonDocument doc = QJsonDocument::fromJson(orderFile.readAll(), &error);
|
||||
if (error.error != QJsonParseError::NoError || !doc.isObject())
|
||||
{
|
||||
QLOG_ERROR() << "Couldn't parse" << orderFile.fileName() << ":" << error.errorString();
|
||||
QLOG_ERROR() << "Couldn't parse" << orderFile.fileName() << ":"
|
||||
<< error.errorString();
|
||||
QLOG_WARN() << "Ignoring overriden order";
|
||||
}
|
||||
else
|
||||
@ -1098,7 +1072,8 @@ QMap<QString, int> OneSixVersionBuilder::readOverrideOrders(OneSixInstance *inst
|
||||
}
|
||||
return out;
|
||||
}
|
||||
bool OneSixVersionBuilder::writeOverrideOrders(const QMap<QString, int> &order, OneSixInstance *instance)
|
||||
bool OneSixVersionBuilder::writeOverrideOrders(const QMap<QString, int> &order,
|
||||
OneSixInstance *instance)
|
||||
{
|
||||
QJsonObject obj;
|
||||
for (auto it = order.cbegin(); it != order.cend(); ++it)
|
||||
@ -1112,9 +1087,11 @@ bool OneSixVersionBuilder::writeOverrideOrders(const QMap<QString, int> &order,
|
||||
QFile orderFile(instance->instanceRoot() + "/order.json");
|
||||
if (!orderFile.open(QFile::WriteOnly))
|
||||
{
|
||||
QLOG_ERROR() << "Couldn't open" << orderFile.fileName() << "for writing:" << orderFile.errorString();
|
||||
QLOG_ERROR() << "Couldn't open" << orderFile.fileName()
|
||||
<< "for writing:" << orderFile.errorString();
|
||||
return false;
|
||||
}
|
||||
orderFile.write(QJsonDocument(obj).toJson(QJsonDocument::Indented));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user