From d447a6dcebdfa2d77b6b1ebf75326662837a3e6a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jul 2024 11:20:26 +0330 Subject: [PATCH] fix: Add cn_SITE to bypass chinese and sort rule-set suggestions in routing section --- db/RouteEntity.cpp | 2 +- ui/widget/RouteItem.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/db/RouteEntity.cpp b/db/RouteEntity.cpp index c26c3d3..e48d28e 100644 --- a/db/RouteEntity.cpp +++ b/db/RouteEntity.cpp @@ -442,7 +442,7 @@ namespace NekoGui { auto rule1 = std::make_shared(); rule1->name = "Bypass Chinese IPs and Domains"; - rule1->rule_set << QString("cn_IP") << QString("geolocation-cn_SITE"); + rule1->rule_set << QString("cn_IP") << QString("geolocation-cn_SITE") << QString("cn_SITE"); rule1->outboundID = -2; chain->Rules << rule1; diff --git a/ui/widget/RouteItem.cpp b/ui/widget/RouteItem.cpp index 8e1a50f..2cc09ad 100644 --- a/ui/widget/RouteItem.cpp +++ b/ui/widget/RouteItem.cpp @@ -345,6 +345,11 @@ void RouteItem::updateHelperItems(const QString& base) { for (const auto& item: geo_items) { if (item.contains(base)) current_helper_items << item; } + for (int i=0;i current_helper_items[j].length()) current_helper_items.swapItemsAt(i, j); + } + } helperModel->setStringList(current_helper_items); ui->rule_set_helper->setModel(helperModel); }