This commit is contained in:
arm64v8a
2022-09-23 12:54:00 +08:00
parent 0ca3e20824
commit 77e8a7f098
4 changed files with 11 additions and 9 deletions

View File

@@ -36,7 +36,7 @@ namespace NekoRay::fmt {
} }
QString AbstractBean::DisplayTypeAndName() { QString AbstractBean::DisplayTypeAndName() {
return QString(" [%1] %2").arg(DisplayType(), DisplayName()); return QString("[%1] %2").arg(DisplayType(), DisplayName());
} }
void AbstractBean::ResolveDomainToIP(const std::function<void()> &onFinished) { void AbstractBean::ResolveDomainToIP(const std::function<void()> &onFinished) {

View File

@@ -47,6 +47,7 @@ func init() {
} }
return nil return nil
}) })
updateRoutes()
iphlpapi.RegisterNotifyRouteChange2(func(callerContext uintptr, row uintptr, notificationType uint32) uintptr { iphlpapi.RegisterNotifyRouteChange2(func(callerContext uintptr, row uintptr, notificationType uint32) uintptr {
updateRoutes() updateRoutes()
return 0 return 0
@@ -77,10 +78,6 @@ func getBindInterfaceIndex(address string) uint32 {
lock.Lock() lock.Lock()
defer lock.Unlock() defer lock.Unlock()
if routes == nil {
log.Println("warning: no routes info")
return 0
}
if interfaces == nil { if interfaces == nil {
log.Println("warning: no interfaces info") log.Println("warning: no interfaces info")
return 0 return 0
@@ -101,6 +98,11 @@ func getBindInterfaceIndex(address string) uint32 {
return 0 return 0
} }
if routes == nil {
log.Println("warning: no routes info")
return 0
}
for _, route := range routes { for _, route := range routes {
// MIB_IPROUTE_TYPE_INDIRECT // MIB_IPROUTE_TYPE_INDIRECT
if route.ForwardType == 4 { if route.ForwardType == 4 {

View File

@@ -33,7 +33,7 @@ if [ "$GOOS" != "windows" ]; then
fi fi
#### Go ext: sing-box #### #### Go ext: sing-box ####
curl -Lso sing-box.zip https://github.com/SagerNet/sing-box/releases/download/v1.1-beta2/sing-box-1.1-beta2-windows-amd64.zip curl -Lso sing-box.zip https://github.com/SagerNet/sing-box/releases/download/v1.1-beta7/sing-box-1.1-beta7-windows-amd64.zip
unzip sing-box.zip unzip sing-box.zip
mv sing-box-*/sing-box.exe $DEST mv sing-box-*/sing-box.exe $DEST
rm -rf sing-box.zip sing-box-* rm -rf sing-box.zip sing-box-*

View File

@@ -459,7 +459,7 @@ void MainWindow::dialog_message_impl(const QString &sender, const QString &info)
// 订阅完毕 // 订阅完毕
refresh_proxy_list(); refresh_proxy_list();
if (!info.contains("dingyue")) { if (!info.contains("dingyue")) {
MessageBoxInfo("NekoRay", tr("Imported %1 profile(s)").arg(NekoRay::dataStore->imported_count)); showLog(tr("Imported %1 profile(s)").arg(NekoRay::dataStore->imported_count));
} }
} else if (sender == "ExternalProcess") { } else if (sender == "ExternalProcess") {
if (info == "Crashed") { if (info == "Crashed") {
@@ -956,7 +956,7 @@ void MainWindow::on_menu_copy_links_triggered() {
} }
if (links.length() == 0) return; if (links.length() == 0) return;
QApplication::clipboard()->setText(links.join("\n")); QApplication::clipboard()->setText(links.join("\n"));
MessageBoxInfo("NekoRay", tr("Copied %1 item(s)").arg(links.length())); showLog(tr("Copied %1 item(s)").arg(links.length()));
} }
void MainWindow::on_menu_copy_links_nkr_triggered() { void MainWindow::on_menu_copy_links_nkr_triggered() {
@@ -967,7 +967,7 @@ void MainWindow::on_menu_copy_links_nkr_triggered() {
} }
if (links.length() == 0) return; if (links.length() == 0) return;
QApplication::clipboard()->setText(links.join("\n")); QApplication::clipboard()->setText(links.join("\n"));
MessageBoxInfo("NekoRay", tr("Copied %1 item(s)").arg(links.length())); showLog(tr("Copied %1 item(s)").arg(links.length()));
} }
void MainWindow::on_menu_export_config_triggered() { void MainWindow::on_menu_export_config_triggered() {