summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-06-13 16:06:28 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-13 16:12:39 (GMT)
commita03cedb3942e4c7c90e62fe9a73c6d15e38fbb68 (patch)
treea6fc45bd8177cefaddf416881d3fb28b161ea04f /Swiften/Network/UnixProxyProvider.cpp
parent645876deedb72aa8ebd2a56773f7dd5bb0133b71 (diff)
downloadswift-contrib-a03cedb3942e4c7c90e62fe9a73c6d15e38fbb68.zip
swift-contrib-a03cedb3942e4c7c90e62fe9a73c6d15e38fbb68.tar.bz2
Privatize GConfProxyProvider in UnixProxyProvider.
Diffstat (limited to 'Swiften/Network/UnixProxyProvider.cpp')
-rw-r--r--Swiften/Network/UnixProxyProvider.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/Swiften/Network/UnixProxyProvider.cpp b/Swiften/Network/UnixProxyProvider.cpp
index 04c95e4..7790ad8 100644
--- a/Swiften/Network/UnixProxyProvider.cpp
+++ b/Swiften/Network/UnixProxyProvider.cpp
@@ -10,25 +10,33 @@
#include <Swiften/Base/foreach.h>
#include <Swiften/Network/UnixProxyProvider.h>
+#if defined(HAVE_GCONF)
+# include "Swiften/Network/GConfProxyProvider.h"
+#endif
namespace Swift {
UnixProxyProvider::UnixProxyProvider() :
-#if defined(HAVE_GCONF)
- gconfProxyProvider(),
-#endif
+ gconfProxyProvider(0),
environmentProxyProvider()
{
+#if defined(HAVE_GCONF)
+ gconfProxyProvider = new GConfProxyProvider();
+#endif
+}
+
+UnixProxyProvider::~UnixProxyProvider() {
+ delete gconfProxyProvider;
}
HostAddressPort UnixProxyProvider::getSOCKS5Proxy() const {
HostAddressPort proxy;
-#if defined(HAVE_GCONF)
- proxy = gconfProxyProvider.getSOCKS5Proxy();
- if(proxy.isValid()) {
- return proxy;
+ if (gconfProxyProvider) {
+ proxy = gconfProxyProvider.getSOCKS5Proxy();
+ if(proxy.isValid()) {
+ return proxy;
+ }
}
-#endif
proxy = environmentProxyProvider.getSOCKS5Proxy();
if(proxy.isValid()) {
return proxy;
@@ -38,12 +46,12 @@ HostAddressPort UnixProxyProvider::getSOCKS5Proxy() const {
HostAddressPort UnixProxyProvider::getHTTPConnectProxy() const {
HostAddressPort proxy;
-#if defined(HAVE_GCONF)
- proxy = gconfProxyProvider.getHTTPConnectProxy();
- if(proxy.isValid()) {
- return proxy;
+ if (gconfProxyProvider) {
+ proxy = gconfProxyProvider.getHTTPConnectProxy();
+ if(proxy.isValid()) {
+ return proxy;
+ }
}
-#endif
proxy = environmentProxyProvider.getHTTPConnectProxy();
if(proxy.isValid()) {
return proxy;