GH-2144 Append '(installed)' to the installed version name

This commit is contained in:
janrupf
2018-11-09 20:44:39 +01:00
committed by Petr Mrázek
parent 16df8d7b88
commit 4cc7329ce3
3 changed files with 15 additions and 1 deletions

View File

@@ -126,7 +126,14 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const
switch(column)
{
case Name:
return sourceModel()->data(parentIndex, BaseVersionList::VersionRole);
{
QString version = sourceModel()->data(parentIndex, BaseVersionList::VersionRole).toString();
if(version == m_currentVersion)
{
return version + " " + tr("(installed)");
}
return version;
}
case ParentVersion:
return sourceModel()->data(parentIndex, BaseVersionList::ParentVersionRole);
case Branch:
@@ -432,5 +439,9 @@ void VersionProxyModel::sourceRowsRemoved(const QModelIndex& parent, int first,
endRemoveRows();
}
void VersionProxyModel::setCurrentVersion(const QString &version)
{
m_currentVersion = version;
}
#include "VersionProxyModel.moc"