diff options
Diffstat (limited to 'src/mumble/NetworkConfig.cpp')
-rw-r--r-- | src/mumble/NetworkConfig.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/mumble/NetworkConfig.cpp b/src/mumble/NetworkConfig.cpp index d5bc0feb3..59b8fbf9a 100644 --- a/src/mumble/NetworkConfig.cpp +++ b/src/mumble/NetworkConfig.cpp @@ -7,6 +7,7 @@ #include "MainWindow.h" #include "OSInfo.h" +#include "Global.h" #include <QSignalBlocker> #include <QtNetwork/QHostAddress> @@ -17,10 +18,6 @@ # include <QMessageBox> #endif -// We define a global macro called 'g'. This can lead to issues when included code uses 'g' as a type or parameter name -// (like protobuf 3.7 does). As such, for now, we have to make this our last include. -#include "Global.h" - const QString NetworkConfig::name = QLatin1String("NetworkConfig"); static ConfigWidget *NetworkConfigNew(Settings &st) { @@ -114,11 +111,11 @@ static QNetworkProxy::ProxyType local_to_qt_proxy(Settings::ProxyType pt) { void NetworkConfig::SetupProxy() { QNetworkProxy proxy; - proxy.setType(local_to_qt_proxy(g.s.ptProxyType)); - proxy.setHostName(g.s.qsProxyHost); - proxy.setPort(g.s.usProxyPort); - proxy.setUser(g.s.qsProxyUsername); - proxy.setPassword(g.s.qsProxyPassword); + proxy.setType(local_to_qt_proxy(Global::get().s.ptProxyType)); + proxy.setHostName(Global::get().s.qsProxyHost); + proxy.setPort(Global::get().s.usProxyPort); + proxy.setUser(Global::get().s.qsProxyUsername); + proxy.setPassword(Global::get().s.qsProxyPassword); QNetworkProxy::setApplicationProxy(proxy); } @@ -138,7 +135,7 @@ bool NetworkConfig::TcpModeEnabled() { * itself already is a potential latency killer. */ - return g.s.ptProxyType != Settings::NoProxy || g.s.bTCPCompat; + return Global::get().s.ptProxyType != Settings::NoProxy || Global::get().s.bTCPCompat; } void NetworkConfig::accept() const { @@ -181,14 +178,14 @@ void NetworkConfig::on_qcbAutoUpdate_stateChanged(int state) { QNetworkReply *Network::get(const QUrl &url) { QNetworkRequest req(url); prepareRequest(req); - return g.nam->get(req); + return Global::get().nam->get(req); } void Network::prepareRequest(QNetworkRequest &req) { req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); // Do not send OS information if the corresponding privacy setting is enabled - if (g.s.bHideOS) { + if (Global::get().s.bHideOS) { req.setRawHeader(QString::fromLatin1("User-Agent").toUtf8(), QString::fromLatin1("Mozilla/5.0 Mumble/%1 %2") .arg(QLatin1String(MUMTEXT(MUMBLE_VERSION)), QLatin1String(MUMBLE_RELEASE)) |