diff --git a/src/Mod/AddonManager/Addon.py b/src/Mod/AddonManager/Addon.py index cbe91f34d2..8ec366018e 100644 --- a/src/Mod/AddonManager/Addon.py +++ b/src/Mod/AddonManager/Addon.py @@ -188,7 +188,7 @@ class Addon: else: self.metadata_url = None self.metadata: Optional[Metadata] = None - self.icon = None # Relative path to remote icon file + self.icon = None # A QIcon version of this Addon's icon self.icon_file: str = "" # Absolute local path to cached icon file self.best_icon_relative_path = "" self.macro = None # Bridge to Gaël Écorchard's macro management class diff --git a/src/Mod/AddonManager/addonmanager_workers_installation.py b/src/Mod/AddonManager/addonmanager_workers_installation.py index ddc5580f1c..86ef41a30d 100644 --- a/src/Mod/AddonManager/addonmanager_workers_installation.py +++ b/src/Mod/AddonManager/addonmanager_workers_installation.py @@ -178,21 +178,7 @@ class UpdateMetadataCacheWorker(QtCore.QThread): # Grab a new copy of the icon as well: we couldn't enqueue this earlier because # we didn't know the path to it, which is stored in the package.xml file. - icon = metadata.icon - if not icon: - # If there is no icon set for the entire package, see if there are - # any workbenches, which are required to have icons, and grab the first - # one we find: - content = repo.metadata.content - if "workbench" in content: - wb = content["workbench"][0] - if wb.icon: - if wb.subdirectory: - subdir = wb.subdirectory - else: - subdir = wb.name - repo.icon = subdir + wb.icon - icon = repo.icon + icon = repo.get_best_icon_relative_path() icon_url = utils.construct_git_url(repo, icon) index = NetworkManager.AM_NETWORK_MANAGER.submit_unmonitored_get(icon_url)