summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;