summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/GConfProxyProvider.cpp')
-rw-r--r--Swiften/Network/GConfProxyProvider.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/Swiften/Network/GConfProxyProvider.cpp b/Swiften/Network/GConfProxyProvider.cpp
index ed9be3c..35303d5 100644
--- a/Swiften/Network/GConfProxyProvider.cpp
+++ b/Swiften/Network/GConfProxyProvider.cpp
@@ -24,43 +24,43 @@
namespace Swift {
GConfProxyProvider::GConfProxyProvider() {
- // Ensure static GLib initialization methods are called
- static bool glibInitialized = false;
- if (!glibInitialized) {
- g_type_init();
- glibInitialized = true;
- }
-
- socksProxy = getFromGConf("/system/proxy/socks_host", "/system/proxy/socks_port");
- httpProxy = getFromGConf("/system/http_proxy/host", "/system/http_proxy/port");
- SWIFT_LOG(debug) << "GConf: SOCKS5 => " << socksProxy.toString() << "; HTTP Connect => " << httpProxy.toString() << std::endl;
+ // Ensure static GLib initialization methods are called
+ static bool glibInitialized = false;
+ if (!glibInitialized) {
+ g_type_init();
+ glibInitialized = true;
+ }
+
+ socksProxy = getFromGConf("/system/proxy/socks_host", "/system/proxy/socks_port");
+ httpProxy = getFromGConf("/system/http_proxy/host", "/system/http_proxy/port");
+ SWIFT_LOG(debug) << "GConf: SOCKS5 => " << socksProxy.toString() << "; HTTP Connect => " << httpProxy.toString() << std::endl;
}
HostAddressPort GConfProxyProvider::getHTTPConnectProxy() const {
- return httpProxy;
+ return httpProxy;
}
HostAddressPort GConfProxyProvider::getSOCKS5Proxy() const {
- return socksProxy;
+ return socksProxy;
}
HostAddressPort GConfProxyProvider::getFromGConf(const char* gcHost, const char* gcPort) {
- std::string address;
- int port = 0;
- gchar* str;
+ std::string address;
+ int port = 0;
+ gchar* str;
- GConfClient* client = gconf_client_get_default();
+ GConfClient* client = gconf_client_get_default();
- str = gconf_client_get_string(client, gcHost, NULL);
- port = static_cast<int> (gconf_client_get_int(client, gcPort, NULL));
+ str = gconf_client_get_string(client, gcHost, NULL);
+ port = static_cast<int> (gconf_client_get_int(client, gcPort, NULL));
- if(str) {
- address = static_cast<char*> (str);
- g_free(str);
- }
+ if(str) {
+ address = static_cast<char*> (str);
+ g_free(str);
+ }
- g_object_unref(client);
- return HostAddressPort(HostAddress(address), port);
+ g_object_unref(client);
+ return HostAddressPort(HostAddress(address), port);
}
}