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

This commit is contained in:
janrupf authored and Petr Mrázek committed 2018-11-12 01:49:52 +01:00
1 parent 16df8d7b88
commit 4cc7329ce3
3 files changed
+15 -1

No files matched your search

+12 -1
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"