[Plugin manager] [needs-doc] Don't preload plugins for a test if they are broken. That function slowed down QGIS startup

This commit is contained in:
Borys Jurgiel 2017-11-04 22:46:03 +01:00
parent edcaf05bcb
commit cfec339c30
2 changed files with 8 additions and 5 deletions

View File

@ -307,7 +307,7 @@ class QgsPluginInstaller(QObject):
updateAvailablePlugins()
# try to load the plugin
loadPlugin(plugin["id"])
plugins.getAllInstalled(testLoad=True)
plugins.getAllInstalled()
plugins.rebuild()
plugin = plugins.all()[key]
if not plugin["error"]:
@ -565,7 +565,7 @@ class QgsPluginInstaller(QObject):
if infoString is None:
updateAvailablePlugins()
loadPlugin(pluginName)
plugins.getAllInstalled(testLoad=True)
plugins.getAllInstalled()
plugins.rebuild()
if settings.contains('/PythonPlugins/' + pluginName):

View File

@ -548,7 +548,7 @@ class Plugins(QObject):
del self.repoCache[repo]
# ----------------------------------------- #
def getInstalledPlugin(self, key, path, readOnly, testLoad=True):
def getInstalledPlugin(self, key, path, readOnly, testLoad=False):
""" get the metadata of an installed plugin """
def metadataParser(fct):
""" plugin metadata parser reimplemented from qgis.utils
@ -683,8 +683,11 @@ class Plugins(QObject):
return plugin
# ----------------------------------------- #
def getAllInstalled(self, testLoad=True):
""" Build the localCache """
def getAllInstalled(self, testLoad=False):
""" Build the localCache
Note: Currently testLoad is always disabled in order to speed up QGIS startup.
The related code will be probably removed.
"""
self.localCache = {}
# reversed list of the plugin paths: first system plugins -> then user plugins -> finally custom path(s)