mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 01:54:15 +02:00
[view] improvement: only displaying the 'Installed' filter when installed packages are available on the table
This commit is contained in:
@@ -13,6 +13,7 @@ def new_pkgs_info() -> dict:
|
||||
'napp_updates': 0,
|
||||
'pkgs_displayed': [],
|
||||
'not_installed': 0,
|
||||
'installed': 0,
|
||||
'categories': set(),
|
||||
'pkgs': []} # total packages
|
||||
|
||||
@@ -41,7 +42,11 @@ def update_info(pkgv: PackageView, pkgs_info: dict):
|
||||
pkgs_info['categories'].add(cat)
|
||||
|
||||
pkgs_info['pkgs'].append(pkgv)
|
||||
pkgs_info['not_installed'] += 1 if not pkgv.model.installed else 0
|
||||
|
||||
if pkgv.model.installed:
|
||||
pkgs_info['installed'] += 1
|
||||
else:
|
||||
pkgs_info['not_installed'] += 1
|
||||
|
||||
|
||||
def apply_filters(pkg: PackageView, filters: dict, info: dict, limit: bool = True):
|
||||
|
||||
Reference in New Issue
Block a user