summaryrefslogtreecommitdiffstats
path: root/application/VersionProxyModel.cpp
diff options
context:
space:
mode:
authorjanrupf <werbung.janrupf@t-online.de>2018-11-09 20:44:39 +0100
committerPetr Mrázek <peterix@gmail.com>2018-11-12 01:49:52 +0100
commit4cc7329ce33e1d6441c9b43b217b003c0a78e985 (patch)
treea13b308fc3330e3bf45b0fb2a28d96315ad2218c /application/VersionProxyModel.cpp
parent16df8d7b883f10239a961997ba8ff123100ebfae (diff)
downloadMultiMC-4cc7329ce33e1d6441c9b43b217b003c0a78e985.tar
MultiMC-4cc7329ce33e1d6441c9b43b217b003c0a78e985.tar.gz
MultiMC-4cc7329ce33e1d6441c9b43b217b003c0a78e985.tar.lz
MultiMC-4cc7329ce33e1d6441c9b43b217b003c0a78e985.tar.xz
MultiMC-4cc7329ce33e1d6441c9b43b217b003c0a78e985.zip
GH-2144 Append '(installed)' to the installed version name
Diffstat (limited to 'application/VersionProxyModel.cpp')
-rw-r--r--application/VersionProxyModel.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/application/VersionProxyModel.cpp b/application/VersionProxyModel.cpp
index 338a6064..298c02f0 100644
--- a/application/VersionProxyModel.cpp
+++ b/application/VersionProxyModel.cpp
@@ -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"