Skip to content

Commit

Permalink
[Plugin Installer] Only test not loaded Python plugins when (re)build…
Browse files Browse the repository at this point in the history
…ing metadata registry. Loaded plugins prove they are ok just being loaded. It prevents possible bugs when already loaded plugin is imported again.
  • Loading branch information
borysiasty committed Jun 27, 2013
1 parent 52bb2c0 commit 7f99708
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/pyplugin_installer/installer_data.py
Expand Up @@ -687,7 +687,8 @@ def getAllInstalled(self, testLoad=True):
for key in pluginDir.entryList():
key = unicode(key)
if not key in [".",".."]:
self.localCache[key] = self.getInstalledPlugin(key, readOnly=True, testLoad=False)
# only test those not yet loaded. Others proved they're o.k.
self.localCache[key] = self.getInstalledPlugin(key, readOnly=True, testLoad=testLoad and not qgis.utils.plugins.has_key(key))
except:
# return QCoreApplication.translate("QgsPluginInstaller","Couldn't open the system plugin directory")
pass # it's not necessary to stop due to this error
Expand All @@ -703,7 +704,8 @@ def getAllInstalled(self, testLoad=True):
for key in pluginDir.entryList():
key = unicode(key)
if not key in [".",".."]:
plugin = self.getInstalledPlugin(key, readOnly=False, testLoad=testLoad)
# only test those not yet loaded. Others proved they're o.k.
plugin = self.getInstalledPlugin(key, readOnly=False, testLoad=testLoad and not qgis.utils.plugins.has_key(key))
if key in 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]
Expand Down

0 comments on commit 7f99708

Please sign in to comment.