From 46d8a4dd922af54a80c3628019879b2bedaad2ce Mon Sep 17 00:00:00 2001 From: borysiasty Date: Sun, 4 Oct 2009 12:12:01 +0000 Subject: [PATCH] plugin installer update: handle ports != 80 and add Bob Bruce's repository git-svn-id: http://svn.osgeo.org/qgis/trunk@11754 c8812cc2-4d05-0410-92ff-de0c093fc19c --- python/plugins/plugin_installer/LICENSE | 2 +- python/plugins/plugin_installer/__init__.py | 2 +- python/plugins/plugin_installer/installer_data.py | 8 ++++++-- python/plugins/plugin_installer/installer_gui.py | 5 ++++- python/plugins/plugin_installer/installer_plugin.py | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/python/plugins/plugin_installer/LICENSE b/python/plugins/plugin_installer/LICENSE index 56ff246d58f..32c25b0be45 100644 --- a/python/plugins/plugin_installer/LICENSE +++ b/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 diff --git a/python/plugins/plugin_installer/__init__.py b/python/plugins/plugin_installer/__init__.py index bbdb8b92b3e..3f0c3e48d4b 100644 --- a/python/plugins/plugin_installer/__init__.py +++ b/python/plugins/plugin_installer/__init__.py @@ -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" diff --git a/python/plugins/plugin_installer/installer_data.py b/python/plugins/plugin_installer/installer_data.py index 1bc01950147..2852d08d7dc 100644 --- a/python/plugins/plugin_installer/installer_data.py +++ b/python/plugins/plugin_installer/installer_data.py @@ -29,7 +29,7 @@ mRepositories = dict of dicts: {repoName : {"url" QString, "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, @@ -87,6 +87,7 @@ authorRepos = [("Carson Farmer's Repository", "http://www.ftools.ca/cfarmerQgis ("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", "")] @@ -376,7 +377,10 @@ class Repositories(QObject): 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) diff --git a/python/plugins/plugin_installer/installer_gui.py b/python/plugins/plugin_installer/installer_gui.py index 508802b1dac..bc1c4cffeb0 100644 --- a/python/plugins/plugin_installer/installer_gui.py +++ b/python/plugins/plugin_installer/installer_gui.py @@ -152,7 +152,10 @@ class QgsPluginInstallerInstallingDialog(QDialog, Ui_QgsPluginInstallerInstallin 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) diff --git a/python/plugins/plugin_installer/installer_plugin.py b/python/plugins/plugin_installer/installer_plugin.py index c0a1202ab23..621bf770bb4 100644 --- a/python/plugins/plugin_installer/installer_plugin.py +++ b/python/plugins/plugin_installer/installer_plugin.py @@ -187,4 +187,4 @@ class InstallerPlugin(): # ----------------------------------------- # def resetNewlyProcessedPlugins(self): """ clear the dict of newly processed plugins """ - history.clear() + history.clear() \ No newline at end of file