summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/icd/proxyconf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/bearer/icd/proxyconf.cpp')
-rw-r--r--src/plugins/bearer/icd/proxyconf.cpp18
1 files changed, 14 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);
}