From cfec339c303585aa522382c3d83b01c84802160c Mon Sep 17 00:00:00 2001 From: Borys Jurgiel Date: Sat, 4 Nov 2017 22:46:03 +0100 Subject: [PATCH] [Plugin manager] [needs-doc] Don't preload plugins for a test if they are broken. That function slowed down QGIS startup --- python/pyplugin_installer/installer.py | 4 ++-- python/pyplugin_installer/installer_data.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/python/pyplugin_installer/installer.py b/python/pyplugin_installer/installer.py index 02523dae96b..d6dada5a3c4 100644 --- a/python/pyplugin_installer/installer.py +++ b/python/pyplugin_installer/installer.py @@ -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): diff --git a/python/pyplugin_installer/installer_data.py b/python/pyplugin_installer/installer_data.py index 9064026bdbd..026f1439102 100644 --- a/python/pyplugin_installer/installer_data.py +++ b/python/pyplugin_installer/installer_data.py @@ -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)