mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
NOISSUE when there is a version added already, preselect it in the version select dialog
This commit is contained in:
parent
57accb1cbb
commit
ef2cbe16e6
7 changed files with 73 additions and 3 deletions
|
|
@ -369,6 +369,24 @@ QModelIndex VersionProxyModel::getRecommended() const
|
|||
return index(recommended, 0);
|
||||
}
|
||||
|
||||
QModelIndex VersionProxyModel::getVersion(const QString& version) const
|
||||
{
|
||||
int found = -1;
|
||||
for (int i = 0; i < rowCount(); i++)
|
||||
{
|
||||
auto value = sourceModel()->data(mapToSource(index(i, 0)), BaseVersionList::VersionRole);
|
||||
if (value.toString() == version)
|
||||
{
|
||||
found = i;
|
||||
}
|
||||
}
|
||||
if(found == -1)
|
||||
{
|
||||
return QModelIndex();
|
||||
}
|
||||
return index(found, 0);
|
||||
}
|
||||
|
||||
void VersionProxyModel::clearFilters()
|
||||
{
|
||||
m_filters.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue