Skip to content

Commit

Permalink
Lower case addon name comparison (PR #9334)
Browse files Browse the repository at this point in the history
* Perform lower case comparison of add-on names when updating
* Do not request removal of a possible previous add-on before it has been replaced by a new version
  • Loading branch information
LeonarddeR authored and feerrenrut committed May 9, 2019
1 parent 2f60bc1 commit 4df274c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/gui/addonGui.py
Expand Up @@ -491,7 +491,7 @@ def installAddon(parentWindow, addonPath):

prevAddon = None
for addon in addonHandler.getAvailableAddons():
if not addon.isPendingRemove and bundle.name==addon.manifest['name']:
if not addon.isPendingRemove and bundle.name.lower()==addon.manifest['name'].lower():
prevAddon=addon
break
if prevAddon:
Expand Down Expand Up @@ -522,7 +522,6 @@ def installAddon(parentWindow, addonPath):
wx.YES|wx.NO|wx.ICON_WARNING
) != wx.YES:
return False
prevAddon.requestRemove()

from contextlib import contextmanager

Expand Down Expand Up @@ -551,6 +550,8 @@ def doneAndDestroy(window):
# Use context manager to ensure that `done` and `Destroy` are called on the progress dialog afterwards
with doneAndDestroy(progressDialog):
gui.ExecAndPump(addonHandler.installAddonBundle, bundle)
if prevAddon:
prevAddon.requestRemove()
return True
except:
log.error("Error installing addon bundle from %s" % addonPath, exc_info=True)
Expand Down

0 comments on commit 4df274c

Please sign in to comment.