summaryrefslogtreecommitdiffstats
path: root/gui/versionselectdialog.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-08-11 18:58:24 +0200
committerPetr Mrázek <peterix@gmail.com>2013-08-11 19:05:22 +0200
commit7e78a422e8bb22572706b7fadb58fc45e7b8a7db (patch)
treee91e2aa3364d1a5cb8329a6b7e49b7a46e720ab5 /gui/versionselectdialog.cpp
parente5dc113bfceb1e9b52535b7d1abd6f0ec51e1332 (diff)
downloadMultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.tar
MultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.tar.gz
MultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.tar.lz
MultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.tar.xz
MultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.zip
Version filtering and general related code sanitization.
Version list dialog has alternating row background set. Nostalgia versions, based on OneSix.
Diffstat (limited to 'gui/versionselectdialog.cpp')
-rw-r--r--gui/versionselectdialog.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/gui/versionselectdialog.cpp b/gui/versionselectdialog.cpp
index b3a14db1..33aedc71 100644
--- a/gui/versionselectdialog.cpp
+++ b/gui/versionselectdialog.cpp
@@ -68,13 +68,11 @@ void VersionSelectDialog::loadList()
taskDlg->exec(loadTask);
}
-const InstVersion *VersionSelectDialog::selectedVersion() const
+InstVersionPtr VersionSelectDialog::selectedVersion() const
{
- const InstVersion *versionPtr = (const InstVersion *)
- m_proxyModel->data(ui->listView->selectionModel()->currentIndex(),
- InstVersionList::VersionPointerRole).value<void *>();
-
- return versionPtr;
+ auto currentIndex = ui->listView->selectionModel()->currentIndex();
+ auto variant = m_proxyModel->data(currentIndex, InstVersionList::VersionPointerRole);
+ return variant.value<InstVersionPtr>();
}
void VersionSelectDialog::on_refreshButton_clicked()