Skip to content

Commit

Permalink
[Plugin installer] Fix broken warning about outdated plugin updates i…
Browse files Browse the repository at this point in the history
…n the user directory masking a newer core version
  • Loading branch information
borysiasty committed Nov 3, 2017
1 parent 67b1cab commit fb7f8f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/pyplugin_installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self):
for key in repositories.allEnabled():
repositories.setRepositoryData(key, "state", 3)

# look for obsolete plugins (the user-installed one is newer than core one)
# look for obsolete plugins updates (the user-installed one is older than the core one)
for key in plugins.obsoletePlugins:
plugin = plugins.localCache[key]
msg = QMessageBox()
Expand All @@ -93,7 +93,7 @@ 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():
# uninstall, update utils and reload if enabled
# uninstall the update, update utils and reload if enabled
self.uninstallPlugin(key, quiet=True)
updateAvailablePlugins()
settings = QgsSettings()
Expand Down
2 changes: 1 addition & 1 deletion python/pyplugin_installer/installer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,10 @@ def getAllInstalled(self, testLoad=True):
# failedToLoad = settings.value("/PythonPlugins/watchDog/" + key) is not None
testLoadThis = testLoad and key not in qgis.utils.plugins
plugin = self.getInstalledPlugin(key, path=path, readOnly=readOnly, testLoad=testLoadThis)
self.localCache[key] = plugin
if key in list(self.localCache.keys()) and compareVersions(self.localCache[key]["version_installed"], plugin["version_installed"]) == 1:
# An obsolete plugin in the "user" location is masking a newer one in the "system" location!
self.obsoletePlugins += [key]
self.localCache[key] = plugin
except:
# it's not necessary to stop if one of the dirs is inaccessible
pass
Expand Down

0 comments on commit fb7f8f1

Please sign in to comment.