NOISSUE show release dates of the meta versions in version picker views
This commit is contained in:
parent
172f83c7e2
commit
8cefc76108
@ -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);
|
||||
|
@ -18,7 +18,8 @@ public:
|
||||
Branch,
|
||||
Type,
|
||||
Architecture,
|
||||
Path
|
||||
Path,
|
||||
Time
|
||||
};
|
||||
typedef QHash<BaseVersionList::ModelRoles, std::shared_ptr<Filter>> FilterMap;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user