summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2017-02-01 14:44:44 (GMT)
committerKevin Smith <kevin.smith@isode.com>2017-02-09 11:20:04 (GMT)
commit5fb2281fc8e6beab84f5e2b1117455a65d2ab3de (patch)
treefd6874f50edd6765a2daad0d9f3566269217bff4 /Swiften
parent5035a59073e07a2dbe90dd94008e9d8b5a2cbd0a (diff)
downloadswift-5fb2281fc8e6beab84f5e2b1117455a65d2ab3de.zip
swift-5fb2281fc8e6beab84f5e2b1117455a65d2ab3de.tar.bz2
Update GConfProxyProvider to new string to HostAddress function
This change was missing in commit 43479ef. glib is automatically initialised nowadays and g_type_init() is a deprecated function. Surrounded the relevant code with a GLIB_CHECK_VERSION macro. Test-Information: Tested build on Ubuntu 16.04.1 LTS. Change-Id: Iea7242f6366d827b2cc6ce355cb923872f774a6c
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Network/GConfProxyProvider.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/Swiften/Network/GConfProxyProvider.cpp b/Swiften/Network/GConfProxyProvider.cpp
index 35303d5..40cd97c 100644
--- a/Swiften/Network/GConfProxyProvider.cpp
+++ b/Swiften/Network/GConfProxyProvider.cpp
@@ -5,31 +5,35 @@
*/
/*
- * Copyright (c) 2016 Isode Limited.
+ * Copyright (c) 2016-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Network/GConfProxyProvider.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdlib>
#include <iostream>
+export "C" {
#include <gconf/gconf-client.h>
+}
#include <Swiften/Base/Log.h>
namespace Swift {
GConfProxyProvider::GConfProxyProvider() {
+#if !GLIB_CHECK_VERSION(2,35,0)
// Ensure static GLib initialization methods are called
static bool glibInitialized = false;
if (!glibInitialized) {
g_type_init();
glibInitialized = true;
}
+#endif
socksProxy = getFromGConf("/system/proxy/socks_host", "/system/proxy/socks_port");
httpProxy = getFromGConf("/system/http_proxy/host", "/system/http_proxy/port");
@@ -60,7 +64,7 @@ HostAddressPort GConfProxyProvider::getFromGConf(const char* gcHost, const char*
}
g_object_unref(client);
- return HostAddressPort(HostAddress(address), port);
+ return HostAddressPort(HostAddress::fromString(address).get_value_or(HostAddress()), port);
}
}