[fix] not verifying if an icon path is a file

# Conflicts:
#	CHANGELOG.md
This commit is contained in:
Vinícius Moreira
2019-12-27 10:15:41 -03:00
parent eb5c998c85
commit f8fab4c762
2 changed files with 7 additions and 7 deletions

View File

@@ -27,11 +27,10 @@ from bauh.gems.appimage.config import read_config
from bauh.gems.appimage.model import AppImage from bauh.gems.appimage.model import AppImage
from bauh.gems.appimage.worker import DatabaseUpdater from bauh.gems.appimage.worker import DatabaseUpdater
HOME_PATH = str(Path.home()) DB_APPS_PATH = '{}/{}'.format(str(Path.home()), '.local/share/bauh/appimage/apps.db')
DB_APPS_PATH = '{}/{}'.format(HOME_PATH, '.local/share/bauh/appimage/apps.db') DB_RELEASES_PATH = '{}/{}'.format(str(Path.home()), '.local/share/bauh/appimage/releases.db')
DB_RELEASES_PATH = '{}/{}'.format(HOME_PATH, '.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_EXEC = re.compile(r'Exec\s*=\s*.+\n')
RE_DESKTOP_ICON = re.compile(r'Icon\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 file_path = out_dir + '/' + file_name
downloaded = self.file_downloader.download(file_url=pkg.url_download, watcher=watcher, 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: if downloaded:
watcher.change_substatus(self.i18n['appimage.install.permission'].format(bold(file_name))) watcher.change_substatus(self.i18n['appimage.install.permission'].format(bold(file_name)))

View File

@@ -342,8 +342,9 @@ class AppsTable(QTableWidget):
item.setText(name) 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()): icon_path = pkg.model.get_disk_icon_path()
with open(pkg.model.get_disk_icon_path(), 'rb') as f: 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() icon_bytes = f.read()
pixmap = QPixmap() pixmap = QPixmap()
pixmap.loadFromData(icon_bytes) pixmap.loadFromData(icon_bytes)