diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-04-08 19:49:02 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-04-08 19:49:02 +0200 |
commit | 8cefc76108fb0e0fc892c60c895333476489cfc4 (patch) | |
tree | 7ac2cd87df3c8f94661b485e654e47ffaf40bbd3 /application/VersionProxyModel.cpp | |
parent | 172f83c7e2fc28a444ec7b8e4c04128cd54fc210 (diff) | |
download | MultiMC-8cefc76108fb0e0fc892c60c895333476489cfc4.tar MultiMC-8cefc76108fb0e0fc892c60c895333476489cfc4.tar.gz MultiMC-8cefc76108fb0e0fc892c60c895333476489cfc4.tar.lz MultiMC-8cefc76108fb0e0fc892c60c895333476489cfc4.tar.xz MultiMC-8cefc76108fb0e0fc892c60c895333476489cfc4.zip |
NOISSUE show release dates of the meta versions in version picker views
Diffstat (limited to 'application/VersionProxyModel.cpp')
-rw-r--r-- | application/VersionProxyModel.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/application/VersionProxyModel.cpp b/application/VersionProxyModel.cpp index c180adf2..d59fceee 100644 --- a/application/VersionProxyModel.cpp +++ b/application/VersionProxyModel.cpp @@ -3,6 +3,7 @@ #include <QSortFilterProxyModel> #include <QPixmapCache> #include <Version.h> +#include <meta/VersionList.h> class VersionFilterModel : public QSortFilterProxyModel { @@ -83,6 +84,8 @@ QVariant VersionProxyModel::headerData(int section, Qt::Orientation orientation, return tr("Architecture"); case Path: return tr("Path"); + case Time: + return tr("Released"); } } else if(role == Qt::ToolTipRole) @@ -101,6 +104,8 @@ QVariant VersionProxyModel::headerData(int section, Qt::Orientation orientation, return tr("CPU Architecture"); case Path: return tr("Filesystem path to this version"); + case Time: + return tr("Release date of this version"); } } return QVariant(); @@ -132,6 +137,8 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const return sourceModel()->data(parentIndex, BaseVersionList::ArchitectureRole); case Path: return sourceModel()->data(parentIndex, BaseVersionList::PathRole); + case Time: + return sourceModel()->data(parentIndex, Meta::VersionList::TimeRole).toDate(); default: return QVariant(); } @@ -317,6 +324,10 @@ void VersionProxyModel::setSourceModel(QAbstractItemModel *replacingRaw) { m_columns.push_back(Path); } + if(roles.contains(Meta::VersionList::TimeRole)) + { + m_columns.push_back(Time); + } if(roles.contains(BaseVersionList::BranchRole)) { m_columns.push_back(Branch); |