|
|
@ -203,7 +203,7 @@ class SupportedProgramsDatabase(object): |
|
|
|
def _exeToDesktopEntry(self, exe:str)->dict: |
|
|
|
"""Assumes self.desktopEntries is up to date |
|
|
|
Convert one exe (not full path!) to one dict entry. """ |
|
|
|
if exe in self.knownDesktopFiles: #Shortcut through internal database |
|
|
|
if exe in self.knownDesktopFiles and type(self.knownDesktopFiles[exe]) is dict : #Shortcut through internal database |
|
|
|
entry = self.knownDesktopFiles[exe] |
|
|
|
return entry |
|
|
|
else: #Reverse Search desktop files. |
|
|
@ -211,7 +211,6 @@ class SupportedProgramsDatabase(object): |
|
|
|
if "exec" in entry and exe.lower() in entry["exec"].lower(): |
|
|
|
return entry |
|
|
|
#else: #Foor loop ended. Did not find any matching desktop file |
|
|
|
|
|
|
|
return None |
|
|
|
|
|
|
|
def _build(self): |
|
|
@ -224,8 +223,7 @@ class SupportedProgramsDatabase(object): |
|
|
|
for exe, fullPath in self.executables: |
|
|
|
self.progressHook(f"{fullPath}") |
|
|
|
entry = self._exeToDesktopEntry(exe) |
|
|
|
if entry: #Found match! |
|
|
|
assert type(entry) is dict, type(entry) |
|
|
|
if entry and type(entry) is dict: #Found match! |
|
|
|
entry["agordejoFullPath"] = fullPath |
|
|
|
#We don't want .desktop syntax like "qmidiarp %F" |
|
|
|
entry["agordejoExec"] = exe |
|
|
@ -245,6 +243,9 @@ class SupportedProgramsDatabase(object): |
|
|
|
leftovers.remove((exe,fullPath)) |
|
|
|
except KeyError: |
|
|
|
pass #Double entries like zyn-jack zyn-alsa etc. |
|
|
|
elif entry and not type(entry) is dict: |
|
|
|
#There is a strange bug I can't reproduce. At least catch it. |
|
|
|
logger.error(f"Wrong entry type: {type(entry)} for {entry}") |
|
|
|
|
|
|
|
for exe,fullPath in leftovers: |
|
|
|
pseudoEntry = {"name": exe.title(), "agordejoExec":exe, "agordejoFullPath":fullPath} |
|
|
|