Skip to content

Commit

Permalink
plugin installer update: handle ports != 80 and add Bob Bruce's repos…
Browse files Browse the repository at this point in the history
…itory

git-svn-id: http://svn.osgeo.org/qgis/trunk@11754 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Oct 4, 2009
1 parent 3145b3b commit 46d8a4d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/plugins/plugin_installer/LICENSE
@@ -1,5 +1,5 @@
Copyright (c) 2007 Matthew T. Perry
Copyright (c) 2008 Borys Jurgiel
Copyright (c) 2008-2009 Borys Jurgiel


Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/plugin_installer/__init__.py
Expand Up @@ -14,7 +14,7 @@ def name():
return "Plugin Installer"

def version():
return "Version 1.0.3"
return "Version 1.0.4"

def description():
return "Downloads and installs QGIS python plugins"
Expand Down
8 changes: 6 additions & 2 deletions python/plugins/plugin_installer/installer_data.py
Expand Up @@ -29,7 +29,7 @@
"valid" bool,
"QPHttp" QPHttp,
"Relay" Relay, # Relay object for transmitting signals from QPHttp with adding the repoName information
"xmlData" QDomDocument,
"xmlData" QBuffer,
"state" int, (0 - disabled, 1-loading, 2-loaded ok, 3-error (to be retried), 4-rejected)
"error" QString}}
mPlugins = dict of dicts {id : {"name" QString,
Expand Down Expand Up @@ -87,6 +87,7 @@ def setIface(qgisIface):
("Volkan Kepoglu's Repository","http://ggit.metu.edu.tr/~volkan/plugins.xml", ""),
("GIS-Lab Repository", "http://gis-lab.info/programs/qgis/qgis-repo.xml", ""),
("Marco Hugentobler's Repository","http://karlinapp.ethz.ch/python_plugins/python_plugins.xml", ""),
("Bob Bruce's Repository", "http://www.mappinggeek.ca/QGISPythonPlugins/Bobs-QGIS-plugins.xml", ""),
("Sourcepole Repository", "http://build.sourcepole.ch/qgis/plugins.xml", "")]


Expand Down Expand Up @@ -376,7 +377,10 @@ def requestFetching(self,key):
self.mRepositories[key]["state"] = 1
url = QUrl(self.mRepositories[key]["url"])
path = QString(url.toPercentEncoding(url.path(), "!$&'()*+,;=:@/"))
self.mRepositories[key]["QPHttp"] = QPHttp(url.host())
port = url.port()
if port < 0:
port = 80
self.mRepositories[key]["QPHttp"] = QPHttp(url.host(), port)
self.connect(self.mRepositories[key]["QPHttp"], SIGNAL("requestFinished (int, bool)"), self.xmlDownloaded)
self.connect(self.mRepositories[key]["QPHttp"], SIGNAL("stateChanged ( int )"), self.mRepositories[key]["Relay"].stateChanged)
self.connect(self.mRepositories[key]["QPHttp"], SIGNAL("dataReadProgress ( int , int )"), self.mRepositories[key]["Relay"].dataReadProgress)
Expand Down
5 changes: 4 additions & 1 deletion python/plugins/plugin_installer/installer_gui.py
Expand Up @@ -152,7 +152,10 @@ def __init__(self, parent, plugin):
tmpDir = QDir.tempPath()
tmpPath = QDir.cleanPath(tmpDir+"/"+fileName)
self.file = QFile(tmpPath)
self.http = QPHttp(url.host())
port = url.port()
if port < 0:
port = 80
self.http = QPHttp(url.host(), port)
self.connect(self.http, SIGNAL("stateChanged ( int )"), self.stateChanged)
self.connect(self.http, SIGNAL("dataReadProgress ( int , int )"), self.readProgress)
self.connect(self.http, SIGNAL("requestFinished (int, bool)"), self.requestFinished)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/plugin_installer/installer_plugin.py
Expand Up @@ -187,4 +187,4 @@ def newlyReinstalledPlugins(self):
# ----------------------------------------- #
def resetNewlyProcessedPlugins(self):
""" clear the dict of newly processed plugins """
history.clear()
history.clear()

0 comments on commit 46d8a4d

Please sign in to comment.