[fix][ui] not displaying some priority search results at the top of the table when filtering by name

This commit is contained in:
Vinícius Moreira
2020-02-17 18:59:57 -03:00
parent 8649b9e6f3
commit 004db74b7a

View File

@@ -692,9 +692,9 @@ class ManageWindow(QWidget):
setattr(self, attr, checked) setattr(self, attr, checked)
checkbox.blockSignals(False) checkbox.blockSignals(False)
def _gen_filters(self, updates: int = 0, ignore_updates: bool = False, only_apps: bool = None) -> dict: def _gen_filters(self, updates: int = 0, ignore_updates: bool = False) -> dict:
return { return {
'only_apps': self.filter_only_apps if only_apps is None else only_apps, 'only_apps': False if self.search_performed else self.filter_only_apps,
'type': self.type_filter, 'type': self.type_filter,
'category': self.category_filter, 'category': self.category_filter,
'updates': False if ignore_updates else self.filter_updates, 'updates': False if ignore_updates else self.filter_updates,
@@ -774,9 +774,7 @@ class ManageWindow(QWidget):
def _apply_filters(self, pkgs_info: dict, ignore_updates: bool): def _apply_filters(self, pkgs_info: dict, ignore_updates: bool):
pkgs_info['pkgs_displayed'] = [] pkgs_info['pkgs_displayed'] = []
filters = self._gen_filters(updates=pkgs_info['updates'], filters = self._gen_filters(updates=pkgs_info['updates'], ignore_updates=ignore_updates)
ignore_updates=ignore_updates,
only_apps=False if self.search_performed else None)
for pkgv in pkgs_info['pkgs']: for pkgv in pkgs_info['pkgs']:
commons.apply_filters(pkgv, filters, pkgs_info) commons.apply_filters(pkgv, filters, pkgs_info)