diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-30 04:04:40 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-30 04:04:40 -0500 |
| commit | 38d56ef8310674bc5a2f8b304ee17a6b7e1c5798 (patch) | |
| tree | 1e4686906e07f4fb01a439e0a2a4bb90ebb1e94e /src/filterlist.cpp | |
| parent | f080e2e25d05eb639cc4168d3c6905041f4dc564 (diff) | |
fixed setting selection when checking for updates
Diffstat (limited to 'src/filterlist.cpp')
| -rw-r--r-- | src/filterlist.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/filterlist.cpp b/src/filterlist.cpp index 66a9aed0..81f8b670 100644 --- a/src/filterlist.cpp +++ b/src/filterlist.cpp @@ -203,7 +203,7 @@ void FilterList::refresh() } } -void FilterList::setSelection(std::vector<int> categories) +void FilterList::setSelection(const std::vector<Criteria>& criteria) { for (int i = 0; i < ui->filters->topLevelItemCount(); ++i) { const auto* item = dynamic_cast<CriteriaItem*>( @@ -213,9 +213,11 @@ void FilterList::setSelection(std::vector<int> categories) continue; } - if (item->id() == CategoryFactory::UpdateAvailable) { - ui->filters->setCurrentItem(ui->filters->topLevelItem(i)); - break; + for (auto&& c : criteria) { + if (item->type() == c.type && item->id() == c.id) { + ui->filters->setCurrentItem(ui->filters->topLevelItem(i)); + break; + } } } } |
