NOISSUE move version file reading and writing to dedicated namespaces
This commit is contained in:
parent
17ad1e64f8
commit
a0b47aee5b
16 changed files with 328 additions and 308 deletions
|
@ -68,7 +68,6 @@ void MinecraftProfile::clear()
|
|||
assets.clear();
|
||||
processArguments.clear();
|
||||
minecraftArguments.clear();
|
||||
minimumLauncherVersion = 0xDEADBEAF;
|
||||
mainClass.clear();
|
||||
appletClass.clear();
|
||||
libraries.clear();
|
||||
|
@ -267,23 +266,6 @@ QList<std::shared_ptr<RawLibrary> > MinecraftProfile::getActiveNativeLibs()
|
|||
return output;
|
||||
}
|
||||
|
||||
std::shared_ptr<MinecraftProfile> MinecraftProfile::fromJson(const QJsonObject &obj)
|
||||
{
|
||||
std::shared_ptr<MinecraftProfile> version(new MinecraftProfile(new NullProfileStrategy()));
|
||||
try
|
||||
{
|
||||
version->clear();
|
||||
auto file = VersionFile::fromJson(QJsonDocument(obj), QString(), false);
|
||||
file->applyTo(version.get());
|
||||
version->appendPatch(file);
|
||||
}
|
||||
catch(Exception &err)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
QVariant MinecraftProfile::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue