diff --git a/src/base/models/QvSettingsObject.hpp b/src/base/models/QvSettingsObject.hpp index b4d97b33..103fb3be 100644 --- a/src/base/models/QvSettingsObject.hpp +++ b/src/base/models/QvSettingsObject.hpp @@ -90,13 +90,13 @@ namespace Qv2ray::base::config : listenip("127.0.0.1"), setSystemProxy(true), useSocks(true), socks_port(1088), socks_useAuth(false), socksUDP(true), socksLocalIP("127.0.0.1"), socksAccount(), useHTTP(true), http_port(8888), http_useAuth(false), httpAccount(), useTPROXY(false), tproxy_ip("127.0.0.1"), tproxy_port(12345), tproxy_use_tcp(true), tproxy_use_udp(false), tproxy_followRedirect(true), - tproxy_mode("tproxy"),dnsIntercept(true) + tproxy_mode("tproxy"), dnsIntercept(true) { } XTOSTRUCT(O(setSystemProxy, listenip, useSocks, useHTTP, socks_port, socks_useAuth, socksAccount, socksUDP, socksLocalIP, http_port, http_useAuth, httpAccount, useTPROXY, tproxy_ip, tproxy_port, tproxy_use_tcp, tproxy_use_udp, tproxy_followRedirect, - tproxy_mode,dnsIntercept)) + tproxy_mode, dnsIntercept)) }; struct Qv2rayOutboundsConfig diff --git a/src/core/connection/Generation.cpp b/src/core/connection/Generation.cpp index a251f43f..4dea1658 100644 --- a/src/core/connection/Generation.cpp +++ b/src/core/connection/Generation.cpp @@ -515,7 +515,8 @@ namespace Qv2ray::core::connection { OutboundMarkSettingFilter(GlobalConfig.outboundConfig.mark, root); } - if (GlobalConfig.inboundConfig.useTPROXY && GlobalConfig.inboundConfig.dnsIntercept){ + if (GlobalConfig.inboundConfig.useTPROXY && GlobalConfig.inboundConfig.dnsIntercept) + { DNSInterceptFilter(root); } } @@ -602,22 +603,22 @@ namespace Qv2ray::core::connection root["outbounds"] = outbounds; } - void DNSInterceptFilter(CONFIGROOT &root){ + void DNSInterceptFilter(CONFIGROOT &root) + { // dns outBound - QJsonObject dnsOutboundObj{{"protocol","dns"},{"tag","dns-out"}}; + QJsonObject dnsOutboundObj{ { "protocol", "dns" }, { "tag", "dns-out" } }; OUTBOUNDS outbounds(root["outbounds"].toArray()); outbounds.append(dnsOutboundObj); root["outbounds"] = outbounds; - //dns route - QJsonObject dnsRoutingRuleObj{{"outboundTag", "dns-out"},{"port","53"},{"type", "field"}}; + // dns route + QJsonObject dnsRoutingRuleObj{ { "outboundTag", "dns-out" }, { "port", "53" }, { "type", "field" } }; ROUTING routing(root["routing"].toObject()); QJsonArray _rules(routing["rules"].toArray()); - _rules.insert(0,dnsRoutingRuleObj); - routing["rules"]=_rules; - root["routing"]=routing; + _rules.insert(0, dnsRoutingRuleObj); + routing["rules"] = _rules; + root["routing"] = routing; } - } // namespace Generation } // namespace Qv2ray::core::connection diff --git a/src/ui/w_PreferencesWindow.cpp b/src/ui/w_PreferencesWindow.cpp index fba4130c..aba8d6c0 100644 --- a/src/ui/w_PreferencesWindow.cpp +++ b/src/ui/w_PreferencesWindow.cpp @@ -1261,13 +1261,11 @@ void PreferencesWindow::on_jumpListCountSB_valueChanged(int arg1) void PreferencesWindow::on_outboundMark_valueChanged(int arg1) { NEEDRESTART - CurrentConfig.outboundConfig.mark=arg1; + CurrentConfig.outboundConfig.mark = arg1; } - void PreferencesWindow::on_dnsIntercept_toggled(bool checked) { NEEDRESTART - CurrentConfig.inboundConfig.dnsIntercept=checked; - + CurrentConfig.inboundConfig.dnsIntercept = checked; } diff --git a/src/ui/w_PreferencesWindow.hpp b/src/ui/w_PreferencesWindow.hpp index 203f6ae7..5598d57d 100644 --- a/src/ui/w_PreferencesWindow.hpp +++ b/src/ui/w_PreferencesWindow.hpp @@ -198,7 +198,7 @@ class PreferencesWindow void on_dnsIntercept_toggled(bool checked); -private: + private: // RouteSettingsMatrixWidget *routeSettingsWidget; void SetAutoStartButtonsState(bool isAutoStart);