diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:27:24 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:27:24 +0200 |
commit | 795889d934e8f4ebe89be1a49a3417fd98e89be1 (patch) | |
tree | c5b0d30d425003c4b88e84a2908e63eb5ed797b9 /application/VersionProxyModel.cpp | |
parent | 160b5033a79e6b5ee9f3e2a001b96c677f41ddcb (diff) | |
parent | 8e58d61150b0bdbe9eb91065d36342f3004fe97b (diff) | |
download | MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.gz MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.lz MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.xz MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.zip |
Merge branch 'feature/meta' into develop
Diffstat (limited to 'application/VersionProxyModel.cpp')
-rw-r--r-- | application/VersionProxyModel.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/application/VersionProxyModel.cpp b/application/VersionProxyModel.cpp index 22df7e09..96bdc9ab 100644 --- a/application/VersionProxyModel.cpp +++ b/application/VersionProxyModel.cpp @@ -26,19 +26,9 @@ public: switch(role) { - case BaseVersionList::ParentGameVersionRole: + 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(); @@ -146,7 +136,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: @@ -313,9 +303,9 @@ void VersionProxyModel::setSourceModel(QAbstractItemModel *replacingRaw) auto replacing = dynamic_cast<BaseVersionList *>(replacingRaw); beginResetModel(); + m_columns.clear(); if(!replacing) { - m_columns.clear(); roles.clear(); filterModel->setSourceModel(replacing); return; @@ -327,7 +317,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); } |