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 <QSortFilterProxyModel>
|
||||||
#include <QPixmapCache>
|
#include <QPixmapCache>
|
||||||
#include <Version.h>
|
#include <Version.h>
|
||||||
|
#include <meta/VersionList.h>
|
||||||
|
|
||||||
class VersionFilterModel : public QSortFilterProxyModel
|
class VersionFilterModel : public QSortFilterProxyModel
|
||||||
{
|
{
|
||||||
@ -83,6 +84,8 @@ QVariant VersionProxyModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
return tr("Architecture");
|
return tr("Architecture");
|
||||||
case Path:
|
case Path:
|
||||||
return tr("Path");
|
return tr("Path");
|
||||||
|
case Time:
|
||||||
|
return tr("Released");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(role == Qt::ToolTipRole)
|
else if(role == Qt::ToolTipRole)
|
||||||
@ -101,6 +104,8 @@ QVariant VersionProxyModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
return tr("CPU Architecture");
|
return tr("CPU Architecture");
|
||||||
case Path:
|
case Path:
|
||||||
return tr("Filesystem path to this version");
|
return tr("Filesystem path to this version");
|
||||||
|
case Time:
|
||||||
|
return tr("Release date of this version");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
@ -132,6 +137,8 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const
|
|||||||
return sourceModel()->data(parentIndex, BaseVersionList::ArchitectureRole);
|
return sourceModel()->data(parentIndex, BaseVersionList::ArchitectureRole);
|
||||||
case Path:
|
case Path:
|
||||||
return sourceModel()->data(parentIndex, BaseVersionList::PathRole);
|
return sourceModel()->data(parentIndex, BaseVersionList::PathRole);
|
||||||
|
case Time:
|
||||||
|
return sourceModel()->data(parentIndex, Meta::VersionList::TimeRole).toDate();
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -317,6 +324,10 @@ void VersionProxyModel::setSourceModel(QAbstractItemModel *replacingRaw)
|
|||||||
{
|
{
|
||||||
m_columns.push_back(Path);
|
m_columns.push_back(Path);
|
||||||
}
|
}
|
||||||
|
if(roles.contains(Meta::VersionList::TimeRole))
|
||||||
|
{
|
||||||
|
m_columns.push_back(Time);
|
||||||
|
}
|
||||||
if(roles.contains(BaseVersionList::BranchRole))
|
if(roles.contains(BaseVersionList::BranchRole))
|
||||||
{
|
{
|
||||||
m_columns.push_back(Branch);
|
m_columns.push_back(Branch);
|
||||||
|
@ -18,7 +18,8 @@ public:
|
|||||||
Branch,
|
Branch,
|
||||||
Type,
|
Type,
|
||||||
Architecture,
|
Architecture,
|
||||||
Path
|
Path,
|
||||||
|
Time
|
||||||
};
|
};
|
||||||
typedef QHash<BaseVersionList::ModelRoles, std::shared_ptr<Filter>> FilterMap;
|
typedef QHash<BaseVersionList::ModelRoles, std::shared_ptr<Filter>> FilterMap;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user