示例#1
0
bool OneSixInstance::reloadFullVersion()
{
	I_D(OneSixInstance);
	
	QString verpath = PathCombine(instanceRoot(), "version.json");
	QFile versionfile(verpath);
	if(versionfile.exists() && versionfile.open(QIODevice::ReadOnly))
	{
		FullVersionFactory fvf;
		auto version = fvf.parse(versionfile.readAll());
		versionfile.close();
		if(version)
		{
			d->version = version;
			return true;
		}
	};
	return false;
}
示例#2
0
bool OneSixInstance::reloadFullVersion()
{
	I_D(OneSixInstance);

	QString verpath = PathCombine(instanceRoot(), "version.json");
	{
		QString verpath_custom = PathCombine(instanceRoot(), "custom.json");
		QFile versionfile(verpath_custom);
		if (versionfile.exists())
			verpath = verpath_custom;
	}

	auto version = OneSixVersion::fromFile(verpath);
	if (version)
	{
		d->version = version;
		return true;
	}
	else
	{
		d->version.reset();
		return false;
	}
}
示例#3
0
bool OneSixInstance::versionIsCustom()
{
	QString verpath_custom = PathCombine(instanceRoot(), "custom.json");
	QFile versionfile(verpath_custom);
	return versionfile.exists();
}