2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Moved proxy global variables from facades to core settings.

This commit is contained in:
23rd
2021-06-11 01:49:08 +03:00
parent 707b36dc12
commit 6d08542afa
24 changed files with 497 additions and 184 deletions

View File

@@ -26,7 +26,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/qthelp_regex.h"
#include "base/qt_adapters.h"
#include "ui/effects/animations.h"
#include "facades.h"
#include "app.h"
#include <QtGui/QSessionManager>
@@ -450,17 +449,17 @@ void Sandbox::checkForQuit() {
}
void Sandbox::refreshGlobalProxy() {
const auto proxy = !Global::started()
const auto proxy = !Core::IsAppLaunched()
? _sandboxProxy
: (Global::ProxySettings() == MTP::ProxyData::Settings::Enabled)
? Global::SelectedProxy()
: Core::App().settings().proxy().isEnabled()
? Core::App().settings().proxy().selected()
: MTP::ProxyData();
if (proxy.type == MTP::ProxyData::Type::Socks5
|| proxy.type == MTP::ProxyData::Type::Http) {
QNetworkProxy::setApplicationProxy(
MTP::ToNetworkProxy(MTP::ToDirectIpProxy(proxy)));
} else if (!Global::started()
|| Global::ProxySettings() == MTP::ProxyData::Settings::System) {
} else if (!Core::IsAppLaunched()
|| Core::App().settings().proxy().isSystem()) {
QNetworkProxyFactory::setUseSystemConfiguration(true);
} else {
QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);