diff --git a/bauh/gems/appimage/controller.py b/bauh/gems/appimage/controller.py index 538d3051..9a4543d0 100644 --- a/bauh/gems/appimage/controller.py +++ b/bauh/gems/appimage/controller.py @@ -27,11 +27,10 @@ from bauh.gems.appimage.config import read_config from bauh.gems.appimage.model import AppImage from bauh.gems.appimage.worker import DatabaseUpdater -HOME_PATH = str(Path.home()) -DB_APPS_PATH = '{}/{}'.format(HOME_PATH, '.local/share/bauh/appimage/apps.db') -DB_RELEASES_PATH = '{}/{}'.format(HOME_PATH, '.local/share/bauh/appimage/releases.db') +DB_APPS_PATH = '{}/{}'.format(str(Path.home()), '.local/share/bauh/appimage/apps.db') +DB_RELEASES_PATH = '{}/{}'.format(str(Path.home()), '.local/share/bauh/appimage/releases.db') -DESKTOP_ENTRIES_PATH = '{}/.local/share/applications'.format(HOME_PATH) +DESKTOP_ENTRIES_PATH = '{}/.local/share/applications'.format(str(Path.home())) RE_DESKTOP_EXEC = re.compile(r'Exec\s*=\s*.+\n') RE_DESKTOP_ICON = re.compile(r'Icon\s*=\s*.+\n') @@ -298,7 +297,7 @@ class AppImageManager(SoftwareManager): file_path = out_dir + '/' + file_name downloaded = self.file_downloader.download(file_url=pkg.url_download, watcher=watcher, - output_path=file_path, cwd=HOME_PATH) + output_path=file_path, cwd=str(Path.home())) if downloaded: watcher.change_substatus(self.i18n['appimage.install.permission'].format(bold(file_name))) diff --git a/bauh/view/qt/apps_table.py b/bauh/view/qt/apps_table.py index de296a93..ecd93477 100644 --- a/bauh/view/qt/apps_table.py +++ b/bauh/view/qt/apps_table.py @@ -342,8 +342,9 @@ class AppsTable(QTableWidget): item.setText(name) - if self.disk_cache and pkg.model.supports_disk_cache() and pkg.model.get_disk_icon_path() and os.path.exists(pkg.model.get_disk_icon_path()): - with open(pkg.model.get_disk_icon_path(), 'rb') as f: + icon_path = pkg.model.get_disk_icon_path() + if self.disk_cache and pkg.model.supports_disk_cache() and icon_path and os.path.isfile(icon_path): + with open(icon_path, 'rb') as f: icon_bytes = f.read() pixmap = QPixmap() pixmap.loadFromData(icon_bytes)