Skip to content

Commit 260bf0c

Browse files
borysiastywonder-sk
authored andcommitted
Don't check for plugin errors at startup
1 parent 9cf2078 commit 260bf0c

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

python/plugins/plugin_installer/installer_data.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ def removeRepository(self, repo):
511511

512512

513513
# ----------------------------------------- #
514-
def getInstalledPlugin(self, key, readOnly):
514+
def getInstalledPlugin(self, key, readOnly, testLoad=False):
515515
""" get the metadata of an installed plugin """
516516
if readOnly:
517517
path = QgsApplication.pkgDataPath()
@@ -557,10 +557,11 @@ def getInstalledPlugin(self, key, readOnly):
557557
errorDetails = qgisMinimumVersion
558558
except:
559559
pass
560-
try:
561-
exec ("%s.classFactory(iface)" % key)
562-
except Exception, error:
563-
error = unicode(error.args[0])
560+
if testLoad:
561+
try:
562+
exec ("%s.classFactory(iface)" % key)
563+
except Exception, error:
564+
error = unicode(error.args[0])
564565
except Exception, error:
565566
error = unicode(error.args[0])
566567

@@ -596,7 +597,7 @@ def getInstalledPlugin(self, key, readOnly):
596597

597598

598599
# ----------------------------------------- #
599-
def getAllInstalled(self):
600+
def getAllInstalled(self, testLoad=False):
600601
""" Build the localCache """
601602
self.localCache = {}
602603
# first, try to add the read-only plugins...
@@ -625,7 +626,7 @@ def getAllInstalled(self):
625626
for key in pluginDir.entryList():
626627
key = unicode(key)
627628
if not key in [".",".."]:
628-
plugin = self.getInstalledPlugin(key, False)
629+
plugin = self.getInstalledPlugin(key, False, testLoad)
629630
if key in self.localCache.keys() and compareVersions(self.localCache[key]["version_inst"],plugin["version_inst"]) == 1:
630631
# An obsolete plugin in the "user" location is masking a newer one in the "system" location!
631632
self.obsoletePlugins += [key]

python/plugins/plugin_installer/installer_gui.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,10 @@ def addItem(p):
528528
n +=1
529529
self.setWindowTitle(self.tr("QGIS Python Plugin Installer") + self.tr(" - %d plugins available" % len(plugins.all())))
530530
self.buttonUpgradeAll.setEnabled( len(self.upgradeablePlugins) )
531-
531+
532532
# initially, keep insert order
533533
self.treePlugins.sortItems(100,Qt.AscendingOrder)
534-
534+
535535
# resize the columns
536536
for i in [0,1,2,3,4,5]:
537537
self.treePlugins.resizeColumnToContents(i)
@@ -630,7 +630,7 @@ def installPlugin(self, key, quiet=False):
630630
exec ("reload (%s)" % plugin["localdir"])
631631
except:
632632
pass
633-
plugins.getAllInstalled()
633+
plugins.getAllInstalled(testLoad=True)
634634
plugins.rebuild()
635635
plugin = plugins.all()[key]
636636
if not plugin["error"]:

0 commit comments

Comments
 (0)