diff --git a/CMakeLists.txt b/CMakeLists.txt index c288d89..aed08c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) +if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND WIN32) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) +endif () find_package(Qt6 REQUIRED COMPONENTS Widgets Network Svg LinguistTools QuickControls2) diff --git a/cmake/myproto.cmake b/cmake/myproto.cmake index 20de87d..8e6c0cf 100644 --- a/cmake/myproto.cmake +++ b/cmake/myproto.cmake @@ -1,7 +1,7 @@ find_package(Protobuf CONFIG REQUIRED) set(PROTO_FILES - core/grpc_server/gen/libcore.proto + core/cmd/nekobox_core/server/gen/libcore.proto ) add_library(myproto STATIC ${PROTO_FILES}) diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index c76f21f..ffee1d6 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -245,10 +245,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi connect(tray, &QSystemTrayIcon::activated, this, [=](QSystemTrayIcon::ActivationReason reason) { if (reason == QSystemTrayIcon::Context) { - QTimer::singleShot(100, this, [=] - { - ui->menu_program->popup(QCursor::pos()); - }); + ui->menu_program->exec(QCursor::pos()); } if (reason == QSystemTrayIcon::Trigger) { if (this->isVisible()) { @@ -1048,12 +1045,12 @@ void MainWindow::refresh_proxy_list_impl(const int &id, GroupSortAction groupSor void MainWindow::refresh_proxy_list_impl_refresh_data(const int &id, bool stopping) { if (id >= 0) { - auto rowID = ui->proxyListTable->id2Row[id]; - if (rowID < 0) + if (ui->proxyListTable->id2Row.count(id) == 0) { - MW_show_log("Invalid proxy list id, data might be corrupted"); + qDebug("Invalid proxy list id, data might be corrupted"); return; } + auto rowID = ui->proxyListTable->id2Row[id]; auto profile = NekoGui::profileManager->GetProfile(id); refresh_table_item(rowID, profile, stopping); } else