From c424301924116eb992d463c35b83b9500d6c277b Mon Sep 17 00:00:00 2001 From: Qv2ray-dev <59914293+Qv2ray-dev@users.noreply.github.com> Date: Tue, 28 Apr 2020 14:59:32 +0800 Subject: [PATCH] format: code format --- makespec/BUILDVERSION | 2 +- src/components/latency/QvTCPing.cpp | 2 +- src/components/plugins/toolbar/QvToolbar_linux.cpp | 3 ++- src/components/route/presets/RouteScheme_V2rayN.hpp | 6 +++--- src/core/connection/Generation.cpp | 7 ++++--- src/core/connection/Serialization_vmess.cpp | 3 ++- src/ui/w_PreferencesWindow.cpp | 6 ++++-- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/makespec/BUILDVERSION b/makespec/BUILDVERSION index e3aa5020..00d32773 100644 --- a/makespec/BUILDVERSION +++ b/makespec/BUILDVERSION @@ -1 +1 @@ -5338 +5339 \ No newline at end of file diff --git a/src/components/latency/QvTCPing.cpp b/src/components/latency/QvTCPing.cpp index 32970468..0091a4ed 100644 --- a/src/components/latency/QvTCPing.cpp +++ b/src/components/latency/QvTCPing.cpp @@ -222,4 +222,4 @@ namespace Qv2ray::components::tcping rv = rv ? rv : -errno; return rv; } -} // namespace Qv2ray::core::tcping +} // namespace Qv2ray::components::tcping diff --git a/src/components/plugins/toolbar/QvToolbar_linux.cpp b/src/components/plugins/toolbar/QvToolbar_linux.cpp index 9fdd2a4b..314f995a 100644 --- a/src/components/plugins/toolbar/QvToolbar_linux.cpp +++ b/src/components/plugins/toolbar/QvToolbar_linux.cpp @@ -67,7 +67,8 @@ namespace Qv2ray::components::plugins::Toolbar { bool result = server->waitForNewConnection(5000, &timeOut); DEBUG(MODULE_PLUGINHOST, "Plugin thread listening failed: " + server->errorString()) - DEBUG(MODULE_PLUGINHOST, "waitForNewConnection: " + QString(result ? "true" : "false") + ", " + QString(timeOut ? "true" : "false")) + DEBUG(MODULE_PLUGINHOST, + "waitForNewConnection: " + QString(result ? "true" : "false") + ", " + QString(timeOut ? "true" : "false")) } server->close(); diff --git a/src/components/route/presets/RouteScheme_V2rayN.hpp b/src/components/route/presets/RouteScheme_V2rayN.hpp index 447c4074..b3ae4ed5 100644 --- a/src/components/route/presets/RouteScheme_V2rayN.hpp +++ b/src/components/route/presets/RouteScheme_V2rayN.hpp @@ -141,9 +141,9 @@ namespace Qv2ray::components::route::presets::v2rayN "domain:samsungdm.com" }; const inline QList DomainsBlock{ "geosite:category-ads-all" }; - const inline QList DomainsProxy{ "geosite:google", "geosite:github", "geosite:netflix", "geosite:steam", - "geosite:telegram", "geosite:tumblr", "domain:naver.com", "geosite:bbc", - "domain:gvt1.com", "domain:textnow.com", "domain:twitch.tv", "domain:wikileaks.org" }; + const inline QList DomainsProxy{ "geosite:google", "geosite:github", "geosite:netflix", "geosite:steam", + "geosite:telegram", "geosite:tumblr", "domain:naver.com", "geosite:bbc", + "domain:gvt1.com", "domain:textnow.com", "domain:twitch.tv", "domain:wikileaks.org" }; const inline QList IPsProxy{ "91.108.4.0/22", "91.108.8.0/22", "91.108.12.0/22", "91.108.20.0/22", "91.108.36.0/23", diff --git a/src/core/connection/Generation.cpp b/src/core/connection/Generation.cpp index daf96f67..4e234e2d 100644 --- a/src/core/connection/Generation.cpp +++ b/src/core/connection/Generation.cpp @@ -539,7 +539,6 @@ namespace Qv2ray::core::connection { bypassBTFilter(root); } - } // Let's process some api features. @@ -643,12 +642,14 @@ namespace Qv2ray::core::connection void bypassBTFilter(CONFIGROOT &root) { - QJsonObject bypassBTRuleObj{ { "protocol", QJsonArray::fromStringList(QStringList{ "bittorrent" }) },{ "outboundTag", OUTBOUND_TAG_DIRECT }, { "type", "field" } }; + QJsonObject bypassBTRuleObj{ { "protocol", QJsonArray::fromStringList(QStringList{ "bittorrent" }) }, + { "outboundTag", OUTBOUND_TAG_DIRECT }, + { "type", "field" } }; ROUTING routing(root["routing"].toObject()); QJsonArray _rules(routing["rules"].toArray()); _rules.insert(0, bypassBTRuleObj); routing["rules"] = _rules; - root["routing"] = routing; + root["routing"] = routing; } } // namespace Generation diff --git a/src/core/connection/Serialization_vmess.cpp b/src/core/connection/Serialization_vmess.cpp index b7bbf44f..8add3fa5 100644 --- a/src/core/connection/Serialization_vmess.cpp +++ b/src/core/connection/Serialization_vmess.cpp @@ -106,7 +106,8 @@ namespace Qv2ray::core::connection } // Explicitly don't support v1 vmess links. - if (!vmessConf.contains("v")) { + if (!vmessConf.contains("v")) + { *errMessage = QObject::tr("seems like a v1 vmess, we don't support it"); return default; } diff --git a/src/ui/w_PreferencesWindow.cpp b/src/ui/w_PreferencesWindow.cpp index 1fd9b6b2..a83ae8a9 100644 --- a/src/ui/w_PreferencesWindow.cpp +++ b/src/ui/w_PreferencesWindow.cpp @@ -643,7 +643,9 @@ void PreferencesWindow::on_bypassBTCb_stateChanged(int arg1) NEEDRESTART if (arg1 == Qt::Checked) { - QvMessageBoxInfo(this, tr("Note"), tr("To recognize the protocol of a connection, one must enable sniffing option in inbound proxy.") + NEWLINE+tr("tproxy inbound's sniffing is enabled by default.")); + QvMessageBoxInfo(this, tr("Note"), + tr("To recognize the protocol of a connection, one must enable sniffing option in inbound proxy.") + NEWLINE + + tr("tproxy inbound's sniffing is enabled by default.")); } CurrentConfig.connectionConfig.bypassBT = arg1 == Qt::Checked; } @@ -1327,4 +1329,4 @@ void PreferencesWindow::on_socksSniffingCB_stateChanged(int arg1) { NEEDRESTART CurrentConfig.inboundConfig.socksSniffing = arg1 == Qt::Checked; -} \ No newline at end of file +}