mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Don't check for plugin errors at startup
This commit is contained in:
parent
9cf2078741
commit
260bf0c139
@ -511,7 +511,7 @@ class Plugins(QObject):
|
||||
|
||||
|
||||
# ----------------------------------------- #
|
||||
def getInstalledPlugin(self, key, readOnly):
|
||||
def getInstalledPlugin(self, key, readOnly, testLoad=False):
|
||||
""" get the metadata of an installed plugin """
|
||||
if readOnly:
|
||||
path = QgsApplication.pkgDataPath()
|
||||
@ -557,10 +557,11 @@ class Plugins(QObject):
|
||||
errorDetails = qgisMinimumVersion
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
exec ("%s.classFactory(iface)" % key)
|
||||
except Exception, error:
|
||||
error = unicode(error.args[0])
|
||||
if testLoad:
|
||||
try:
|
||||
exec ("%s.classFactory(iface)" % key)
|
||||
except Exception, error:
|
||||
error = unicode(error.args[0])
|
||||
except Exception, error:
|
||||
error = unicode(error.args[0])
|
||||
|
||||
@ -596,7 +597,7 @@ class Plugins(QObject):
|
||||
|
||||
|
||||
# ----------------------------------------- #
|
||||
def getAllInstalled(self):
|
||||
def getAllInstalled(self, testLoad=False):
|
||||
""" Build the localCache """
|
||||
self.localCache = {}
|
||||
# first, try to add the read-only plugins...
|
||||
@ -625,7 +626,7 @@ class Plugins(QObject):
|
||||
for key in pluginDir.entryList():
|
||||
key = unicode(key)
|
||||
if not key in [".",".."]:
|
||||
plugin = self.getInstalledPlugin(key, False)
|
||||
plugin = self.getInstalledPlugin(key, False, testLoad)
|
||||
if key in self.localCache.keys() and compareVersions(self.localCache[key]["version_inst"],plugin["version_inst"]) == 1:
|
||||
# An obsolete plugin in the "user" location is masking a newer one in the "system" location!
|
||||
self.obsoletePlugins += [key]
|
||||
|
@ -528,10 +528,10 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
|
||||
n +=1
|
||||
self.setWindowTitle(self.tr("QGIS Python Plugin Installer") + self.tr(" - %d plugins available" % len(plugins.all())))
|
||||
self.buttonUpgradeAll.setEnabled( len(self.upgradeablePlugins) )
|
||||
|
||||
|
||||
# initially, keep insert order
|
||||
self.treePlugins.sortItems(100,Qt.AscendingOrder)
|
||||
|
||||
|
||||
# resize the columns
|
||||
for i in [0,1,2,3,4,5]:
|
||||
self.treePlugins.resizeColumnToContents(i)
|
||||
@ -630,7 +630,7 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
|
||||
exec ("reload (%s)" % plugin["localdir"])
|
||||
except:
|
||||
pass
|
||||
plugins.getAllInstalled()
|
||||
plugins.getAllInstalled(testLoad=True)
|
||||
plugins.rebuild()
|
||||
plugin = plugins.all()[key]
|
||||
if not plugin["error"]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user