NOISSUE Rough refactor of ProfilePatch and VersionFile internals.

They are now distinct classes with distinct responsibilities.

* ProfilePatch is an entry in MinecraftProfile and can hold VersionFile or Meta::Version.
* VersionFile is the basic element that holds version information loaded from JSON.
* Meta::Version is the loader class for VersionFile(s) from a server.
This commit is contained in:
Petr Mrázek
2017-03-27 03:34:39 +02:00
parent 6f2a87167a
commit 5fabb4f254
22 changed files with 431 additions and 374 deletions

View File

@ -32,7 +32,7 @@ QString Meta::Version::descriptor()
QString Meta::Version::name()
{
if(m_data)
return m_data->getName();
return m_data->name;
return m_uid;
}
QString Meta::Version::typeString() const

View File

@ -73,7 +73,7 @@ QVariant VersionList::data(const QModelIndex &index, int role) const
case VersionRole:
case VersionIdRole:
return version->version();
case ParentGameVersionRole:
case ParentVersionRole:
{
auto parentUid = this->parentUid();
if(parentUid.isEmpty())
@ -102,7 +102,7 @@ QVariant VersionList::data(const QModelIndex &index, int role) const
BaseVersionList::RoleList VersionList::providesRoles() const
{
return {VersionPointerRole, VersionRole, VersionIdRole, ParentGameVersionRole,
return {VersionPointerRole, VersionRole, VersionIdRole, ParentVersionRole,
TypeRole, UidRole, TimeRole, RequiresRole, SortRole,
RecommendedRole, LatestRole, VersionPtrRole};
}