summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-06 07:35:53 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-06 07:35:53 (GMT)
commit9327490ad51b737211c26cae53a095a8485e2dad (patch)
tree6af31940b312d02f5280423903f00c5774f2ca3e
parent14e4fd08ff67578dccf5e85a88fcadf747ae5852 (diff)
parent4fb210b9e225fffafdaac26e0acb3c0b71087137 (diff)
downloadQt-9327490ad51b737211c26cae53a095a8485e2dad.zip
Qt-9327490ad51b737211c26cae53a095a8485e2dad.tar.gz
Qt-9327490ad51b737211c26cae53a095a8485e2dad.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fix proxy reading from gconf so that it is only done once / session.
-rw-r--r--src/plugins/bearer/icd/proxyconf.cpp18
-rw-r--r--src/plugins/bearer/icd/proxyconf.h1
2 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/bearer/icd/proxyconf.cpp b/src/plugins/bearer/icd/proxyconf.cpp
index e5c8f4e..37501fb 100644
--- a/src/plugins/bearer/icd/proxyconf.cpp
+++ b/src/plugins/bearer/icd/proxyconf.cpp
@@ -142,16 +142,23 @@ QHash<QString,QVariant> GConfItemFast::getEntries() const
-class NetworkProxyFactory : QNetworkProxyFactory {
+class NetworkProxyFactory : QNetworkProxyFactory
+{
+ ProxyConf proxy_conf;
+ bool proxy_data_read;
+
public:
- NetworkProxyFactory() { }
+ NetworkProxyFactory() : proxy_data_read(false) { }
QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query = QNetworkProxyQuery());
};
QList<QNetworkProxy> NetworkProxyFactory::queryProxy(const QNetworkProxyQuery &query)
{
- ProxyConf proxy_conf;
+ if (proxy_data_read == false) {
+ proxy_data_read = true;
+ proxy_conf.readProxyData();
+ }
QList<QNetworkProxy> result = proxy_conf.flush(query);
if (result.isEmpty())
@@ -377,10 +384,13 @@ ProxyConf::~ProxyConf()
delete d_ptr;
}
+void ProxyConf::readProxyData()
+{
+ d_ptr->readProxyData();
+}
QList<QNetworkProxy> ProxyConf::flush(const QNetworkProxyQuery &query)
{
- d_ptr->readProxyData();
return d_ptr->flush(query);
}
diff --git a/src/plugins/bearer/icd/proxyconf.h b/src/plugins/bearer/icd/proxyconf.h
index 884cc5c..eedbbf2 100644
--- a/src/plugins/bearer/icd/proxyconf.h
+++ b/src/plugins/bearer/icd/proxyconf.h
@@ -58,6 +58,7 @@ public:
virtual ~ProxyConf();
QList<QNetworkProxy> flush(const QNetworkProxyQuery &query = QNetworkProxyQuery()); // read the proxies from db
+ void readProxyData();
/* Note that for each update() call there should be corresponding
* clear() call because the ProxyConf class implements a reference