From 66305837fddf33071ffba8ea5de7177442b832a8 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Thu, 25 Jul 2019 17:14:31 -0300 Subject: [PATCH] fix: not showing app disk cached description when listing installed apps --- CHANGELOG.md | 4 +++- fpakman/core/snap/controller.py | 3 +-- fpakman/view/qt/view_model.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93843031..1352964c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [0.4.1] +## [0.4.1] - 2019-07-25 ### Improvements - retrieving some Snaps data (icon, description and confinement) through Ubuntu API instead of Snap Store +### Fixes: +- not showing app disk cached description when listing installed apps ## [0.4.0] - 2019-07-25 ### Features diff --git a/fpakman/core/snap/controller.py b/fpakman/core/snap/controller.py index 6c03e147..eaf89496 100644 --- a/fpakman/core/snap/controller.py +++ b/fpakman/core/snap/controller.py @@ -74,8 +74,7 @@ class SnapManager(ApplicationManager): return res def read_installed(self, disk_loader: DiskCacheLoader) -> List[SnapApplication]: - res = [self.map_json(app_json, installed=True, disk_loader=disk_loader) for app_json in snap.read_installed()] - return res + return [self.map_json(app_json, installed=True, disk_loader=disk_loader) for app_json in snap.read_installed()] def downgrade_app(self, app: Application, root_password: str) -> FpakmanProcess: return FpakmanProcess(subproc=snap.downgrade_and_stream(app.base_data.name, root_password), wrong_error_phrase=None) diff --git a/fpakman/view/qt/view_model.py b/fpakman/view/qt/view_model.py index be305b88..4b34c024 100644 --- a/fpakman/view/qt/view_model.py +++ b/fpakman/view/qt/view_model.py @@ -19,7 +19,7 @@ class ApplicationView: def get_async_attr(self, attr: str, strip_html: bool = False, default: str = '...'): - if self.model.is_library(): + if getattr(self.model.base_data, attr) is not None or self.model.is_library(): res = getattr(self.model.base_data, attr) else: res = getattr(self.model.base_data, attr) if self.model.status == ApplicationStatus.READY and getattr(self.model.base_data, attr) else default