summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-04-08 19:49:02 +0200
committerPetr Mrázek <peterix@gmail.com>2018-04-08 19:49:02 +0200
commit8cefc76108fb0e0fc892c60c895333476489cfc4 (patch)
tree7ac2cd87df3c8f94661b485e654e47ffaf40bbd3
parent172f83c7e2fc28a444ec7b8e4c04128cd54fc210 (diff)
downloadMultiMC-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
-rw-r--r--application/VersionProxyModel.cpp11
-rw-r--r--application/VersionProxyModel.h3
2 files changed, 13 insertions, 1 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);
diff --git a/application/VersionProxyModel.h b/application/VersionProxyModel.h
index 33a0d1ea..91d1ba23 100644
--- a/application/VersionProxyModel.h
+++ b/application/VersionProxyModel.h
@@ -18,7 +18,8 @@ public:
Branch,
Type,
Architecture,
- Path
+ Path,
+ Time
};
typedef QHash<BaseVersionList::ModelRoles, std::shared_ptr<Filter>> FilterMap;