From a7afa15462902f52dcee6bdaeabb9ea4c4541664 Mon Sep 17 00:00:00 2001 From: Abdo Date: Sun, 14 Nov 2021 04:36:32 +0300 Subject: [PATCH] Fix duplicate conflicting add-on names being shown (#1489) --- qt/aqt/addons.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/qt/aqt/addons.py b/qt/aqt/addons.py index 91d019db1..68d021255 100644 --- a/qt/aqt/addons.py +++ b/qt/aqt/addons.py @@ -53,7 +53,7 @@ class AbortAddonImport(Exception): @dataclass class InstallOk: name: str - conflicts: list[str] + conflicts: set[str] compatible: bool @@ -354,14 +354,12 @@ class AddonManager: all_conflicts[other_dir].append(addon.dir_name) return all_conflicts - def _disableConflicting(self, dir: str, conflicts: list[str] = None) -> list[str]: + def _disableConflicting(self, dir: str, conflicts: list[str] = None) -> set[str]: conflicts = conflicts or self.addonConflicts(dir) installed = self.allAddons() - found = [d for d in conflicts if d in installed and self.isEnabled(d)] - found.extend(self.allAddonConflicts().get(dir, [])) - if not found: - return [] + found = {d for d in conflicts if d in installed and self.isEnabled(d)} + found.update(self.allAddonConflicts().get(dir, [])) for package in found: self.toggleEnabled(package, enable=False)