summaryrefslogtreecommitdiffstats
path: root/logic/ftb/LegacyFTBInstance.cpp
blob: e749067914653cedfc8d2ec7e4949a36e7936f02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "LegacyFTBInstance.h"
#include <settings/INISettingsObject.h>
#include <QDir>

LegacyFTBInstance::LegacyFTBInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) :
	LegacyInstance(globalSettings, settings, rootDir)
{
}

QString LegacyFTBInstance::getStatusbarDescription()
{
	if (flags() & VersionBrokenFlag)
	{
		return "Legacy FTB: " + intendedVersionId() + " (broken)";
	}
	return "Legacy FTB: " + intendedVersionId();
}

QString LegacyFTBInstance::id() const
{
	return "FTB/" + BaseInstance::id();
}

void LegacyFTBInstance::copy(const QDir &newDir)
{
	// set the target instance to be plain Legacy
	INISettingsObject settings_obj(newDir.absoluteFilePath("instance.cfg"));
	settings_obj.registerSetting("InstanceType", "Legacy");
	QString inst_type = settings_obj.get("InstanceType").toString();
	settings_obj.set("InstanceType", "Legacy");
}