From 8321187a20eec9871f327aa23f421e79dcfdd409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 12 Mar 2017 16:00:06 +0100 Subject: NOISSUE fix downloading of metadata files --- application/VersionProxyModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'application/VersionProxyModel.cpp') diff --git a/application/VersionProxyModel.cpp b/application/VersionProxyModel.cpp index 22df7e09..50b94d9e 100644 --- a/application/VersionProxyModel.cpp +++ b/application/VersionProxyModel.cpp @@ -313,9 +313,9 @@ void VersionProxyModel::setSourceModel(QAbstractItemModel *replacingRaw) auto replacing = dynamic_cast(replacingRaw); beginResetModel(); + m_columns.clear(); if(!replacing) { - m_columns.clear(); roles.clear(); filterModel->setSourceModel(replacing); return; -- cgit v1.2.3 From 5fabb4f2546fa6b79a4e2c29679f506e587a0070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 27 Mar 2017 03:34:39 +0200 Subject: 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. --- application/VersionProxyModel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'application/VersionProxyModel.cpp') diff --git a/application/VersionProxyModel.cpp b/application/VersionProxyModel.cpp index 50b94d9e..00390b36 100644 --- a/application/VersionProxyModel.cpp +++ b/application/VersionProxyModel.cpp @@ -26,7 +26,7 @@ public: switch(role) { - case BaseVersionList::ParentGameVersionRole: + case BaseVersionList::ParentVersionRole: case BaseVersionList::VersionIdRole: { auto versionString = data.toString(); @@ -146,7 +146,7 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const case Name: return sourceModel()->data(parentIndex, BaseVersionList::VersionRole); case ParentVersion: - return sourceModel()->data(parentIndex, BaseVersionList::ParentGameVersionRole); + return sourceModel()->data(parentIndex, BaseVersionList::ParentVersionRole); case Branch: return sourceModel()->data(parentIndex, BaseVersionList::BranchRole); case Type: @@ -327,7 +327,7 @@ void VersionProxyModel::setSourceModel(QAbstractItemModel *replacingRaw) m_columns.push_back(Name); } /* - if(roles.contains(BaseVersionList::ParentGameVersionRole)) + if(roles.contains(BaseVersionList::ParentVersionRole)) { m_columns.push_back(ParentVersion); } -- cgit v1.2.3 From f565798650b453ed8c94422096d9b37ba81ebf3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 1 Apr 2017 18:38:04 +0200 Subject: NOISSUE remove unused version range filtering --- application/VersionProxyModel.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'application/VersionProxyModel.cpp') diff --git a/application/VersionProxyModel.cpp b/application/VersionProxyModel.cpp index 00390b36..96bdc9ab 100644 --- a/application/VersionProxyModel.cpp +++ b/application/VersionProxyModel.cpp @@ -28,17 +28,7 @@ public: { case BaseVersionList::ParentVersionRole: case BaseVersionList::VersionIdRole: - { - auto versionString = data.toString(); - if(it.value().exact) - { - return versionString == it.value().string; - } - else - { - return versionIsInInterval(versionString, it.value().string); - } - } + // TODO: work with metadata here. Previous implementation based on the Version class is not sufficient default: { auto match = data.toString(); -- cgit v1.2.3