mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 22:54:16 +02:00
gem selector panel working
This commit is contained in:
@@ -113,6 +113,11 @@ def save_several(pkgnames: Set[str], mirror: str, overwrite: bool = True) -> int
|
||||
if entries:
|
||||
desktop_matches[pkg] = entries[0]
|
||||
|
||||
if len(entries) > 1:
|
||||
for e in entries:
|
||||
if e.startswith('/usr/share/applications'):
|
||||
desktop_matches[pkg] = e
|
||||
|
||||
if not desktop_matches:
|
||||
no_desktop_files = to_cache
|
||||
else:
|
||||
@@ -130,7 +135,7 @@ def save_several(pkgnames: Set[str], mirror: str, overwrite: bool = True) -> int
|
||||
|
||||
for field in RE_DESKTOP_ENTRY.findall(desktop_entry):
|
||||
if field[0] == 'Exec':
|
||||
p.command = field[1].strip()
|
||||
p.command = field[1].strip().replace('"', '')
|
||||
elif field[0] == 'Icon':
|
||||
p.icon_path = field[1].strip()
|
||||
|
||||
|
||||
@@ -90,13 +90,14 @@ class ArchPackage(SoftwarePackage):
|
||||
return cache
|
||||
|
||||
def fill_cached_data(self, data: dict):
|
||||
for a in {'command', 'icon_path', 'mirror', 'desktop_entry'}:
|
||||
val = data.get(a)
|
||||
if val:
|
||||
setattr(self, a, val)
|
||||
if data:
|
||||
for a in {'command', 'icon_path', 'mirror', 'desktop_entry'}:
|
||||
val = data.get(a)
|
||||
if val:
|
||||
setattr(self, a, val)
|
||||
|
||||
if a == 'icon_path':
|
||||
self.icon_url = val
|
||||
if a == 'icon_path':
|
||||
self.icon_url = val
|
||||
|
||||
def can_be_run(self) -> bool:
|
||||
# only returns if there is a desktop entry set for the application to avoid running command-line applications
|
||||
|
||||
Reference in New Issue
Block a user