Skip to content

Commit

Permalink
Don't check for plugin errors at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
borysiasty authored and wonder-sk committed Aug 29, 2011
1 parent 7c56110 commit 4ff230a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
15 changes: 8 additions & 7 deletions python/plugins/plugin_installer/installer_data.py
Expand Up @@ -511,7 +511,7 @@ def removeRepository(self, repo):


# ----------------------------------------- #
def getInstalledPlugin(self, key, readOnly):
def getInstalledPlugin(self, key, readOnly, testLoad=False):
""" get the metadata of an installed plugin """
if readOnly:
path = QgsApplication.pkgDataPath()
Expand Down Expand Up @@ -557,10 +557,11 @@ def getInstalledPlugin(self, key, readOnly):
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])

Expand Down Expand Up @@ -596,7 +597,7 @@ def getInstalledPlugin(self, key, readOnly):


# ----------------------------------------- #
def getAllInstalled(self):
def getAllInstalled(self, testLoad=False):
""" Build the localCache """
self.localCache = {}
# first, try to add the read-only plugins...
Expand Down Expand Up @@ -625,7 +626,7 @@ def getAllInstalled(self):
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]
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/plugin_installer/installer_gui.py
Expand Up @@ -528,10 +528,10 @@ def addItem(p):
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)
Expand Down Expand Up @@ -630,7 +630,7 @@ def installPlugin(self, key, quiet=False):
exec ("reload (%s)" % plugin["localdir"])
except:
pass
plugins.getAllInstalled()
plugins.getAllInstalled(testLoad=True)
plugins.rebuild()
plugin = plugins.all()[key]
if not plugin["error"]:
Expand Down

0 comments on commit 4ff230a

Please sign in to comment.