Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
In uninstallPlugin(), remove plugin's QSetting (inside group 'PythonP…
…lugins'), which says if a plugin is available
  • Loading branch information
gacarrillor authored and nyalldawson committed Aug 24, 2021
1 parent e4bb080 commit 926a1b6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/pyplugin_installer/installer.py
Expand Up @@ -95,11 +95,13 @@ def __init__(self):
msg.setText("%s <b>%s</b><br/><br/>%s" % (self.tr("Obsolete plugin:"), plugin["name"], self.tr("QGIS has detected an obsolete plugin that masks its more recent version shipped with this copy of QGIS. This is likely due to files associated with a previous installation of QGIS. Do you want to remove the old plugin right now and unmask the more recent version?")))
msg.exec_()
if not msg.result():
settings = QgsSettings()
plugin_is_active = settings.value("/PythonPlugins/" + key, False, type=bool)

# uninstall the update, update utils and reload if enabled
self.uninstallPlugin(key, quiet=True)
updateAvailablePlugins()
settings = QgsSettings()
if settings.value("/PythonPlugins/" + key, False, type=bool):
if plugin_is_active:
settings.setValue("/PythonPlugins/watchDog/" + key, True)
loadPlugin(key)
startPlugin(key)
Expand Down Expand Up @@ -452,6 +454,9 @@ def uninstallPlugin(self, key, quiet=False):
QApplication.restoreOverrideCursor()
iface.pluginManagerInterface().pushMessage(self.tr("Plugin uninstalled successfully"), Qgis.Info)

settings = QgsSettings()
settings.remove("/PythonPlugins/" + key)

# ----------------------------------------- #
def addRepository(self):
""" add new repository connection """
Expand Down

0 comments on commit 926a1b6

Please sign in to comment.