[fix][ui] displaying empty categories

This commit is contained in:
Vinicius Moreira
2020-06-10 12:47:22 -03:00
parent 89e1f93c7e
commit 458c602667
3 changed files with 10 additions and 2 deletions

View File

@@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Web
- handling unexpected connection errors
- handling web page fetch errors
- UI
- displaying empty categories
## [0.9.5] 2020-06-07
### Features

View File

@@ -32,7 +32,10 @@ def update_info(pkgv: PackageView, pkgs_info: dict):
if pkgv.model.categories:
for c in pkgv.model.categories:
pkgs_info['categories'].add(c.lower())
if c:
cat = c.lower().strip()
if cat:
pkgs_info['categories'].add(cat)
pkgs_info['pkgs'].append(pkgv)
pkgs_info['not_installed'] += 1 if not pkgv.model.installed else 0

View File

@@ -559,7 +559,10 @@ class ManageWindow(QWidget):
for p in self.pkgs_available:
if p.model.categories:
for c in p.model.categories:
categories.add(c.lower())
if c:
cat = c.strip().lower()
if cat:
categories.add(cat)
if categories:
self._update_categories(categories, keep_selected=True)