Skip to content

Commit 7f99708

Browse files
committed
[Plugin Installer] Only test not loaded Python plugins when (re)building metadata registry. Loaded plugins prove they are ok just being loaded. It prevents possible bugs when already loaded plugin is imported again.
1 parent 52bb2c0 commit 7f99708

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/pyplugin_installer/installer_data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,8 @@ def getAllInstalled(self, testLoad=True):
687687
for key in pluginDir.entryList():
688688
key = unicode(key)
689689
if not key in [".",".."]:
690-
self.localCache[key] = self.getInstalledPlugin(key, readOnly=True, testLoad=False)
690+
# only test those not yet loaded. Others proved they're o.k.
691+
self.localCache[key] = self.getInstalledPlugin(key, readOnly=True, testLoad=testLoad and not qgis.utils.plugins.has_key(key))
691692
except:
692693
# return QCoreApplication.translate("QgsPluginInstaller","Couldn't open the system plugin directory")
693694
pass # it's not necessary to stop due to this error
@@ -703,7 +704,8 @@ def getAllInstalled(self, testLoad=True):
703704
for key in pluginDir.entryList():
704705
key = unicode(key)
705706
if not key in [".",".."]:
706-
plugin = self.getInstalledPlugin(key, readOnly=False, testLoad=testLoad)
707+
# only test those not yet loaded. Others proved they're o.k.
708+
plugin = self.getInstalledPlugin(key, readOnly=False, testLoad=testLoad and not qgis.utils.plugins.has_key(key))
707709
if key in self.localCache.keys() and compareVersions(self.localCache[key]["version_installed"],plugin["version_installed"]) == 1:
708710
# An obsolete plugin in the "user" location is masking a newer one in the "system" location!
709711
self.obsoletePlugins += [key]

0 commit comments

Comments
 (0)