summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/VersionProxyModel.cpp13
-rw-r--r--application/VersionProxyModel.h2
-rw-r--r--application/widgets/VersionSelectWidget.cpp1
3 files changed, 15 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"
diff --git a/application/VersionProxyModel.h b/application/VersionProxyModel.h
index 457acfeb..8991c31b 100644
--- a/application/VersionProxyModel.h
+++ b/application/VersionProxyModel.h
@@ -42,6 +42,7 @@ public:
void clearFilters();
QModelIndex getRecommended() const;
QModelIndex getVersion(const QString & version) const;
+ void setCurrentVersion(const QString &version);
private slots:
void sourceDataChanged(const QModelIndex &source_top_left,const QModelIndex &source_bottom_right);
@@ -62,4 +63,5 @@ private:
VersionFilterModel * filterModel;
bool hasRecommended = false;
bool hasLatest = false;
+ QString m_currentVersion;
};
diff --git a/application/widgets/VersionSelectWidget.cpp b/application/widgets/VersionSelectWidget.cpp
index 8e7a0953..9925a6b4 100644
--- a/application/widgets/VersionSelectWidget.cpp
+++ b/application/widgets/VersionSelectWidget.cpp
@@ -41,6 +41,7 @@ VersionSelectWidget::VersionSelectWidget(QWidget* parent)
void VersionSelectWidget::setCurrentVersion(const QString& version)
{
m_currentVersion = version;
+ m_proxyModel->setCurrentVersion(version);
}
void VersionSelectWidget::setEmptyString(QString emptyString)