mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Removed unused enum from local legacy storage settings scheme.
This commit is contained in:
parent
4db5624beb
commit
1c6e2eae04
2 changed files with 32 additions and 21 deletions
|
@ -461,6 +461,13 @@ bool ReadSetting(
|
||||||
stream >> v;
|
stream >> v;
|
||||||
if (!CheckStreamStatus(stream)) return false;
|
if (!CheckStreamStatus(stream)) return false;
|
||||||
|
|
||||||
|
// const auto dbictAuto = 0;
|
||||||
|
// const auto dbictHttpAuto = 1; // not used
|
||||||
|
const auto dbictHttpProxy = 2;
|
||||||
|
const auto dbictTcpProxy = 3;
|
||||||
|
// const auto dbictProxiesListOld = 4;
|
||||||
|
// const auto dbictProxiesList = 5;
|
||||||
|
|
||||||
MTP::ProxyData proxy;
|
MTP::ProxyData proxy;
|
||||||
switch (v) {
|
switch (v) {
|
||||||
case dbictHttpProxy:
|
case dbictHttpProxy:
|
||||||
|
@ -496,22 +503,37 @@ bool ReadSetting(
|
||||||
|
|
||||||
auto &proxySettings = Core::App().settings().proxy();
|
auto &proxySettings = Core::App().settings().proxy();
|
||||||
|
|
||||||
|
const auto legacyProxyTypeShift = 1024;
|
||||||
|
|
||||||
|
// const auto dbictAuto = 0;
|
||||||
|
// const auto dbictHttpAuto = 1; // not used
|
||||||
|
const auto dbictHttpProxy = 2;
|
||||||
|
const auto dbictTcpProxy = 3;
|
||||||
|
const auto dbictProxiesListOld = 4;
|
||||||
|
const auto dbictProxiesList = 5;
|
||||||
|
|
||||||
const auto readProxy = [&] {
|
const auto readProxy = [&] {
|
||||||
|
using Type = MTP::ProxyData::Type;
|
||||||
qint32 proxyType, port;
|
qint32 proxyType, port;
|
||||||
MTP::ProxyData proxy;
|
MTP::ProxyData proxy;
|
||||||
stream >> proxyType >> proxy.host >> port >> proxy.user >> proxy.password;
|
stream
|
||||||
|
>> proxyType
|
||||||
|
>> proxy.host
|
||||||
|
>> port
|
||||||
|
>> proxy.user
|
||||||
|
>> proxy.password;
|
||||||
proxy.port = port;
|
proxy.port = port;
|
||||||
proxy.type = (proxyType == dbictTcpProxy)
|
proxy.type = (proxyType == dbictTcpProxy)
|
||||||
? MTP::ProxyData::Type::Socks5
|
? Type::Socks5
|
||||||
: (proxyType == dbictHttpProxy)
|
: (proxyType == dbictHttpProxy)
|
||||||
? MTP::ProxyData::Type::Http
|
? Type::Http
|
||||||
: (proxyType == kProxyTypeShift + int(MTP::ProxyData::Type::Socks5))
|
: (proxyType == legacyProxyTypeShift + int(Type::Socks5))
|
||||||
? MTP::ProxyData::Type::Socks5
|
? Type::Socks5
|
||||||
: (proxyType == kProxyTypeShift + int(MTP::ProxyData::Type::Http))
|
: (proxyType == legacyProxyTypeShift + int(Type::Http))
|
||||||
? MTP::ProxyData::Type::Http
|
? Type::Http
|
||||||
: (proxyType == kProxyTypeShift + int(MTP::ProxyData::Type::Mtproto))
|
: (proxyType == legacyProxyTypeShift + int(Type::Mtproto))
|
||||||
? MTP::ProxyData::Type::Mtproto
|
? Type::Mtproto
|
||||||
: MTP::ProxyData::Type::None;
|
: Type::None;
|
||||||
return proxy;
|
return proxy;
|
||||||
};
|
};
|
||||||
if (connectionType == dbictProxiesListOld
|
if (connectionType == dbictProxiesListOld
|
||||||
|
|
|
@ -174,16 +174,5 @@ enum {
|
||||||
dbiVersion = 666,
|
dbiVersion = 666,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
|
||||||
dbictAuto = 0,
|
|
||||||
dbictHttpAuto = 1, // not used
|
|
||||||
dbictHttpProxy = 2,
|
|
||||||
dbictTcpProxy = 3,
|
|
||||||
dbictProxiesListOld = 4,
|
|
||||||
dbictProxiesList = 5,
|
|
||||||
};
|
|
||||||
|
|
||||||
inline constexpr auto kProxyTypeShift = 1024;
|
|
||||||
|
|
||||||
} // namespace details
|
} // namespace details
|
||||||
} // namespace Storage
|
} // namespace Storage
|
||||||
|
|
Loading…
Add table
Reference in a new issue