diff --git a/CHANGELOG.md b/CHANGELOG.md index f00ad7e0..36b6c8ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - new environment variable / argument to enable / disable the tray icon and update-check daemon: FPAKMAN_TRAY (--tray) - search results sorting takes an average of 35% less time, reaching 60% in some scenarios ### Fixes: +- apps table not showing empty descriptions - replacing default app icons by null icons - i18n fixes diff --git a/fpakman/view/qt/apps_table.py b/fpakman/view/qt/apps_table.py index bcce73ce..08851f3b 100644 --- a/fpakman/view/qt/apps_table.py +++ b/fpakman/view/qt/apps_table.py @@ -10,6 +10,7 @@ from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidg from fpakman.core import resource from fpakman.core.model import ApplicationStatus +from fpakman.util import util from fpakman.util.cache import Cache from fpakman.view.qt import dialog from fpakman.view.qt.view_model import ApplicationView, ApplicationViewStatus @@ -293,10 +294,16 @@ class AppsTable(QTableWidget): def _set_col_description(self, idx: int, app_v: ApplicationView): col = QTableWidgetItem() col.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) - desc = app_v.get_async_attr('description', strip_html=True) - if desc: - col.setText(desc[0:25] + '...') + if app_v.model.base_data.description is not None or app_v.model.is_library() or app_v.model.status == ApplicationStatus.READY: + desc = app_v.model.base_data.description + else: + desc = '...' + + if desc and desc != '...': + desc = util.strip_html(desc[0:25]) + '...' + + col.setText(desc) if app_v.model.status == ApplicationStatus.READY: col.setToolTip(desc) diff --git a/fpakman/view/qt/view_model.py b/fpakman/view/qt/view_model.py index 4b34c024..6dbffb4c 100644 --- a/fpakman/view/qt/view_model.py +++ b/fpakman/view/qt/view_model.py @@ -1,7 +1,6 @@ from enum import Enum -from fpakman.core.model import Application, ApplicationStatus -from fpakman.util import util +from fpakman.core.model import Application class ApplicationViewStatus(Enum): @@ -16,12 +15,3 @@ class ApplicationView: self.update_checked = model.update self.visible = visible self.status = ApplicationViewStatus.LOADING - - def get_async_attr(self, attr: str, strip_html: bool = False, default: str = '...'): - - 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 - - return util.strip_html(res) if res and strip_html else res