GH-1794 Only write to the instance.cfg once after copying FTB instances.
This commit is contained in:
parent
c421134d49
commit
cf43abc87e
@ -67,7 +67,7 @@ public:
|
||||
/// virtual destructor to make sure the destruction is COMPLETE
|
||||
virtual ~BaseInstance() {};
|
||||
|
||||
virtual void copy(const QDir &newDir) {}
|
||||
virtual void copy(SettingsObjectPtr newSettings, const QDir &newDir) {}
|
||||
|
||||
virtual void init() = 0;
|
||||
|
||||
|
@ -51,7 +51,7 @@ void InstanceCopyTask::copyFinished()
|
||||
instanceSettings->registerSetting("InstanceType", "Legacy");
|
||||
|
||||
// FIXME: and this too? errors???
|
||||
m_origInstance->copy(m_stagingPath);
|
||||
m_origInstance->copy(instanceSettings, m_stagingPath);
|
||||
|
||||
InstancePtr inst(new NullInstance(m_globalSettings, instanceSettings, m_stagingPath));
|
||||
inst->setName(m_instName);
|
||||
|
@ -15,7 +15,7 @@ OneSixFTBInstance::OneSixFTBInstance(SettingsObjectPtr globalSettings, SettingsO
|
||||
m_globalSettings = globalSettings;
|
||||
}
|
||||
|
||||
void OneSixFTBInstance::copy(const QDir &newDir)
|
||||
void OneSixFTBInstance::copy(SettingsObjectPtr newSettings, const QDir &newDir)
|
||||
{
|
||||
QStringList libraryNames;
|
||||
// create patch file
|
||||
@ -94,10 +94,7 @@ void OneSixFTBInstance::copy(const QDir &newDir)
|
||||
}
|
||||
}
|
||||
// now set the target instance to be plain OneSix
|
||||
INISettingsObject settings_obj(newDir.absoluteFilePath("instance.cfg"));
|
||||
settings_obj.registerSetting("InstanceType", "Legacy");
|
||||
QString inst_type = settings_obj.get("InstanceType").toString();
|
||||
settings_obj.set("InstanceType", "OneSix");
|
||||
newSettings->set("InstanceType", "OneSix");
|
||||
}
|
||||
|
||||
QString OneSixFTBInstance::id() const
|
||||
|
@ -9,7 +9,7 @@ public:
|
||||
explicit OneSixFTBInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir);
|
||||
virtual ~OneSixFTBInstance(){};
|
||||
|
||||
void copy(const QDir &newDir) override;
|
||||
void copy(SettingsObjectPtr newSettings, const QDir &newDir) override;
|
||||
|
||||
virtual void createProfile() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user