From 772162770d573541a874510eccedfd16787edb96 Mon Sep 17 00:00:00 2001 From: "github-action[bot]" Date: Mon, 15 Apr 2024 20:26:59 +0200 Subject: [PATCH] Update On Mon Apr 15 20:26:58 CEST 2024 --- .github/update.log | 1 + china-ip/china_ip_list.txt | 460 +++++++----- clash-nyanpasu/backend/Cargo.lock | 4 +- .../backend/tauri/src/core/storage.rs | 2 +- clash-nyanpasu/frontend/nyanpasu/package.json | 2 +- clash-nyanpasu/package.json | 2 +- clash-nyanpasu/pnpm-lock.yaml | 22 +- lede/include/kernel-5.15 | 4 +- lede/include/kernel-6.1 | 4 +- ...8-drm-vc4-Support-zpos-on-all-planes.patch | 4 +- ...-Make-use-of-chroma-siting-parameter.patch | 2 +- ...-2-and-4-4-4-4-RGB-RGBX-RGBA-formats.patch | 2 +- ...all-the-downstream-rpi-sound-card-dr.patch | 2 +- ...vc4-Introduce-generation-number-enum.patch | 4 +- ...0963-drm-vc4-hvs-Support-BCM2712-HVS.patch | 4 +- ...n-t-check-if-plane-state-fb-state-fb.patch | 93 --- ...-v6.1-05-mm-multi-gen-LRU-groundwork.patch | 2 +- ...multi-gen-LRU-minimal-implementation.patch | 6 +- ...lti-gen-LRU-support-page-table-walks.patch | 4 +- ...-move-lru_gen_add_mm-out-of-IRQ-off-.patch | 4 +- ...-gen-LRU-per-node-lru_gen_page-lists.patch | 2 +- ...cs-add-driver-for-MediaTek-SGMII-PCS.patch | 2 +- ...t7530-introduce-separate-MDIO-driver.patch | 2 +- ...ntroduce-driver-for-MT7988-built-in-.patch | 2 +- ...or-Motorcomm-yt8521-gigabit-ethernet.patch | 2 +- ...-a-separate-timeout-parameter-for-wa.patch | 16 +- lede/target/linux/generic/config-5.15 | 4 +- lede/target/linux/generic/config-6.1 | 6 +- .../hack-5.15/221-module_exports.patch | 4 +- .../780-usb-net-MeigLink_modem_support.patch | 4 +- .../generic/hack-5.15/902-debloat_proc.patch | 2 +- ...vert-driver-core-Set-fw_devlink-on-b.patch | 2 +- .../721-net-add-packet-mangeling.patch | 4 +- .../hack-6.1/930-usb-net-for-fm350.patch | 4 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- ...etfilter_match_bypass_default_checks.patch | 2 +- ...pool-and-page-referenced-frags-in-GR.patch | 2 +- .../810-pci_disable_common_quirks.patch | 8 +- .../901-usb-add-more-modem-support.patch | 2 +- .../pending-6.1/655-increase_skb_pad.patch | 2 +- .../patches-5.15/410-bt-mtk-serial-fix.patch | 2 +- ...er-for-MediaTek-SoC-built-in-GE-PHYs.patch | 2 +- ...-r8169-add-LED-configuration-from-OF.patch | 4 +- ...ip-add-hardware-random-number-genera.patch | 2 +- ...m64-dts-rockchip-rk3328-add-dfi-node.patch | 2 +- ...ip-add-hardware-random-number-genera.patch | 2 +- ...m64-dts-rockchip-rk3328-add-dfi-node.patch | 2 +- lede/target/linux/x86/config-5.15 | 2 +- lede/target/linux/x86/config-6.1 | 7 +- small/luci-app-mosdns/Makefile | 2 +- .../root/usr/share/mosdns/mosdns.sh | 3 +- small/v2ray-geodata/Makefile | 4 +- suyu/.reuse/dep5 | 52 +- .../icons/overlay/osk_button_backspace.png | Bin 1272 -> 2938 bytes suyu/dist/icons/overlay/overlay.qrc | 60 +- .../arrow_left.png} | Bin .../arrow_right.png} | Bin .../button_A.png} | Bin .../button_B.png} | Bin .../button_L.png} | Bin .../button_R.png} | Bin .../button_X.png} | Bin .../button_Y.png} | Bin .../button_minus.png} | Bin .../button_plus.png} | Bin .../button_press_stick.png} | Bin .../controller_dual_joycon.png} | Bin .../controller_handheld.png} | Bin .../controller_pro.png} | Bin .../controller_single_joycon_left.png} | Bin .../controller_single_joycon_left_a.png} | Bin .../controller_single_joycon_left_b.png} | Bin .../controller_single_joycon_left_x.png} | Bin .../controller_single_joycon_left_y.png} | Bin .../controller_single_joycon_right.png} | Bin .../osk_button_B.png} | Bin .../osk_button_B_disabled.png} | Bin .../osk_button_Y.png} | Bin .../osk_button_Y_disabled.png} | Bin .../osk_button_backspace.png} | Bin .../osk_button_plus.png} | Bin .../osk_button_plus_disabled.png} | Bin .../osk_button_shift.png} | Bin .../osk_button_shift_on.png} | Bin .../colorful/icons/16x16/connected.png | Bin 575 -> 0 bytes .../icons/16x16/connected_notification.png | Bin 760 -> 0 bytes .../colorful/icons/16x16/disconnected.png | Bin 648 -> 0 bytes .../qt_themes/colorful/icons/16x16/lock.png | Bin 330 -> 0 bytes .../colorful/icons/256x256/plus_folder.png | Bin 4643 -> 0 bytes .../colorful/icons/48x48/bad_folder.png | Bin 528 -> 0 bytes .../qt_themes/colorful/icons/48x48/chip.png | Bin 582 -> 0 bytes .../qt_themes/colorful/icons/48x48/folder.png | Bin 460 -> 0 bytes .../colorful/icons/48x48/list-add.png | Bin 204 -> 0 bytes .../colorful/icons/48x48/sd_card.png | Bin 228 -> 0 bytes .../qt_themes/colorful/icons/48x48/star.png | Bin 1108 -> 0 bytes suyu/dist/qt_themes/colorful/style.qrc | 30 - .../qt_themes/colorful_dark/icons/index.theme | 8 - suyu/dist/qt_themes/colorful_dark/style.qrc | 57 -- .../colorful_midnight_blue/icons/index.theme | 8 - .../colorful_midnight_blue/style.qrc | 63 -- suyu/dist/qt_themes/default/default.qrc | 20 +- .../icons/16x16/checked.png | Bin .../icons/16x16/failed.png | Bin .../icons/16x16/info.png | Bin .../qt_themes/default/icons/16x16/lock.png | Bin 318 -> 330 bytes .../icons/16x16/sync.png | Bin .../icons/16x16/view-refresh.png | Bin .../default/icons/256x256/plus_folder.png | Bin 1948 -> 4643 bytes .../default/icons/48x48/bad_folder.png | Bin 1007 -> 528 bytes .../qt_themes/default/icons/48x48/chip.png | Bin 511 -> 582 bytes .../qt_themes/default/icons/48x48/folder.png | Bin 535 -> 460 bytes .../default/icons/48x48/list-add.png | Bin 204 -> 204 bytes .../icons/48x48/no_avatar.png | Bin .../qt_themes/default/icons/48x48/sd_card.png | Bin 198 -> 228 bytes .../qt_themes/default/icons/48x48/star.png | Bin 1029 -> 1108 bytes suyu/dist/qt_themes/default/icons/index.theme | 5 +- suyu/dist/qt_themes/default/style.qss | 204 ++---- .../icons/16x16/lock.png | Bin .../icons/16x16/view-refresh.png | Bin .../qt_themes/default_dark/icons/index.theme | 2 +- suyu/dist/qt_themes/default_dark/style.qrc | 25 - suyu/dist/qt_themes/default_dark/style.qss | 687 ------------------ suyu/dist/qt_themes/monochrome/icons.qrc | 32 + .../qt_themes/monochrome/icons/16x16/lock.png | Bin 0 -> 318 bytes .../monochrome/icons/256x256/plus_folder.png | Bin 0 -> 1948 bytes .../monochrome/icons/48x48/bad_folder.png | Bin 0 -> 1007 bytes .../qt_themes/monochrome/icons/48x48/chip.png | Bin 0 -> 511 bytes .../monochrome/icons/48x48/folder.png | Bin 0 -> 535 bytes .../monochrome/icons/48x48/list-add.png | Bin 0 -> 204 bytes .../monochrome/icons/48x48/sd_card.png | Bin 0 -> 198 bytes .../qt_themes/monochrome/icons/48x48/star.png | Bin 0 -> 1029 bytes .../icons/index.theme | 7 +- suyu/dist/qt_themes/monochrome/style.qrc | 5 + .../icons/16x16/lock.png | Bin .../icons/256x256/plus_folder.png | Bin .../icons/48x48/bad_folder.png | Bin .../icons/48x48/chip.png | Bin .../icons/48x48/folder.png | Bin .../icons/48x48/list-add.png | Bin .../icons/48x48/no_avatar.png | Bin .../icons/48x48/sd_card.png | Bin .../icons/48x48/star.png | Bin .../monochrome_dark/icons/index.theme | 14 + .../qdarkstyle/{style.qss => dark.qss} | 89 +-- suyu/dist/qt_themes/qdarkstyle/icons.qrc | 51 ++ .../qdarkstyle/icons/16x16/connected.png | Bin 575 -> 0 bytes .../icons/16x16/connected_notification.png | Bin 760 -> 0 bytes .../qdarkstyle/icons/16x16/disconnected.png | Bin 648 -> 0 bytes .../qdarkstyle/icons/16x16/view-refresh.png | Bin 362 -> 0 bytes .../qt_themes/qdarkstyle/icons/index.theme | 14 +- suyu/dist/qt_themes/qdarkstyle/style.qrc | 63 +- .../{style.qss => dark.qss} | 93 +-- .../qdarkstyle_midnight_blue/icons.qrc | 224 ++++++ .../icons/index.theme | 14 +- .../qdarkstyle_midnight_blue/style.qrc | 229 +----- .../icons.qrc | 33 + .../icons/index.theme | 14 + .../style.qrc | 8 + .../qt_themes/qdarkstyle_monochrome/icons.qrc | 33 + .../qdarkstyle_monochrome/icons/index.theme | 14 + .../qt_themes/qdarkstyle_monochrome/style.qrc | 8 + suyu/src/common/fs/fs_paths.h | 3 +- suyu/src/common/fs/path_util.cpp | 3 +- suyu/src/common/fs/path_util.h | 3 +- suyu/src/common/settings.cpp | 1 + suyu/src/common/settings.h | 1 + suyu/src/common/settings_enums.h | 2 + suyu/src/suyu/applets/qt_controller.cpp | 16 +- .../src/suyu/applets/qt_software_keyboard.cpp | 158 +++- suyu/src/suyu/applets/qt_software_keyboard.h | 9 + .../configuration/configure_input_player.ui | 72 +- suyu/src/suyu/configuration/configure_ui.cpp | 94 ++- suyu/src/suyu/configuration/configure_ui.h | 1 + suyu/src/suyu/configuration/configure_ui.ui | 14 + suyu/src/suyu/configuration/qt_config.cpp | 15 +- suyu/src/suyu/debugger/wait_tree.cpp | 5 +- suyu/src/suyu/main.cpp | 472 +++++++++--- suyu/src/suyu/main.h | 43 +- suyu/src/suyu/startup_checks.cpp | 1 + suyu/src/suyu/uisettings.cpp | 20 +- suyu/src/suyu/uisettings.h | 26 +- .../main/kotlin/com/v2ray/ang/AppConfig.kt | 1 + .../kotlin/com/v2ray/ang/ui/AboutActivity.kt | 113 ++- .../main/kotlin/com/v2ray/ang/util/Utils.kt | 18 +- .../main/kotlin/com/v2ray/ang/util/ZipUtil.kt | 102 +++ .../res/drawable-night/ic_backup_24dp.xml | 9 + .../res/drawable-night/ic_restore_24dp.xml | 9 + .../src/main/res/drawable/ic_backup_24dp.xml | 9 + .../src/main/res/drawable/ic_restore_24dp.xml | 9 + .../src/main/res/layout/activity_about.xml | 93 ++- .../app/src/main/res/values-ar/strings.xml | 3 + .../app/src/main/res/values-fa/strings.xml | 3 + .../app/src/main/res/values-ru/strings.xml | 3 + .../app/src/main/res/values-vi/strings.xml | 3 + .../src/main/res/values-zh-rCN/strings.xml | 3 + .../src/main/res/values-zh-rTW/strings.xml | 3 + .../app/src/main/res/values/strings.xml | 3 + yass/CMakeLists.txt | 1 + yass/README.md | 2 +- yass/src/android/yass.cpp | 3 +- yass/src/cli/cli.cpp | 5 +- yass/src/config/config.cpp | 138 +--- yass/src/config/config.hpp | 3 +- yass/src/config/config_impl.cpp | 72 +- yass/src/config/config_impl_apple.mm | 16 +- yass/src/config/config_impl_local.hpp | 29 +- yass/src/config/config_impl_windows.hpp | 20 +- yass/src/config/config_version.cpp | 93 +++ yass/src/gtk/yass.cpp | 5 +- yass/src/gtk4/yass.cpp | 5 +- yass/src/harmony/yass.cpp | 3 +- yass/src/ios/main.mm | 5 +- yass/src/mac/main.mm | 5 +- yass/src/server/server.cpp | 5 +- yass/src/win32/yass.cpp | 6 +- .../googletest/.github/workflows/gtest-ci.yml | 43 -- yass/third_party/googletest/.gitignore | 1 + yass/third_party/googletest/BUILD.bazel | 17 + yass/third_party/googletest/CMakeLists.txt | 9 + yass/third_party/googletest/CONTRIBUTORS | 1 + yass/third_party/googletest/MODULE.bazel | 61 ++ yass/third_party/googletest/WORKSPACE | 32 +- yass/third_party/googletest/WORKSPACE.bzlmod | 35 + .../googletest/ci/linux-presubmit.sh | 10 +- .../googletest/ci/macos-presubmit.sh | 3 +- .../googletest/ci/windows-presubmit.bat | 4 +- yass/third_party/googletest/docs/advanced.md | 20 +- .../googletest/docs/gmock_for_dummies.md | 2 + yass/third_party/googletest/docs/primer.md | 21 +- .../googletest/docs/reference/testing.md | 10 +- .../googletest/fake_fuchsia_sdk.bzl | 33 + .../googletest/googlemock/CMakeLists.txt | 7 +- .../googlemock/include/gmock/gmock-actions.h | 6 +- .../googlemock/include/gmock/gmock-matchers.h | 79 +- .../include/gmock/gmock-more-actions.h | 7 +- .../gmock/internal/gmock-internal-utils.h | 14 +- .../include/gmock/internal/gmock-port.h | 8 +- .../googlemock/src/gmock-internal-utils.cc | 5 +- .../googlemock/src/gmock-spec-builders.cc | 3 +- .../test/gmock-more-actions_test.cc | 40 +- .../googletest/googletest/CMakeLists.txt | 2 +- .../googletest/cmake/Config.cmake.in | 4 + .../googletest/cmake/internal_utils.cmake | 4 +- .../include/gtest/gtest-assertion-result.h | 2 +- .../googletest/include/gtest/gtest-printers.h | 56 +- .../googletest/include/gtest/gtest.h | 46 +- .../internal/gtest-death-test-internal.h | 2 +- .../include/gtest/internal/gtest-filepath.h | 8 +- .../include/gtest/internal/gtest-internal.h | 85 +-- .../include/gtest/internal/gtest-param-util.h | 148 ++-- .../include/gtest/internal/gtest-port-arch.h | 2 + .../include/gtest/internal/gtest-port.h | 32 +- .../googletest/src/gtest-death-test.cc | 34 +- .../googletest/src/gtest-internal-inl.h | 44 +- .../googletest/googletest/src/gtest-port.cc | 53 +- .../googletest/googletest/src/gtest.cc | 267 ++++--- .../googletest/test/googletest-color-test.py | 1 + .../test/googletest-death-test-test.cc | 76 +- .../test/googletest-json-output-unittest.py | 15 + .../test/googletest-options-test.cc | 5 +- .../googletest-output-test-golden-lin.txt | 5 - .../googletest/test/gtest_environment_test.cc | 154 ++-- .../googletest/test/gtest_json_test_utils.py | 3 + .../googletest/test/gtest_repeat_test.cc | 4 +- .../googletest/test/gtest_unittest.cc | 37 +- .../test/gtest_xml_output_unittest.py | 15 +- .../googletest/googletest_deps.bzl | 22 +- .../core/http/quic_spdy_client_stream_test.cc | 11 + .../src/quiche/quic/core/quic_session.h | 3 + .../quiche/src/quiche/quic/core/quic_stream.h | 4 + .../src/quiche/spdy/core/spdy_framer_test.cc | 58 +- .../src/quiche/spdy/core/spdy_protocol.h | 61 +- 272 files changed, 3271 insertions(+), 3124 deletions(-) delete mode 100644 lede/target/linux/bcm27xx/patches-6.1/950-1235-drm-vc4-don-t-check-if-plane-state-fb-state-fb.patch rename suyu/dist/icons/{overlay/arrow_left_dark.png => overlay_dark/arrow_left.png} (100%) rename suyu/dist/icons/{overlay/arrow_right_dark.png => overlay_dark/arrow_right.png} (100%) rename suyu/dist/icons/{overlay/button_A_dark.png => overlay_dark/button_A.png} (100%) rename suyu/dist/icons/{overlay/button_B_dark.png => overlay_dark/button_B.png} (100%) rename suyu/dist/icons/{overlay/button_L_dark.png => overlay_dark/button_L.png} (100%) rename suyu/dist/icons/{overlay/button_R_dark.png => overlay_dark/button_R.png} (100%) rename suyu/dist/icons/{overlay/button_X_dark.png => overlay_dark/button_X.png} (100%) rename suyu/dist/icons/{overlay/button_Y_dark.png => overlay_dark/button_Y.png} (100%) rename suyu/dist/icons/{overlay/button_minus_dark.png => overlay_dark/button_minus.png} (100%) rename suyu/dist/icons/{overlay/button_plus_dark.png => overlay_dark/button_plus.png} (100%) rename suyu/dist/icons/{overlay/button_press_stick_dark.png => overlay_dark/button_press_stick.png} (100%) rename suyu/dist/icons/{overlay/controller_dual_joycon_dark.png => overlay_dark/controller_dual_joycon.png} (100%) rename suyu/dist/icons/{overlay/controller_handheld_dark.png => overlay_dark/controller_handheld.png} (100%) rename suyu/dist/icons/{overlay/controller_pro_dark.png => overlay_dark/controller_pro.png} (100%) rename suyu/dist/icons/{overlay/controller_single_joycon_left_dark.png => overlay_dark/controller_single_joycon_left.png} (100%) rename suyu/dist/icons/{overlay/controller_single_joycon_left_a_dark.png => overlay_dark/controller_single_joycon_left_a.png} (100%) rename suyu/dist/icons/{overlay/controller_single_joycon_left_b_dark.png => overlay_dark/controller_single_joycon_left_b.png} (100%) rename suyu/dist/icons/{overlay/controller_single_joycon_left_x_dark.png => overlay_dark/controller_single_joycon_left_x.png} (100%) rename suyu/dist/icons/{overlay/controller_single_joycon_left_y_dark.png => overlay_dark/controller_single_joycon_left_y.png} (100%) rename suyu/dist/icons/{overlay/controller_single_joycon_right_dark.png => overlay_dark/controller_single_joycon_right.png} (100%) rename suyu/dist/icons/{overlay/osk_button_B_dark.png => overlay_dark/osk_button_B.png} (100%) rename suyu/dist/icons/{overlay/osk_button_B_dark_disabled.png => overlay_dark/osk_button_B_disabled.png} (100%) rename suyu/dist/icons/{overlay/osk_button_Y_dark.png => overlay_dark/osk_button_Y.png} (100%) rename suyu/dist/icons/{overlay/osk_button_Y_dark_disabled.png => overlay_dark/osk_button_Y_disabled.png} (100%) rename suyu/dist/icons/{overlay/osk_button_backspace_dark.png => overlay_dark/osk_button_backspace.png} (100%) rename suyu/dist/icons/{overlay/osk_button_plus_dark.png => overlay_dark/osk_button_plus.png} (100%) rename suyu/dist/icons/{overlay/osk_button_plus_dark_disabled.png => overlay_dark/osk_button_plus_disabled.png} (100%) rename suyu/dist/icons/{overlay/osk_button_shift_dark.png => overlay_dark/osk_button_shift.png} (100%) rename suyu/dist/icons/{overlay/osk_button_shift_on_dark.png => overlay_dark/osk_button_shift_on.png} (100%) delete mode 100644 suyu/dist/qt_themes/colorful/icons/16x16/connected.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/16x16/connected_notification.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/16x16/disconnected.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/16x16/lock.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/256x256/plus_folder.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/48x48/bad_folder.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/48x48/chip.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/48x48/folder.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/48x48/list-add.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/48x48/sd_card.png delete mode 100644 suyu/dist/qt_themes/colorful/icons/48x48/star.png delete mode 100644 suyu/dist/qt_themes/colorful/style.qrc delete mode 100644 suyu/dist/qt_themes/colorful_dark/icons/index.theme delete mode 100644 suyu/dist/qt_themes/colorful_dark/style.qrc delete mode 100644 suyu/dist/qt_themes/colorful_midnight_blue/icons/index.theme delete mode 100644 suyu/dist/qt_themes/colorful_midnight_blue/style.qrc rename suyu/dist/qt_themes/{colorful => default}/icons/16x16/checked.png (100%) rename suyu/dist/qt_themes/{colorful => default}/icons/16x16/failed.png (100%) rename suyu/dist/qt_themes/{colorful => default}/icons/16x16/info.png (100%) rename suyu/dist/qt_themes/{colorful => default}/icons/16x16/sync.png (100%) rename suyu/dist/qt_themes/{colorful => default}/icons/16x16/view-refresh.png (100%) rename suyu/dist/qt_themes/{colorful => default}/icons/48x48/no_avatar.png (100%) rename suyu/dist/qt_themes/{colorful_dark => default_dark}/icons/16x16/lock.png (100%) rename suyu/dist/qt_themes/{colorful_dark => default_dark}/icons/16x16/view-refresh.png (100%) delete mode 100644 suyu/dist/qt_themes/default_dark/style.qrc delete mode 100644 suyu/dist/qt_themes/default_dark/style.qss create mode 100644 suyu/dist/qt_themes/monochrome/icons.qrc create mode 100644 suyu/dist/qt_themes/monochrome/icons/16x16/lock.png create mode 100644 suyu/dist/qt_themes/monochrome/icons/256x256/plus_folder.png create mode 100644 suyu/dist/qt_themes/monochrome/icons/48x48/bad_folder.png create mode 100644 suyu/dist/qt_themes/monochrome/icons/48x48/chip.png create mode 100644 suyu/dist/qt_themes/monochrome/icons/48x48/folder.png create mode 100644 suyu/dist/qt_themes/monochrome/icons/48x48/list-add.png create mode 100644 suyu/dist/qt_themes/monochrome/icons/48x48/sd_card.png create mode 100644 suyu/dist/qt_themes/monochrome/icons/48x48/star.png rename suyu/dist/qt_themes/{colorful => monochrome}/icons/index.theme (60%) create mode 100644 suyu/dist/qt_themes/monochrome/style.qrc rename suyu/dist/qt_themes/{qdarkstyle => monochrome_dark}/icons/16x16/lock.png (100%) rename suyu/dist/qt_themes/{qdarkstyle => monochrome_dark}/icons/256x256/plus_folder.png (100%) rename suyu/dist/qt_themes/{qdarkstyle => monochrome_dark}/icons/48x48/bad_folder.png (100%) rename suyu/dist/qt_themes/{qdarkstyle => monochrome_dark}/icons/48x48/chip.png (100%) rename suyu/dist/qt_themes/{qdarkstyle => monochrome_dark}/icons/48x48/folder.png (100%) rename suyu/dist/qt_themes/{qdarkstyle => monochrome_dark}/icons/48x48/list-add.png (100%) rename suyu/dist/qt_themes/{qdarkstyle => monochrome_dark}/icons/48x48/no_avatar.png (100%) rename suyu/dist/qt_themes/{qdarkstyle => monochrome_dark}/icons/48x48/sd_card.png (100%) rename suyu/dist/qt_themes/{qdarkstyle => monochrome_dark}/icons/48x48/star.png (100%) create mode 100644 suyu/dist/qt_themes/monochrome_dark/icons/index.theme rename suyu/dist/qt_themes/qdarkstyle/{style.qss => dark.qss} (93%) create mode 100644 suyu/dist/qt_themes/qdarkstyle/icons.qrc delete mode 100644 suyu/dist/qt_themes/qdarkstyle/icons/16x16/connected.png delete mode 100644 suyu/dist/qt_themes/qdarkstyle/icons/16x16/connected_notification.png delete mode 100644 suyu/dist/qt_themes/qdarkstyle/icons/16x16/disconnected.png delete mode 100644 suyu/dist/qt_themes/qdarkstyle/icons/16x16/view-refresh.png rename suyu/dist/qt_themes/qdarkstyle_midnight_blue/{style.qss => dark.qss} (95%) create mode 100644 suyu/dist/qt_themes/qdarkstyle_midnight_blue/icons.qrc create mode 100644 suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/icons.qrc create mode 100644 suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/icons/index.theme create mode 100644 suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/style.qrc create mode 100644 suyu/dist/qt_themes/qdarkstyle_monochrome/icons.qrc create mode 100644 suyu/dist/qt_themes/qdarkstyle_monochrome/icons/index.theme create mode 100644 suyu/dist/qt_themes/qdarkstyle_monochrome/style.qrc create mode 100644 v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/ZipUtil.kt create mode 100644 v2rayng/V2rayNG/app/src/main/res/drawable-night/ic_backup_24dp.xml create mode 100644 v2rayng/V2rayNG/app/src/main/res/drawable-night/ic_restore_24dp.xml create mode 100644 v2rayng/V2rayNG/app/src/main/res/drawable/ic_backup_24dp.xml create mode 100644 v2rayng/V2rayNG/app/src/main/res/drawable/ic_restore_24dp.xml create mode 100644 yass/src/config/config_version.cpp delete mode 100644 yass/third_party/googletest/.github/workflows/gtest-ci.yml create mode 100644 yass/third_party/googletest/MODULE.bazel create mode 100644 yass/third_party/googletest/WORKSPACE.bzlmod create mode 100644 yass/third_party/googletest/fake_fuchsia_sdk.bzl diff --git a/.github/update.log b/.github/update.log index ec8c7a3582..ef76fe54e7 100644 --- a/.github/update.log +++ b/.github/update.log @@ -617,3 +617,4 @@ Update On Thu Apr 11 20:26:19 CEST 2024 Update On Fri Apr 12 20:24:06 CEST 2024 Update On Sat Apr 13 20:24:55 CEST 2024 Update On Mon Apr 15 01:03:26 CEST 2024 +Update On Mon Apr 15 20:26:48 CEST 2024 diff --git a/china-ip/china_ip_list.txt b/china-ip/china_ip_list.txt index 69ef05893d..0cda593ce1 100644 --- a/china-ip/china_ip_list.txt +++ b/china-ip/china_ip_list.txt @@ -67,7 +67,6 @@ 1.192.0.0/13 1.202.0.0/15 1.204.0.0/14 -3.5.214.0/23 5.154.155.54/31 5.154.155.58/31 5.154.156.50/31 @@ -98,19 +97,35 @@ 15.230.41.0/24 15.230.49.0/24 15.230.141.0/24 +16.2.142.0/23 17.85.6.64/29 +17.85.34.0/25 17.85.38.72/31 +17.85.164.128/25 17.85.192.0/20 17.87.0.0/21 17.87.9.0/24 17.87.10.0/23 17.87.12.0/22 -17.87.16.0/20 +17.87.16.32/27 +17.87.16.64/26 +17.87.16.128/25 +17.87.17.0/24 +17.87.18.0/23 +17.87.20.0/22 +17.87.24.0/21 +17.87.72.224/31 17.87.80.0/21 17.87.112.0/21 +17.87.138.160/31 +17.88.2.16/28 +17.88.73.0/31 17.88.75.0/24 +17.88.80.160/31 +17.88.96.144/31 17.88.104.64/31 17.88.108.0/23 +17.88.112.126/31 17.88.207.192/32 17.93.8.0/21 17.93.24.0/21 @@ -196,6 +211,8 @@ 36.37.48.0/20 36.40.0.0/13 36.48.0.0/15 +36.50.226.0/23 +36.50.254.0/23 36.51.0.0/17 36.51.128.0/18 36.51.192.0/19 @@ -278,6 +295,7 @@ 42.83.88.0/21 42.83.96.0/19 42.83.128.0/23 +42.83.137.0/24 42.83.138.0/23 42.83.140.0/22 42.83.144.0/20 @@ -349,13 +367,11 @@ 43.93.0.0/16 43.94.0.0/15 43.96.6.0/24 -43.96.14.0/24 -43.96.23.0/24 43.96.30.0/23 -43.96.36.0/22 +43.96.37.0/24 +43.96.38.0/23 43.96.40.0/21 43.96.48.0/20 -43.96.64.0/23 43.96.78.0/23 43.96.81.0/24 43.96.82.0/23 @@ -374,7 +390,6 @@ 43.144.0.0/13 43.152.16.0/24 43.152.30.0/24 -43.152.34.0/24 43.152.38.0/23 43.152.46.0/24 43.152.48.0/24 @@ -382,19 +397,20 @@ 43.152.120.0/21 43.152.141.0/24 43.152.150.0/24 -43.152.164.0/22 -43.152.172.0/22 -43.152.179.0/24 +43.152.164.0/23 +43.152.167.0/24 +43.152.172.0/23 +43.152.174.0/24 43.152.189.0/24 43.152.191.0/24 43.159.66.0/24 -43.159.68.0/22 +43.159.68.0/24 +43.159.70.0/23 43.159.72.0/23 43.159.75.0/24 43.159.76.0/24 43.159.92.0/24 43.159.101.0/24 -43.163.0.0/17 43.163.128.0/18 43.164.0.0/14 43.168.0.0/14 @@ -409,7 +425,8 @@ 43.173.0.0/16 43.174.0.0/16 43.175.0.0/21 -43.175.8.0/22 +43.175.9.0/24 +43.175.10.0/23 43.175.13.0/24 43.175.14.0/23 43.175.20.0/23 @@ -421,24 +438,28 @@ 43.175.41.0/24 43.175.42.0/24 43.175.51.0/24 -43.175.55.0/24 43.175.59.0/24 -43.175.61.0/24 43.175.62.0/23 -43.175.64.0/23 +43.175.64.0/24 43.175.70.0/24 -43.175.72.0/23 -43.175.74.0/24 -43.175.76.0/22 -43.175.82.0/23 -43.175.84.0/22 -43.175.88.0/21 -43.175.96.0/19 -43.175.128.0/18 +43.175.72.0/24 +43.175.76.0/23 +43.175.105.0/24 +43.175.106.0/24 +43.175.109.0/24 +43.175.110.0/23 +43.175.126.0/23 +43.175.128.0/22 +43.175.132.0/23 +43.175.137.0/24 +43.175.138.0/23 +43.175.140.0/22 +43.175.144.0/20 +43.175.160.0/19 43.175.192.0/19 -43.175.234.0/23 -43.175.238.0/24 -43.175.240.0/20 +43.175.241.0/24 +43.175.244.0/22 +43.175.248.0/21 43.176.0.0/12 43.192.0.0/14 43.196.0.0/15 @@ -541,14 +562,24 @@ 43.236.108.0/22 43.236.112.0/20 43.236.128.0/17 -43.237.0.0/18 -43.237.64.0/20 -43.237.80.0/21 -43.237.89.0/24 -43.237.91.0/24 -43.237.92.0/22 -43.237.96.0/19 -43.237.128.0/17 +43.237.0.0/21 +43.237.8.0/24 +43.237.10.0/23 +43.237.12.0/22 +43.237.16.0/20 +43.237.32.0/22 +43.237.36.0/23 +43.237.39.0/24 +43.237.40.0/21 +43.237.48.0/20 +43.237.64.0/18 +43.237.128.0/18 +43.237.192.0/20 +43.237.208.0/21 +43.237.217.0/24 +43.237.218.0/23 +43.237.220.0/22 +43.237.224.0/19 43.238.0.0/16 43.239.0.0/19 43.239.32.0/20 @@ -662,7 +693,10 @@ 43.249.236.0/22 43.250.4.0/22 43.250.12.0/25 -43.250.12.128/27 +43.250.12.128/29 +43.250.12.136/31 +43.250.12.140/30 +43.250.12.144/28 43.250.12.160/28 43.250.12.176/30 43.250.12.182/31 @@ -670,7 +704,10 @@ 43.250.12.192/26 43.250.13.0/24 43.250.14.0/25 -43.250.14.128/27 +43.250.14.128/29 +43.250.14.136/31 +43.250.14.140/30 +43.250.14.144/28 43.250.14.160/28 43.250.14.176/30 43.250.14.182/31 @@ -715,6 +752,7 @@ 43.254.100.0/22 43.254.104.0/22 43.254.112.0/21 +43.254.128.0/22 43.254.136.0/21 43.254.144.0/20 43.254.168.0/21 @@ -874,7 +912,8 @@ 45.126.108.0/22 45.126.112.0/21 45.126.120.0/22 -45.126.220.0/22 +45.126.220.0/23 +45.126.222.0/24 45.127.8.0/21 45.127.128.0/22 45.127.144.0/21 @@ -978,10 +1017,14 @@ 45.255.224.0/20 45.255.240.0/21 45.255.248.0/22 +46.3.111.0/24 46.248.24.0/23 47.92.0.0/14 47.96.0.0/11 -49.4.0.0/14 +49.4.0.0/17 +49.4.160.0/19 +49.5.0.0/16 +49.6.0.0/15 49.51.57.0/24 49.51.58.0/23 49.51.60.0/23 @@ -1115,7 +1158,7 @@ 61.236.0.0/15 61.240.0.0/14 62.234.0.0/16 -64.235.230.154/31 +67.220.137.144/28 68.79.0.0/18 69.230.192.0/18 69.231.128.0/18 @@ -1130,6 +1173,8 @@ 81.68.0.0/14 82.156.0.0/15 87.254.207.0/24 +93.113.109.8/29 +93.113.109.136/29 93.183.14.0/24 93.183.18.0/24 94.191.0.0/17 @@ -1440,7 +1485,6 @@ 103.31.160.0/22 103.31.168.0/22 103.31.200.0/22 -103.31.239.0/24 103.31.242.0/23 103.32.0.0/15 103.34.0.0/16 @@ -1448,7 +1492,6 @@ 103.35.32.0/20 103.35.48.0/22 103.35.104.0/22 -103.35.180.0/23 103.35.220.0/22 103.36.28.0/22 103.36.36.0/22 @@ -1619,38 +1662,7 @@ 103.50.240.0/21 103.50.248.0/22 103.52.40.0/22 -103.52.72.0/22 -103.52.76.0/28 -103.52.76.20/30 -103.52.76.24/29 -103.52.76.32/29 -103.52.76.40/30 -103.52.76.44/31 -103.52.76.48/28 -103.52.76.64/26 -103.52.76.128/26 -103.52.76.192/27 -103.52.76.224/29 -103.52.76.232/30 -103.52.76.242/31 -103.52.76.244/30 -103.52.76.248/29 -103.52.77.0/24 -103.52.78.4/30 -103.52.78.8/29 -103.52.78.16/28 -103.52.78.32/28 -103.52.78.48/30 -103.52.78.56/29 -103.52.78.64/26 -103.52.78.128/28 -103.52.78.144/29 -103.52.78.156/30 -103.52.78.160/27 -103.52.78.192/27 -103.52.78.232/29 -103.52.78.240/28 -103.52.79.0/24 +103.52.72.0/21 103.52.80.0/21 103.52.96.0/21 103.52.104.0/22 @@ -1763,6 +1775,7 @@ 103.65.112.0/22 103.65.144.0/20 103.65.160.0/20 +103.65.204.0/22 103.65.224.0/23 103.66.32.0/22 103.66.40.0/22 @@ -1807,8 +1820,6 @@ 103.72.112.0/21 103.72.124.0/22 103.72.128.0/21 -103.72.149.0/24 -103.72.150.0/23 103.72.172.0/22 103.72.180.0/22 103.72.224.0/19 @@ -1817,6 +1828,7 @@ 103.73.116.0/22 103.73.120.0/22 103.73.128.0/20 +103.73.144.0/22 103.73.168.0/22 103.73.176.0/22 103.73.204.0/22 @@ -1898,7 +1910,6 @@ 103.83.60.0/22 103.83.72.0/22 103.83.112.0/22 -103.83.180.0/22 103.84.0.0/22 103.84.12.0/22 103.84.20.0/22 @@ -2451,7 +2462,17 @@ 103.171.32.0/23 103.171.214.0/23 103.172.32.0/23 -103.172.160.0/24 +103.172.160.0/25 +103.172.160.128/26 +103.172.160.194/31 +103.172.160.196/30 +103.172.160.200/29 +103.172.160.208/28 +103.172.160.226/31 +103.172.160.228/31 +103.172.160.238/31 +103.172.160.244/30 +103.172.160.248/29 103.172.161.0/25 103.172.161.128/26 103.172.161.192/30 @@ -2476,9 +2497,9 @@ 103.176.244.0/23 103.177.28.0/23 103.177.70.0/23 +103.177.162.0/24 103.178.240.0/23 103.179.76.0/22 -103.180.109.0/24 103.180.226.0/23 103.181.234.0/23 103.183.26.0/23 @@ -2540,7 +2561,6 @@ 103.196.96.0/22 103.196.168.0/22 103.197.0.0/22 -103.197.180.0/22 103.197.228.0/22 103.198.20.0/22 103.198.60.0/22 @@ -2639,6 +2659,7 @@ 103.208.12.0/22 103.208.16.0/22 103.208.28.0/22 +103.208.40.0/21 103.208.48.0/22 103.209.112.0/22 103.209.136.0/22 @@ -2656,7 +2677,6 @@ 103.211.44.0/22 103.211.96.0/23 103.211.98.0/24 -103.211.102.0/23 103.211.156.0/22 103.211.165.0/24 103.211.220.0/22 @@ -2713,7 +2733,9 @@ 103.218.16.0/21 103.218.28.0/22 103.218.32.0/19 -103.218.64.0/19 +103.218.64.0/20 +103.218.80.0/21 +103.218.88.0/22 103.218.178.0/23 103.218.192.0/20 103.218.208.0/21 @@ -2728,8 +2750,7 @@ 103.219.184.0/22 103.220.48.0/20 103.220.64.0/22 -103.220.93.0/24 -103.220.94.0/23 +103.220.92.0/22 103.220.96.0/22 103.220.104.0/21 103.220.116.0/22 @@ -2743,6 +2764,7 @@ 103.220.240.0/20 103.221.0.0/19 103.221.32.0/20 +103.221.49.0/24 103.221.50.0/23 103.221.88.0/22 103.221.92.0/23 @@ -2826,7 +2848,6 @@ 103.230.44.0/22 103.230.96.0/22 103.230.110.0/23 -103.230.128.0/23 103.230.196.0/22 103.230.200.0/21 103.230.212.0/22 @@ -2859,7 +2880,8 @@ 103.235.80.0/22 103.235.85.0/24 103.235.87.0/24 -103.235.128.0/20 +103.235.132.0/22 +103.235.136.0/21 103.235.144.0/21 103.235.184.0/22 103.235.192.0/22 @@ -2978,7 +3000,7 @@ 103.248.192.0/22 103.248.212.0/22 103.248.224.0/22 -103.249.8.0/22 +103.249.8.0/21 103.249.52.0/22 103.249.128.0/22 103.249.136.0/22 @@ -3326,9 +3348,13 @@ 104.28.255.200/30 104.28.255.204/31 104.28.255.206/32 +104.30.133.172/32 104.44.213.0/31 104.212.68.57/32 104.212.68.58/32 +104.212.68.102/32 +104.212.68.151/32 +104.212.68.152/32 106.0.0.0/24 106.0.2.0/23 106.0.4.0/22 @@ -3398,7 +3424,22 @@ 110.6.0.0/15 110.16.0.0/14 110.34.40.0/21 -110.40.0.0/14 +110.40.0.0/16 +110.41.0.0/18 +110.41.64.0/20 +110.41.80.0/21 +110.41.88.0/23 +110.41.91.0/24 +110.41.92.0/22 +110.41.96.0/19 +110.41.128.0/18 +110.41.192.0/20 +110.41.208.0/23 +110.41.211.0/24 +110.41.212.0/22 +110.41.216.0/21 +110.41.224.0/19 +110.42.0.0/15 110.44.12.0/22 110.48.0.0/16 110.51.0.0/16 @@ -3454,14 +3495,16 @@ 111.66.184.0/21 111.66.192.0/18 111.67.192.0/20 -111.68.83.0/24 +111.68.64.0/19 111.72.0.0/13 111.85.0.0/16 111.91.192.0/19 111.92.248.0/21 111.112.0.0/14 111.116.0.0/15 -111.118.200.0/21 +111.118.200.0/23 +111.118.202.0/24 +111.118.204.0/22 111.119.64.0/18 111.119.128.0/19 111.120.0.0/14 @@ -3493,7 +3536,7 @@ 112.0.0.0/10 112.64.0.0/14 112.73.64.0/18 -112.74.0.0/16 +112.74.0.0/15 112.80.0.0/12 112.96.0.0/13 112.109.128.0/17 @@ -3534,6 +3577,8 @@ 113.130.112.0/21 113.132.0.0/14 113.136.0.0/13 +113.192.40.0/23 +113.192.56.0/23 113.194.0.0/15 113.197.100.0/23 113.197.102.0/24 @@ -3574,14 +3619,7 @@ 114.66.236.0/22 114.66.240.0/20 114.67.0.0/16 -114.68.0.0/18 -114.68.64.0/19 -114.68.96.0/22 -114.68.101.0/24 -114.68.102.0/23 -114.68.104.0/21 -114.68.112.0/20 -114.68.128.0/17 +114.68.0.0/16 114.79.64.0/18 114.80.0.0/12 114.96.0.0/13 @@ -3724,12 +3762,10 @@ 116.196.208.0/20 116.196.224.0/19 116.197.160.0/21 -116.197.180.0/23 116.198.0.0/16 116.199.0.0/17 116.199.128.0/19 116.204.0.0/17 -116.204.232.0/22 116.205.0.0/16 116.207.0.0/16 116.208.0.0/14 @@ -3818,11 +3854,15 @@ 118.26.134.0/23 118.26.136.0/21 118.26.150.0/23 -118.26.159.0/29 +118.26.159.2/31 +118.26.159.4/30 118.26.159.8/31 118.26.159.16/29 -118.26.159.28/30 -118.26.159.32/27 +118.26.159.30/31 +118.26.159.34/31 +118.26.159.36/30 +118.26.159.40/29 +118.26.159.48/28 118.26.159.64/26 118.26.159.128/25 118.26.160.0/19 @@ -3936,16 +3976,7 @@ 119.38.136.0/21 119.38.144.0/20 119.38.160.0/19 -119.38.192.0/20 -119.38.208.0/22 -119.38.212.0/23 -119.38.214.0/27 -119.38.214.56/29 -119.38.214.64/26 -119.38.214.128/25 -119.38.215.0/24 -119.38.216.0/21 -119.38.224.0/19 +119.38.192.0/18 119.39.0.0/16 119.40.0.0/18 119.40.64.0/20 @@ -4004,6 +4035,7 @@ 119.162.0.0/15 119.164.0.0/14 119.176.0.0/12 +119.224.96.0/19 119.232.0.0/15 119.235.128.0/19 119.235.160.0/20 @@ -4075,7 +4107,10 @@ 121.40.0.0/14 121.46.0.0/18 121.46.76.0/22 -121.46.128.0/17 +121.46.128.0/21 +121.46.141.0/24 +121.46.160.0/19 +121.46.192.0/18 121.47.0.0/16 121.48.0.0/15 121.50.8.0/21 @@ -4109,15 +4144,14 @@ 121.59.105.4/31 121.59.105.8/31 121.59.105.12/30 -121.59.105.20/30 -121.59.105.24/30 +121.59.105.20/31 +121.59.105.26/31 121.59.105.30/31 -121.59.105.32/29 +121.59.105.32/31 +121.59.105.36/30 121.59.105.42/31 -121.59.105.44/30 121.59.105.48/30 121.59.105.52/31 -121.59.105.56/31 121.59.105.60/31 121.59.105.64/28 121.59.105.80/31 @@ -4127,13 +4161,17 @@ 121.59.105.112/30 121.59.105.116/31 121.59.105.120/29 -121.59.105.128/29 -121.59.105.136/30 -121.59.105.142/31 -121.59.105.146/31 +121.59.105.128/30 +121.59.105.132/31 +121.59.105.136/31 121.59.105.148/30 121.59.105.152/29 -121.59.105.160/27 +121.59.105.162/31 +121.59.105.164/30 +121.59.105.168/29 +121.59.105.178/31 +121.59.105.180/30 +121.59.105.184/29 121.59.105.192/26 121.59.108.0/24 121.59.110.0/23 @@ -4274,8 +4312,14 @@ 123.62.0.0/16 123.64.0.0/11 123.96.0.0/15 -123.98.0.0/18 -123.98.88.0/21 +123.98.0.0/20 +123.98.16.0/21 +123.98.28.0/22 +123.98.32.0/22 +123.98.40.0/21 +123.98.48.0/22 +123.98.56.0/21 +123.98.88.0/22 123.98.104.0/22 123.98.112.0/21 123.98.124.0/22 @@ -4295,13 +4339,8 @@ 123.99.192.0/18 123.100.0.0/19 123.101.0.0/16 -123.103.0.0/20 -123.103.16.0/21 -123.103.24.0/22 -123.103.28.0/23 -123.103.30.0/24 -123.103.32.0/19 -123.103.64.0/18 +123.103.0.0/17 +123.108.88.0/23 123.108.134.0/24 123.108.138.0/23 123.108.140.0/24 @@ -4340,7 +4379,8 @@ 124.20.32.0/19 124.20.64.0/18 124.20.128.0/17 -124.21.0.0/16 +124.21.96.0/19 +124.21.128.0/17 124.22.0.0/15 124.28.192.0/18 124.29.0.0/17 @@ -4398,8 +4438,7 @@ 124.160.0.0/13 124.172.0.0/15 124.174.0.0/16 -124.175.0.0/17 -124.175.192.0/18 +124.175.0.0/18 124.192.0.0/15 124.196.0.0/16 124.200.0.0/13 @@ -4440,13 +4479,14 @@ 125.215.0.0/18 125.216.0.0/13 125.254.128.0/17 +128.107.24.0/23 128.108.0.0/16 129.28.0.0/16 129.204.0.0/16 129.211.0.0/16 130.36.146.0/23 130.214.218.0/23 -131.228.96.0/24 +131.228.96.0/23 131.253.12.0/29 131.253.12.80/28 131.253.12.240/29 @@ -4530,7 +4570,6 @@ 139.224.0.0/16 139.226.0.0/15 140.75.0.0/16 -140.101.208.0/24 140.143.0.0/16 140.179.0.0/16 140.205.0.0/16 @@ -4595,6 +4634,7 @@ 150.129.252.0/22 150.138.0.0/15 150.158.0.0/16 +150.222.64.0/24 150.222.88.0/23 150.223.0.0/16 150.242.0.0/21 @@ -4637,8 +4677,27 @@ 156.107.181.0/24 156.154.62.0/23 157.0.0.0/16 +157.10.36.0/23 +157.10.112.0/23 +157.10.118.0/23 +157.10.130.0/23 +157.10.218.0/23 +157.10.220.0/23 +157.10.246.0/23 +157.15.74.0/23 +157.15.94.0/23 +157.15.100.0/22 +157.15.104.0/23 +157.15.200.0/23 157.18.0.0/16 +157.20.33.0/24 +157.20.136.0/23 +157.20.194.0/23 +157.20.246.0/23 157.61.0.0/16 +157.66.42.0/23 +157.66.70.0/23 +157.66.88.0/21 157.119.0.0/22 157.119.8.0/21 157.119.16.0/22 @@ -4659,6 +4718,7 @@ 157.148.0.0/16 157.156.0.0/16 157.255.0.0/16 +158.26.192.0/24 158.60.0.0/16 158.79.0.0/24 158.79.2.0/23 @@ -4668,6 +4728,7 @@ 158.79.32.0/19 158.79.64.0/18 158.79.128.0/17 +158.140.252.0/22 159.27.0.0/16 159.75.0.0/16 159.226.0.0/16 @@ -4683,8 +4744,6 @@ 160.202.212.0/22 160.202.216.0/21 160.202.224.0/19 -160.238.65.0/24 -160.238.66.0/23 161.120.0.0/16 161.163.0.0/21 161.163.28.0/23 @@ -4785,6 +4844,7 @@ 175.185.0.0/16 175.186.0.0/15 175.188.0.0/14 +178.173.240.0/24 180.76.16.0/20 180.76.32.0/19 180.76.64.0/18 @@ -4863,7 +4923,26 @@ 182.238.0.0/16 182.239.0.0/19 182.240.0.0/13 -182.254.0.0/16 +182.254.0.0/24 +182.254.1.0/29 +182.254.1.8/30 +182.254.1.14/31 +182.254.1.16/29 +182.254.1.24/30 +182.254.1.28/31 +182.254.1.34/31 +182.254.1.36/30 +182.254.1.40/29 +182.254.1.48/28 +182.254.1.64/26 +182.254.1.128/25 +182.254.2.0/23 +182.254.4.0/22 +182.254.8.0/21 +182.254.16.0/20 +182.254.32.0/19 +182.254.64.0/18 +182.254.128.0/17 183.0.0.0/10 183.64.0.0/13 183.78.160.0/21 @@ -4904,7 +4983,7 @@ 193.20.64.0/22 193.112.0.0/16 193.200.222.160/28 -194.127.229.0/24 +194.61.237.0/25 194.138.136.0/24 194.138.202.0/23 194.138.245.0/24 @@ -5219,6 +5298,7 @@ 202.94.74.0/24 202.94.81.0/24 202.94.92.0/22 +202.95.3.0/24 202.95.240.0/21 202.95.252.0/22 202.96.0.0/12 @@ -5582,7 +5662,8 @@ 203.15.87.0/24 203.15.88.0/23 203.15.105.0/24 -203.15.112.0/21 +203.15.112.0/22 +203.15.119.0/24 203.15.130.0/23 203.15.149.0/24 203.15.151.0/24 @@ -5728,8 +5809,14 @@ 203.22.163.0/24 203.22.166.0/24 203.22.170.0/24 +203.22.178.82/31 +203.22.178.86/31 +203.22.178.90/31 203.22.178.94/31 203.22.178.102/31 +203.22.178.166/31 +203.22.178.170/31 +203.22.178.174/31 203.22.194.0/24 203.22.242.0/23 203.22.245.0/24 @@ -6178,8 +6265,7 @@ 203.86.96.0/23 203.86.108.0/24 203.86.110.0/24 -203.86.115.0/24 -203.86.116.0/23 +203.86.117.0/24 203.86.250.0/24 203.86.254.0/23 203.88.32.0/19 @@ -6283,6 +6369,7 @@ 203.156.192.0/18 203.158.16.0/21 203.160.70.196/31 +203.160.70.208/31 203.160.129.0/24 203.160.192.0/19 203.161.0.0/22 @@ -6413,7 +6500,13 @@ 210.52.110.0/23 210.52.112.0/20 210.52.128.0/17 -210.53.0.0/16 +210.53.0.0/18 +210.53.64.0/19 +210.53.96.0/20 +210.53.112.0/21 +210.53.120.0/22 +210.53.124.0/23 +210.53.128.0/17 210.56.192.0/19 210.72.0.0/14 210.76.0.0/15 @@ -6428,6 +6521,8 @@ 210.79.120.0/22 210.79.224.0/19 210.82.0.0/15 +210.87.72.0/23 +210.87.114.0/23 210.87.128.0/18 210.185.192.0/18 210.192.96.0/19 @@ -6449,9 +6544,9 @@ 211.149.40.0/21 211.149.52.0/22 211.149.60.0/22 -211.149.64.0/20 -211.149.80.0/22 -211.149.88.0/21 +211.149.64.0/21 +211.149.72.0/22 +211.149.92.0/22 211.149.96.0/19 211.149.128.0/17 211.150.0.0/15 @@ -6503,7 +6598,22 @@ 218.31.0.0/16 218.56.0.0/13 218.64.0.0/11 -218.96.0.0/15 +218.96.0.0/16 +218.97.0.0/19 +218.97.32.0/22 +218.97.36.0/23 +218.97.38.0/24 +218.97.39.0/25 +218.97.39.128/26 +218.97.39.192/28 +218.97.39.208/29 +218.97.39.216/30 +218.97.39.220/31 +218.97.39.224/27 +218.97.40.0/21 +218.97.48.0/20 +218.97.64.0/18 +218.97.128.0/17 218.98.0.0/18 218.98.77.0/24 218.98.78.0/23 @@ -6548,7 +6658,9 @@ 219.216.0.0/13 219.224.0.0/13 219.232.0.0/15 -219.234.0.0/21 +219.234.1.0/24 +219.234.2.0/23 +219.234.4.0/22 219.234.10.0/23 219.234.12.0/22 219.234.32.0/19 @@ -6583,6 +6695,7 @@ 220.242.0.0/23 220.242.6.0/24 220.242.8.0/24 +220.242.10.0/24 220.242.12.0/23 220.242.14.0/24 220.242.17.0/24 @@ -6595,18 +6708,23 @@ 220.242.120.0/22 220.242.124.0/23 220.242.126.0/24 -220.242.129.0/24 +220.242.128.0/23 220.242.131.0/24 220.242.134.0/23 220.242.136.0/24 220.242.141.0/24 220.242.142.0/23 -220.242.146.0/24 +220.242.144.0/24 +220.242.146.0/23 +220.242.148.0/24 220.242.150.0/23 220.242.158.0/23 +220.242.161.0/24 +220.242.163.0/24 220.242.164.0/24 220.242.168.0/23 220.242.173.0/24 +220.242.178.0/24 220.242.183.0/24 220.242.184.0/23 220.242.186.0/24 @@ -6626,20 +6744,16 @@ 220.243.128.0/18 220.243.192.0/23 220.243.196.0/22 -220.243.201.0/24 -220.243.204.0/24 +220.243.200.0/23 +220.243.203.0/24 +220.243.204.0/23 220.243.212.0/24 220.243.214.0/23 220.243.216.0/23 220.243.218.0/24 220.243.220.0/23 220.243.223.0/24 -220.243.224.0/22 -220.243.229.0/24 -220.243.230.0/23 -220.243.233.0/24 -220.243.234.0/23 -220.243.236.0/22 +220.243.224.0/20 220.243.243.0/24 220.243.244.0/22 220.243.248.0/23 @@ -6657,27 +6771,7 @@ 221.13.0.0/16 221.14.0.0/15 221.122.0.0/15 -221.128.128.0/22 -221.128.132.0/23 -221.128.135.0/24 -221.128.136.0/21 -221.128.144.0/23 -221.128.147.0/24 -221.128.148.0/22 -221.128.152.0/21 -221.128.160.0/19 -221.128.192.0/22 -221.128.196.0/23 -221.128.199.0/24 -221.128.200.0/21 -221.128.208.0/20 -221.128.224.0/21 -221.128.232.0/22 -221.128.236.0/23 -221.128.238.0/24 -221.128.240.0/21 -221.128.248.0/22 -221.128.252.0/24 +221.128.128.0/17 221.129.0.0/16 221.130.0.0/15 221.133.224.0/19 diff --git a/clash-nyanpasu/backend/Cargo.lock b/clash-nyanpasu/backend/Cargo.lock index 55f2bac4c9..a8d1bfd08b 100644 --- a/clash-nyanpasu/backend/Cargo.lock +++ b/clash-nyanpasu/backend/Cargo.lock @@ -776,9 +776,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", diff --git a/clash-nyanpasu/backend/tauri/src/core/storage.rs b/clash-nyanpasu/backend/tauri/src/core/storage.rs index d13cf77861..c275a1691c 100644 --- a/clash-nyanpasu/backend/tauri/src/core/storage.rs +++ b/clash-nyanpasu/backend/tauri/src/core/storage.rs @@ -24,7 +24,7 @@ impl Storage { redb::Database::open(&path).unwrap() } else { if path.exists() && path.is_dir() { - fs::remove_dir(&path).unwrap(); + fs::remove_dir_all(&path).unwrap(); } let db = redb::Database::create(&path).unwrap(); const TABLE: TableDefinition<&[u8], &[u8]> = TableDefinition::new("clash-nyanpasu"); diff --git a/clash-nyanpasu/frontend/nyanpasu/package.json b/clash-nyanpasu/frontend/nyanpasu/package.json index c3b632a854..207c7b8798 100644 --- a/clash-nyanpasu/frontend/nyanpasu/package.json +++ b/clash-nyanpasu/frontend/nyanpasu/package.json @@ -26,7 +26,7 @@ "axios": "1.6.8", "dayjs": "1.11.10", "framer-motion": "11.0.28", - "i18next": "23.11.1", + "i18next": "23.11.2", "monaco-editor": "0.47.0", "mui-color-input": "2.0.3", "react": "18.2.0", diff --git a/clash-nyanpasu/package.json b/clash-nyanpasu/package.json index ee0b4e1597..52219d6638 100644 --- a/clash-nyanpasu/package.json +++ b/clash-nyanpasu/package.json @@ -101,7 +101,7 @@ "prettier-plugin-toml": "2.0.1", "stylelint": "16.3.1", "stylelint-config-html": "1.1.0", - "stylelint-config-recess-order": "5.0.0", + "stylelint-config-recess-order": "5.0.1", "stylelint-config-standard": "36.0.0", "stylelint-declaration-block-no-ignored-properties": "2.8.0", "stylelint-order": "6.0.4", diff --git a/clash-nyanpasu/pnpm-lock.yaml b/clash-nyanpasu/pnpm-lock.yaml index 8a28eb65f0..d53cec7a4c 100644 --- a/clash-nyanpasu/pnpm-lock.yaml +++ b/clash-nyanpasu/pnpm-lock.yaml @@ -109,8 +109,8 @@ importers: specifier: 1.1.0 version: 1.1.0(postcss-html@1.6.0)(stylelint@16.3.1) stylelint-config-recess-order: - specifier: 5.0.0 - version: 5.0.0(stylelint@16.3.1) + specifier: 5.0.1 + version: 5.0.1(stylelint@16.3.1) stylelint-config-standard: specifier: 36.0.0 version: 36.0.0(stylelint@16.3.1) @@ -196,8 +196,8 @@ importers: specifier: 11.0.28 version: 11.0.28(react-dom@18.2.0)(react@18.2.0) i18next: - specifier: 23.11.1 - version: 23.11.1 + specifier: 23.11.2 + version: 23.11.2 monaco-editor: specifier: 0.47.0 version: 0.47.0 @@ -218,7 +218,7 @@ importers: version: 7.51.3(react@18.2.0) react-i18next: specifier: 14.1.0 - version: 14.1.0(i18next@23.11.1)(react-dom@18.2.0)(react@18.2.0) + version: 14.1.0(i18next@23.11.2)(react-dom@18.2.0)(react@18.2.0) react-markdown: specifier: 9.0.1 version: 9.0.1(@types/react@18.2.78)(react@18.2.0) @@ -4489,8 +4489,8 @@ packages: hasBin: true dev: false - /i18next@23.11.1: - resolution: {integrity: sha512-mXw4A24BiPZKRsbb9ewgSvjYd6fxFCNwJyfK6nYfSTIAX2GkCWcb598m3DFkDZmqADatvuASrKo6qwORz3VwTQ==} + /i18next@23.11.2: + resolution: {integrity: sha512-qMBm7+qT8jdpmmDw/kQD16VpmkL9BdL+XNAK5MNbNFaf1iQQq35ZbPrSlqmnNPOSUY4m342+c0t0evinF5l7sA==} dependencies: '@babel/runtime': 7.24.1 dev: false @@ -6011,7 +6011,7 @@ packages: react: 18.2.0 dev: false - /react-i18next@14.1.0(i18next@23.11.1)(react-dom@18.2.0)(react@18.2.0): + /react-i18next@14.1.0(i18next@23.11.2)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-3KwX6LHpbvGQ+sBEntjV4sYW3Zovjjl3fpoHbUwSgFHf0uRBcbeCBLR5al6ikncI5+W0EFb71QXZmfop+J6NrQ==} peerDependencies: i18next: '>= 23.2.3' @@ -6026,7 +6026,7 @@ packages: dependencies: '@babel/runtime': 7.24.1 html-parse-stringify: 3.0.1 - i18next: 23.11.1 + i18next: 23.11.2 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -6628,8 +6628,8 @@ packages: stylelint: 16.3.1(typescript@5.4.5) dev: true - /stylelint-config-recess-order@5.0.0(stylelint@16.3.1): - resolution: {integrity: sha512-D+/Got844O96No2mj/H2NhLjj555iKAy/Mea+JCerfKB9TBKQW3/IudSVkTCxE4QiRDLldfH15x6FH1D1Anjhw==} + /stylelint-config-recess-order@5.0.1(stylelint@16.3.1): + resolution: {integrity: sha512-rKbGkoa3h0rINrGln9TFVowvSCLgPJC5O0EuPiqlqWcJMb1lImEtXktcjFCVz+hwtSUiHD3ijJc3vP9muFOgJg==} peerDependencies: stylelint: '>=16' dependencies: diff --git a/lede/include/kernel-5.15 b/lede/include/kernel-5.15 index 84a0d0a1bf..4a82b9c9b3 100644 --- a/lede/include/kernel-5.15 +++ b/lede/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .153 -LINUX_KERNEL_HASH-5.15.153 = d7ddb1e144a88773b56a5b4a71baea0b241f3996d446be45290537c6997c84bc +LINUX_VERSION-5.15 = .155 +LINUX_KERNEL_HASH-5.15.155 = c85859b86d2e6d1fc91ca1be8b44f24a9b5bb9f86869b04a8665a3a6559126e4 diff --git a/lede/include/kernel-6.1 b/lede/include/kernel-6.1 index 7012c35175..7760c440af 100644 --- a/lede/include/kernel-6.1 +++ b/lede/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .85 -LINUX_KERNEL_HASH-6.1.85 = 33fe9bcc597c60021a2b2abacd4e0f6f546200ab99594c9a07ad600258b86274 +LINUX_VERSION-6.1 = .86 +LINUX_KERNEL_HASH-6.1.86 = d3d3c8c44f0f0a870a95bd2823f9d91979d1aa6f266da5d8cccd0c4b15e3115b diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0038-drm-vc4-Support-zpos-on-all-planes.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0038-drm-vc4-Support-zpos-on-all-planes.patch index 068862766f..cc8310bf67 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0038-drm-vc4-Support-zpos-on-all-planes.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0038-drm-vc4-Support-zpos-on-all-planes.patch @@ -88,7 +88,7 @@ Signed-off-by: Dave Stevenson if (ret) --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -1600,9 +1600,14 @@ struct drm_plane *vc4_plane_init(struct +@@ -1597,9 +1597,14 @@ struct drm_plane *vc4_plane_init(struct DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE); @@ -103,7 +103,7 @@ Signed-off-by: Dave Stevenson int vc4_plane_create_additional_planes(struct drm_device *drm) { struct drm_plane *cursor_plane; -@@ -1618,24 +1623,35 @@ int vc4_plane_create_additional_planes(s +@@ -1615,24 +1620,35 @@ int vc4_plane_create_additional_planes(s * modest number of planes to expose, that should hopefully * still cover any sane usecase. */ diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0043-vc4-drm-plane-Make-use-of-chroma-siting-parameter.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0043-vc4-drm-plane-Make-use-of-chroma-siting-parameter.patch index b5ebb28bbf..fb648b1fc9 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0043-vc4-drm-plane-Make-use-of-chroma-siting-parameter.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0043-vc4-drm-plane-Make-use-of-chroma-siting-parameter.patch @@ -49,7 +49,7 @@ Signed-off-by: Dom Cobley vc4_dlist_write(vc4_state, 0xc0c0c0c0); } -@@ -1649,6 +1652,8 @@ struct drm_plane *vc4_plane_init(struct +@@ -1646,6 +1649,8 @@ struct drm_plane *vc4_plane_init(struct DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_LIMITED_RANGE); diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0051-drm-vc4-Add-3-3-2-and-4-4-4-4-RGB-RGBX-RGBA-formats.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0051-drm-vc4-Add-3-3-2-and-4-4-4-4-RGB-RGBX-RGBA-formats.patch index c4e0050589..2cd79eac1d 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0051-drm-vc4-Add-3-3-2-and-4-4-4-4-RGB-RGBX-RGBA-formats.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0051-drm-vc4-Add-3-3-2-and-4-4-4-4-RGB-RGBX-RGBA-formats.patch @@ -85,7 +85,7 @@ Signed-off-by: Dave Stevenson }; static const struct hvs_format *vc4_get_hvs_format(u32 drm_format) -@@ -1575,6 +1635,16 @@ static bool vc4_format_mod_supported(str +@@ -1572,6 +1632,16 @@ static bool vc4_format_mod_supported(str case DRM_FORMAT_BGRX1010102: case DRM_FORMAT_RGBA1010102: case DRM_FORMAT_BGRA1010102: diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch index 3b5bfaa7e2..e384710da1 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch @@ -17578,7 +17578,7 @@ Signed-off-by: Ashish Vara +#endif /* _TAS5713_H */ --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c -@@ -1220,7 +1220,15 @@ int snd_soc_runtime_set_dai_fmt(struct s +@@ -1223,7 +1223,15 @@ int snd_soc_runtime_set_dai_fmt(struct s return 0; for_each_rtd_codec_dais(rtd, i, codec_dai) { diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0938-drm-vc4-Introduce-generation-number-enum.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0938-drm-vc4-Introduce-generation-number-enum.patch index 9314c797a0..d904c3d78d 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0938-drm-vc4-Introduce-generation-number-enum.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0938-drm-vc4-Introduce-generation-number-enum.patch @@ -902,7 +902,7 @@ Signed-off-by: Maxime Ripard /* Control word */ vc4_dlist_write(vc4_state, SCALER_CTL0_VALID | -@@ -1717,7 +1717,7 @@ struct drm_plane *vc4_plane_init(struct +@@ -1714,7 +1714,7 @@ struct drm_plane *vc4_plane_init(struct }; for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) { @@ -911,7 +911,7 @@ Signed-off-by: Maxime Ripard formats[num_formats] = hvs_formats[i].drm; num_formats++; } -@@ -1732,7 +1732,7 @@ struct drm_plane *vc4_plane_init(struct +@@ -1729,7 +1729,7 @@ struct drm_plane *vc4_plane_init(struct return ERR_CAST(vc4_plane); plane = &vc4_plane->base; diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-0963-drm-vc4-hvs-Support-BCM2712-HVS.patch b/lede/target/linux/bcm27xx/patches-6.1/950-0963-drm-vc4-hvs-Support-BCM2712-HVS.patch index 9659432294..5cbc304615 100644 --- a/lede/target/linux/bcm27xx/patches-6.1/950-0963-drm-vc4-hvs-Support-BCM2712-HVS.patch +++ b/lede/target/linux/bcm27xx/patches-6.1/950-0963-drm-vc4-hvs-Support-BCM2712-HVS.patch @@ -1924,7 +1924,7 @@ Signed-off-by: Maxime Ripard return 0; } -@@ -1716,7 +2345,7 @@ struct drm_plane *vc4_plane_init(struct +@@ -1713,7 +2342,7 @@ struct drm_plane *vc4_plane_init(struct }; for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) { @@ -1933,7 +1933,7 @@ Signed-off-by: Maxime Ripard formats[num_formats] = hvs_formats[i].drm; num_formats++; } -@@ -1731,7 +2360,7 @@ struct drm_plane *vc4_plane_init(struct +@@ -1728,7 +2357,7 @@ struct drm_plane *vc4_plane_init(struct return ERR_CAST(vc4_plane); plane = &vc4_plane->base; diff --git a/lede/target/linux/bcm27xx/patches-6.1/950-1235-drm-vc4-don-t-check-if-plane-state-fb-state-fb.patch b/lede/target/linux/bcm27xx/patches-6.1/950-1235-drm-vc4-don-t-check-if-plane-state-fb-state-fb.patch deleted file mode 100644 index 7c7c05c5ef..0000000000 --- a/lede/target/linux/bcm27xx/patches-6.1/950-1235-drm-vc4-don-t-check-if-plane-state-fb-state-fb.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 146bbf9627f6c37816939de29538ec8ee9a7be1a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ma=C3=ADra=20Canal?= -Date: Fri, 5 Jan 2024 15:07:34 -0300 -Subject: [PATCH] drm/vc4: don't check if plane->state->fb == state->fb -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Currently, when using non-blocking commits, we can see the following -kernel warning: - -[ 110.908514] ------------[ cut here ]------------ -[ 110.908529] refcount_t: underflow; use-after-free. -[ 110.908620] WARNING: CPU: 0 PID: 1866 at lib/refcount.c:87 refcount_dec_not_one+0xb8/0xc0 -[ 110.908664] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep hid_logitech_hidpp vc4 brcmfmac hci_uart btbcm brcmutil bluetooth snd_soc_hdmi_codec cfg80211 cec drm_display_helper drm_dma_helper drm_kms_helper snd_soc_core snd_compress snd_pcm_dmaengine fb_sys_fops sysimgblt syscopyarea sysfillrect raspberrypi_hwmon ecdh_generic ecc rfkill libaes i2c_bcm2835 binfmt_misc joydev snd_bcm2835(C) bcm2835_codec(C) bcm2835_isp(C) v4l2_mem2mem videobuf2_dma_contig snd_pcm bcm2835_v4l2(C) raspberrypi_gpiomem bcm2835_mmal_vchiq(C) videobuf2_v4l2 snd_timer videobuf2_vmalloc videobuf2_memops videobuf2_common snd videodev vc_sm_cma(C) mc hid_logitech_dj uio_pdrv_genirq uio i2c_dev drm fuse dm_mod drm_panel_orientation_quirks backlight ip_tables x_tables ipv6 -[ 110.909086] CPU: 0 PID: 1866 Comm: kodi.bin Tainted: G C 6.1.66-v8+ #32 -[ 110.909104] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT) -[ 110.909114] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) -[ 110.909132] pc : refcount_dec_not_one+0xb8/0xc0 -[ 110.909152] lr : refcount_dec_not_one+0xb4/0xc0 -[ 110.909170] sp : ffffffc00913b9c0 -[ 110.909177] x29: ffffffc00913b9c0 x28: 000000556969bbb0 x27: 000000556990df60 -[ 110.909205] x26: 0000000000000002 x25: 0000000000000004 x24: ffffff8004448480 -[ 110.909230] x23: ffffff800570b500 x22: ffffff802e03a7bc x21: ffffffecfca68c78 -[ 110.909257] x20: ffffff8002b42000 x19: ffffff802e03a600 x18: 0000000000000000 -[ 110.909283] x17: 0000000000000011 x16: ffffffffffffffff x15: 0000000000000004 -[ 110.909308] x14: 0000000000000fff x13: ffffffed577e47e0 x12: 0000000000000003 -[ 110.909333] x11: 0000000000000000 x10: 0000000000000027 x9 : c912d0d083728c00 -[ 110.909359] x8 : c912d0d083728c00 x7 : 65646e75203a745f x6 : 746e756f63666572 -[ 110.909384] x5 : ffffffed579f62ee x4 : ffffffed579eb01e x3 : 0000000000000000 -[ 110.909409] x2 : 0000000000000000 x1 : ffffffc00913b750 x0 : 0000000000000001 -[ 110.909434] Call trace: -[ 110.909441] refcount_dec_not_one+0xb8/0xc0 -[ 110.909461] vc4_bo_dec_usecnt+0x4c/0x1b0 [vc4] -[ 110.909903] vc4_cleanup_fb+0x44/0x50 [vc4] -[ 110.910315] drm_atomic_helper_cleanup_planes+0x88/0xa4 [drm_kms_helper] -[ 110.910669] vc4_atomic_commit_tail+0x390/0x9dc [vc4] -[ 110.911079] commit_tail+0xb0/0x164 [drm_kms_helper] -[ 110.911397] drm_atomic_helper_commit+0x1d0/0x1f0 [drm_kms_helper] -[ 110.911716] drm_atomic_commit+0xb0/0xdc [drm] -[ 110.912569] drm_mode_atomic_ioctl+0x348/0x4b8 [drm] -[ 110.913330] drm_ioctl_kernel+0xec/0x15c [drm] -[ 110.914091] drm_ioctl+0x24c/0x3b0 [drm] -[ 110.914850] __arm64_sys_ioctl+0x9c/0xd4 -[ 110.914873] invoke_syscall+0x4c/0x114 -[ 110.914897] el0_svc_common+0xd0/0x118 -[ 110.914917] do_el0_svc+0x38/0xd0 -[ 110.914936] el0_svc+0x30/0x8c -[ 110.914958] el0t_64_sync_handler+0x84/0xf0 -[ 110.914979] el0t_64_sync+0x18c/0x190 -[ 110.914996] ---[ end trace 0000000000000000 ]--- - -This happens because, although `prepare_fb` and `cleanup_fb` are -perfectly balanced, we cannot guarantee consistency in the check -plane->state->fb == state->fb. This means that sometimes we can increase -the refcount in `prepare_fb` and don't decrease it in `cleanup_fb`. The -opposite can also be true. - -In fact, the struct drm_plane .state shouldn't be accessed directly -but instead, the `drm_atomic_get_new_plane_state()` helper function should -be used. So, we could stick to this check, but using -`drm_atomic_get_new_plane_state()`. But actually, this check is not really -needed. We can increase and decrease the refcount symmetrically without -problems. - -This is going to make the code more simple and consistent. - -Signed-off-by: MaĆ­ra Canal ---- - drivers/gpu/drm/vc4/vc4_plane.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_plane.c -+++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -2225,9 +2225,6 @@ static int vc4_prepare_fb(struct drm_pla - - drm_gem_plane_helper_prepare_fb(plane, state); - -- if (plane->state->fb == state->fb) -- return 0; -- - return vc4_bo_inc_usecnt(bo); - } - -@@ -2236,7 +2233,7 @@ static void vc4_cleanup_fb(struct drm_pl - { - struct vc4_bo *bo; - -- if (plane->state->fb == state->fb || !state->fb) -+ if (!state->fb) - return; - - bo = to_vc4_bo(&drm_fb_dma_get_gem_obj(state->fb, 0)->base); diff --git a/lede/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch b/lede/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch index 969d721da6..85710eb79b 100644 --- a/lede/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch +++ b/lede/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch @@ -552,7 +552,7 @@ Signed-off-by: Andrew Morton --- a/kernel/bounds.c +++ b/kernel/bounds.c @@ -22,6 +22,11 @@ int main(void) - DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS)); + DEFINE(NR_CPUS_BITS, bits_per(CONFIG_NR_CPUS)); #endif DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t)); +#ifdef CONFIG_LRU_GEN diff --git a/lede/target/linux/generic/backport-5.15/020-v6.1-06-mm-multi-gen-LRU-minimal-implementation.patch b/lede/target/linux/generic/backport-5.15/020-v6.1-06-mm-multi-gen-LRU-minimal-implementation.patch index f8a7d9bd7f..14fc73f84d 100644 --- a/lede/target/linux/generic/backport-5.15/020-v6.1-06-mm-multi-gen-LRU-minimal-implementation.patch +++ b/lede/target/linux/generic/backport-5.15/020-v6.1-06-mm-multi-gen-LRU-minimal-implementation.patch @@ -1251,7 +1251,7 @@ Signed-off-by: Andrew Morton get_scan_count(lruvec, sc, nr); /* Record the original scan target for proportional adjustments later */ -@@ -3372,6 +4142,9 @@ static void snapshot_refaults(struct mem +@@ -3375,6 +4145,9 @@ static void snapshot_refaults(struct mem struct lruvec *target_lruvec; unsigned long refaults; @@ -1261,7 +1261,7 @@ Signed-off-by: Andrew Morton target_lruvec = mem_cgroup_lruvec(target_memcg, pgdat); refaults = lruvec_page_state(target_lruvec, WORKINGSET_ACTIVATE_ANON); target_lruvec->refaults[0] = refaults; -@@ -3736,12 +4509,16 @@ unsigned long try_to_free_mem_cgroup_pag +@@ -3739,12 +4512,16 @@ unsigned long try_to_free_mem_cgroup_pag } #endif @@ -1280,7 +1280,7 @@ Signed-off-by: Andrew Morton if (!can_age_anon_pages(pgdat, sc)) return; -@@ -4058,12 +4835,11 @@ restart: +@@ -4061,12 +4838,11 @@ restart: sc.may_swap = !nr_boost_reclaim; /* diff --git a/lede/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch b/lede/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch index 234dfd916f..4cfd247178 100644 --- a/lede/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch +++ b/lede/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch @@ -149,7 +149,7 @@ Signed-off-by: Andrew Morton --- a/fs/exec.c +++ b/fs/exec.c -@@ -1013,6 +1013,7 @@ static int exec_mmap(struct mm_struct *m +@@ -1014,6 +1014,7 @@ static int exec_mmap(struct mm_struct *m active_mm = tsk->active_mm; tsk->active_mm = mm; tsk->mm = mm; @@ -157,7 +157,7 @@ Signed-off-by: Andrew Morton /* * This prevents preemption while active_mm is being loaded and * it and mm are being updated, which could cause problems for -@@ -1028,6 +1029,7 @@ static int exec_mmap(struct mm_struct *m +@@ -1029,6 +1030,7 @@ static int exec_mmap(struct mm_struct *m tsk->mm->vmacache_seqnum = 0; vmacache_flush(tsk); task_unlock(tsk); diff --git a/lede/target/linux/generic/backport-5.15/020-v6.1-15-mm-multi-gen-LRU-move-lru_gen_add_mm-out-of-IRQ-off-.patch b/lede/target/linux/generic/backport-5.15/020-v6.1-15-mm-multi-gen-LRU-move-lru_gen_add_mm-out-of-IRQ-off-.patch index 5b1d378504..b1319d98a3 100644 --- a/lede/target/linux/generic/backport-5.15/020-v6.1-15-mm-multi-gen-LRU-move-lru_gen_add_mm-out-of-IRQ-off-.patch +++ b/lede/target/linux/generic/backport-5.15/020-v6.1-15-mm-multi-gen-LRU-move-lru_gen_add_mm-out-of-IRQ-off-.patch @@ -31,7 +31,7 @@ Signed-off-by: Andrew Morton --- a/fs/exec.c +++ b/fs/exec.c -@@ -1013,7 +1013,6 @@ static int exec_mmap(struct mm_struct *m +@@ -1014,7 +1014,6 @@ static int exec_mmap(struct mm_struct *m active_mm = tsk->active_mm; tsk->active_mm = mm; tsk->mm = mm; @@ -39,7 +39,7 @@ Signed-off-by: Andrew Morton /* * This prevents preemption while active_mm is being loaded and * it and mm are being updated, which could cause problems for -@@ -1028,6 +1027,7 @@ static int exec_mmap(struct mm_struct *m +@@ -1029,6 +1028,7 @@ static int exec_mmap(struct mm_struct *m local_irq_enable(); tsk->mm->vmacache_seqnum = 0; vmacache_flush(tsk); diff --git a/lede/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch b/lede/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch index 8cc9abd84f..cfeeaa662a 100644 --- a/lede/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch +++ b/lede/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch @@ -354,7 +354,7 @@ Signed-off-by: Andrew Morton static void mem_cgroup_css_free(struct cgroup_subsys_state *css) --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7661,6 +7661,7 @@ static void __init free_area_init_node(i +@@ -7663,6 +7663,7 @@ static void __init free_area_init_node(i pgdat_set_deferred_range(pgdat); free_area_init_core(pgdat); diff --git a/lede/target/linux/generic/backport-5.15/707-v6.3-net-pcs-add-driver-for-MediaTek-SGMII-PCS.patch b/lede/target/linux/generic/backport-5.15/707-v6.3-net-pcs-add-driver-for-MediaTek-SGMII-PCS.patch index 1cae648358..1f2a3ee140 100644 --- a/lede/target/linux/generic/backport-5.15/707-v6.3-net-pcs-add-driver-for-MediaTek-SGMII-PCS.patch +++ b/lede/target/linux/generic/backport-5.15/707-v6.3-net-pcs-add-driver-for-MediaTek-SGMII-PCS.patch @@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -11783,6 +11783,14 @@ L: netdev@vger.kernel.org +@@ -11790,6 +11790,14 @@ L: netdev@vger.kernel.org S: Maintained F: drivers/net/ethernet/mediatek/ diff --git a/lede/target/linux/generic/backport-5.15/790-v6.4-0011-net-dsa-mt7530-introduce-separate-MDIO-driver.patch b/lede/target/linux/generic/backport-5.15/790-v6.4-0011-net-dsa-mt7530-introduce-separate-MDIO-driver.patch index 9c5e7c8138..fea292cbc6 100644 --- a/lede/target/linux/generic/backport-5.15/790-v6.4-0011-net-dsa-mt7530-introduce-separate-MDIO-driver.patch +++ b/lede/target/linux/generic/backport-5.15/790-v6.4-0011-net-dsa-mt7530-introduce-separate-MDIO-driver.patch @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -11895,6 +11895,7 @@ M: Landen Chao L: netdev@vger.kernel.org S: Maintained diff --git a/lede/target/linux/generic/backport-5.15/790-v6.4-0013-net-dsa-mt7530-introduce-driver-for-MT7988-built-in-.patch b/lede/target/linux/generic/backport-5.15/790-v6.4-0013-net-dsa-mt7530-introduce-driver-for-MT7988-built-in-.patch index 2535e36172..fd35b777e9 100644 --- a/lede/target/linux/generic/backport-5.15/790-v6.4-0013-net-dsa-mt7530-introduce-driver-for-MT7988-built-in-.patch +++ b/lede/target/linux/generic/backport-5.15/790-v6.4-0013-net-dsa-mt7530-introduce-driver-for-MT7988-built-in-.patch @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -11893,9 +11893,11 @@ MEDIATEK SWITCH DRIVER +@@ -11900,9 +11900,11 @@ MEDIATEK SWITCH DRIVER M: Sean Wang M: Landen Chao M: DENG Qingfang diff --git a/lede/target/linux/generic/backport-5.15/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch b/lede/target/linux/generic/backport-5.15/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch index 7eb097f86d..57e71bff6b 100644 --- a/lede/target/linux/generic/backport-5.15/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch +++ b/lede/target/linux/generic/backport-5.15/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch @@ -21,7 +21,7 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -12694,6 +12694,7 @@ F: include/uapi/linux/meye.h +@@ -12701,6 +12701,7 @@ F: include/uapi/linux/meye.h MOTORCOMM PHY DRIVER M: Peter Geis diff --git a/lede/target/linux/generic/backport-6.1/861-v6.8-bus-mhi-host-Add-a-separate-timeout-parameter-for-wa.patch b/lede/target/linux/generic/backport-6.1/861-v6.8-bus-mhi-host-Add-a-separate-timeout-parameter-for-wa.patch index 2b83d0396a..30d833adff 100644 --- a/lede/target/linux/generic/backport-6.1/861-v6.8-bus-mhi-host-Add-a-separate-timeout-parameter-for-wa.patch +++ b/lede/target/linux/generic/backport-6.1/861-v6.8-bus-mhi-host-Add-a-separate-timeout-parameter-for-wa.patch @@ -23,7 +23,7 @@ Signed-off-by: Manivannan Sadhasivam --- a/drivers/bus/mhi/host/init.c +++ b/drivers/bus/mhi/host/init.c -@@ -881,6 +881,7 @@ static int parse_config(struct mhi_contr +@@ -882,6 +882,7 @@ static int parse_config(struct mhi_contr if (!mhi_cntrl->timeout_ms) mhi_cntrl->timeout_ms = MHI_TIMEOUT_MS; @@ -33,7 +33,7 @@ Signed-off-by: Manivannan Sadhasivam if (!mhi_cntrl->buffer_len) --- a/drivers/bus/mhi/host/internal.h +++ b/drivers/bus/mhi/host/internal.h -@@ -321,7 +321,7 @@ int __must_check mhi_read_reg_field(stru +@@ -324,7 +324,7 @@ int __must_check mhi_read_reg_field(stru u32 *out); int __must_check mhi_poll_reg_field(struct mhi_controller *mhi_cntrl, void __iomem *base, u32 offset, u32 mask, @@ -60,7 +60,7 @@ Signed-off-by: Manivannan Sadhasivam ret = mhi_read_reg_field(mhi_cntrl, base, offset, mask, &out); --- a/drivers/bus/mhi/host/pm.c +++ b/drivers/bus/mhi/host/pm.c -@@ -163,6 +163,7 @@ int mhi_ready_state_transition(struct mh +@@ -171,6 +171,7 @@ int mhi_ready_state_transition(struct mh enum mhi_pm_state cur_state; struct device *dev = &mhi_cntrl->mhi_dev->dev; u32 interval_us = 25000; /* poll register field every 25 milliseconds */ @@ -68,7 +68,7 @@ Signed-off-by: Manivannan Sadhasivam int ret, i; /* Check if device entered error state */ -@@ -173,14 +174,18 @@ int mhi_ready_state_transition(struct mh +@@ -181,14 +182,18 @@ int mhi_ready_state_transition(struct mh /* Wait for RESET to be cleared and READY bit to be set by the device */ ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL, @@ -89,7 +89,7 @@ Signed-off-by: Manivannan Sadhasivam if (ret) { dev_err(dev, "Device failed to enter MHI Ready\n"); return ret; -@@ -479,7 +484,7 @@ static void mhi_pm_disable_transition(st +@@ -487,7 +492,7 @@ static void mhi_pm_disable_transition(st /* Wait for the reset bit to be cleared by the device */ ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL, @@ -98,7 +98,7 @@ Signed-off-by: Manivannan Sadhasivam if (ret) dev_err(dev, "Device failed to clear MHI Reset\n"); -@@ -492,8 +497,8 @@ static void mhi_pm_disable_transition(st +@@ -500,8 +505,8 @@ static void mhi_pm_disable_transition(st if (!MHI_IN_PBL(mhi_get_exec_env(mhi_cntrl))) { /* wait for ready to be set */ ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs, @@ -109,7 +109,7 @@ Signed-off-by: Manivannan Sadhasivam if (ret) dev_err(dev, "Device failed to enter READY state\n"); } -@@ -1111,7 +1116,8 @@ int mhi_async_power_up(struct mhi_contro +@@ -1125,7 +1130,8 @@ int mhi_async_power_up(struct mhi_contro if (state == MHI_STATE_SYS_ERR) { mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET); ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL, @@ -119,7 +119,7 @@ Signed-off-by: Manivannan Sadhasivam if (ret) { dev_info(dev, "Failed to reset MHI due to syserr state\n"); goto error_exit; -@@ -1202,14 +1208,18 @@ EXPORT_SYMBOL_GPL(mhi_power_down); +@@ -1216,14 +1222,18 @@ EXPORT_SYMBOL_GPL(mhi_power_down); int mhi_sync_power_up(struct mhi_controller *mhi_cntrl) { int ret = mhi_async_power_up(mhi_cntrl); diff --git a/lede/target/linux/generic/config-5.15 b/lede/target/linux/generic/config-5.15 index 87c913ff70..8e9d9469ab 100644 --- a/lede/target/linux/generic/config-5.15 +++ b/lede/target/linux/generic/config-5.15 @@ -344,7 +344,6 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_843419 is not set # CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_858921 is not set -# CONFIG_ARM64_ERRATUM_2441009 is not set # CONFIG_ARM64_HW_AFDBM is not set # CONFIG_ARM64_LSE_ATOMICS is not set # CONFIG_ARM64_MODULE_PLTS is not set @@ -935,7 +934,6 @@ CONFIG_CIFS_XATTR=y # CONFIG_CLEANCACHE is not set # CONFIG_CLKSRC_PISTACHIO is not set # CONFIG_CLKSRC_VERSATILE is not set -# CONFIG_CLKSRC_PISTACHIO is not set # CONFIG_CLK_GFM_LPASS_SM8250 is not set # CONFIG_CLK_HSDK is not set # CONFIG_CLK_QORIQ is not set @@ -5930,7 +5928,6 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_FSL_AUD2HTX is not set # CONFIG_SND_SOC_FSL_AUDMIX is not set # CONFIG_SND_SOC_FSL_ESAI is not set -# CONFIG_SND_SOC_IMX_RPMSG is not set # CONFIG_SND_SOC_FSL_MICFIL is not set # CONFIG_SND_SOC_FSL_RPMSG is not set # CONFIG_SND_SOC_FSL_SAI is not set @@ -5945,6 +5942,7 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_IMX_CARD is not set # CONFIG_SND_SOC_IMX_ES8328 is not set # CONFIG_SND_SOC_IMX_HDMI is not set +# CONFIG_SND_SOC_IMX_RPMSG is not set # CONFIG_SND_SOC_IMX_SPDIF is not set # CONFIG_SND_SOC_IMX_WM8962 is not set # CONFIG_SND_SOC_INNO_RK3036 is not set diff --git a/lede/target/linux/generic/config-6.1 b/lede/target/linux/generic/config-6.1 index da18fde4a4..fcaea2dac9 100644 --- a/lede/target/linux/generic/config-6.1 +++ b/lede/target/linux/generic/config-6.1 @@ -239,8 +239,8 @@ CONFIG_ARCH_BINFMT_ELF_STATE=y # CONFIG_ARCH_EP93XX is not set # CONFIG_ARCH_EXYNOS is not set CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 # CONFIG_ARCH_FOOTBRIDGE is not set +CONFIG_ARCH_FORCE_MAX_ORDER=11 # CONFIG_ARCH_GEMINI is not set # CONFIG_ARCH_HI3xxx is not set # CONFIG_ARCH_HIGHBANK is not set @@ -366,6 +366,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_2441007 is not set # CONFIG_ARM64_ERRATUM_2441009 is not set # CONFIG_ARM64_ERRATUM_2658417 is not set +# CONFIG_ARM64_ERRATUM_2966298 is not set # CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set @@ -375,7 +376,6 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_843419 is not set # CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_858921 is not set -# CONFIG_ARM64_ERRATUM_2966298 is not set # CONFIG_ARM64_HW_AFDBM is not set # CONFIG_ARM64_LSE_ATOMICS is not set CONFIG_ARM64_MODULE_PLTS=y @@ -3319,9 +3319,9 @@ CONFIG_LOCKDEP_STACK_TRACE_BITS=19 CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14 CONFIG_LOCKDEP_SUPPORT=y CONFIG_LOCKD_V4=y -CONFIG_LOCK_MM_AND_FIND_VMA=y # CONFIG_LOCKUP_DETECTOR is not set # CONFIG_LOCK_EVENT_COUNTS is not set +CONFIG_LOCK_MM_AND_FIND_VMA=y # CONFIG_LOCK_STAT is not set # CONFIG_LOCK_TORTURE_TEST is not set # CONFIG_LOGFS is not set diff --git a/lede/target/linux/generic/hack-5.15/221-module_exports.patch b/lede/target/linux/generic/hack-5.15/221-module_exports.patch index 87f541b46f..8db0f7dac7 100644 --- a/lede/target/linux/generic/hack-5.15/221-module_exports.patch +++ b/lede/target/linux/generic/hack-5.15/221-module_exports.patch @@ -27,8 +27,8 @@ Signed-off-by: Felix Fietkau +#define SYMTAB_DISCARD_GPL +#endif + - /* Align . to a 8 byte boundary equals to maximum function alignment. */ - #define ALIGN_FUNCTION() . = ALIGN(8) + /* Align . function alignment. */ + #define ALIGN_FUNCTION() . = ALIGN(CONFIG_FUNCTION_ALIGNMENT) @@ -485,14 +495,14 @@ /* Kernel symbol table: Normal symbols */ \ diff --git a/lede/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch b/lede/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch index 0060fbbd2a..75c2e41fb6 100644 --- a/lede/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch +++ b/lede/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch @@ -43,7 +43,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support #define QUECTEL_VENDOR_ID 0x2c7c /* These Quectel products use Quectel's vendor ID */ -@@ -1147,6 +1152,11 @@ static const struct usb_device_id option +@@ -1152,6 +1157,11 @@ static const struct usb_device_id option { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */ .driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) }, @@ -55,7 +55,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support /* Quectel products using Qualcomm vendor ID */ { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), -@@ -1188,6 +1198,11 @@ static const struct usb_device_id option +@@ -1193,6 +1203,11 @@ static const struct usb_device_id option .driver_info = ZLP }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, diff --git a/lede/target/linux/generic/hack-5.15/902-debloat_proc.patch b/lede/target/linux/generic/hack-5.15/902-debloat_proc.patch index 4d82317b70..c7e40dfc6a 100644 --- a/lede/target/linux/generic/hack-5.15/902-debloat_proc.patch +++ b/lede/target/linux/generic/hack-5.15/902-debloat_proc.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau --- a/fs/locks.c +++ b/fs/locks.c -@@ -2953,6 +2953,8 @@ static const struct seq_operations locks +@@ -3008,6 +3008,8 @@ static const struct seq_operations locks static int __init proc_locks_init(void) { diff --git a/lede/target/linux/generic/hack-5.15/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch b/lede/target/linux/generic/hack-5.15/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch index 4f4d6c7509..b4339e82d7 100644 --- a/lede/target/linux/generic/hack-5.15/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch +++ b/lede/target/linux/generic/hack-5.15/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch @@ -19,7 +19,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/base/core.c +++ b/drivers/base/core.c -@@ -1562,7 +1562,7 @@ static void device_links_purge(struct de +@@ -1577,7 +1577,7 @@ static void device_links_purge(struct de #define FW_DEVLINK_FLAGS_RPM (FW_DEVLINK_FLAGS_ON | \ DL_FLAG_PM_RUNTIME) diff --git a/lede/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch b/lede/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch index a9c889e186..b09c06f329 100644 --- a/lede/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch +++ b/lede/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch @@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -3035,6 +3035,10 @@ static inline int pskb_trim(struct sk_bu +@@ -3046,6 +3046,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -3184,16 +3188,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -3195,16 +3199,6 @@ static inline struct sk_buff *dev_alloc_ } diff --git a/lede/target/linux/generic/hack-6.1/930-usb-net-for-fm350.patch b/lede/target/linux/generic/hack-6.1/930-usb-net-for-fm350.patch index bf436eb2e7..cb73be9725 100644 --- a/lede/target/linux/generic/hack-6.1/930-usb-net-for-fm350.patch +++ b/lede/target/linux/generic/hack-6.1/930-usb-net-for-fm350.patch @@ -1,6 +1,6 @@ --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -589,6 +589,7 @@ +@@ -642,6 +642,7 @@ static void option_instat_callback(struc static const struct usb_device_id option_ids[] = { @@ -8,7 +8,7 @@ { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, -@@ -2210,6 +2211,15 @@ +@@ -2385,6 +2386,15 @@ static int option_probe(struct usb_seria if (device_flags & NUMEP2 && iface_desc->bNumEndpoints != 2) return -ENODEV; diff --git a/lede/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/lede/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index ac5e3a69b8..42f5a8c246 100644 --- a/lede/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/lede/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7620,7 +7620,7 @@ static void __init alloc_node_mem_map(st +@@ -7622,7 +7622,7 @@ static void __init alloc_node_mem_map(st if (pgdat == NODE_DATA(0)) { mem_map = NODE_DATA(0)->node_mem_map; if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/lede/target/linux/generic/pending-5.15/610-netfilter_match_bypass_default_checks.patch b/lede/target/linux/generic/pending-5.15/610-netfilter_match_bypass_default_checks.patch index c1e050e935..b17196d3a9 100644 --- a/lede/target/linux/generic/pending-5.15/610-netfilter_match_bypass_default_checks.patch +++ b/lede/target/linux/generic/pending-5.15/610-netfilter_match_bypass_default_checks.patch @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau for (i = sizeof(struct ipt_entry); i < e->target_offset; i += m->u.match_size) { -@@ -1222,12 +1259,15 @@ compat_copy_entry_to_user(struct ipt_ent +@@ -1224,12 +1261,15 @@ compat_copy_entry_to_user(struct ipt_ent compat_uint_t origsize; const struct xt_entry_match *ematch; int ret = 0; diff --git a/lede/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch b/lede/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch index 8e2f3a9475..54c07f0022 100644 --- a/lede/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch +++ b/lede/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch @@ -17,7 +17,7 @@ Signed-off-by: Alexander Duyck --- a/net/core/skbuff.c +++ b/net/core/skbuff.c -@@ -4359,6 +4359,15 @@ int skb_gro_receive(struct sk_buff *p, s +@@ -4360,6 +4360,15 @@ int skb_gro_receive(struct sk_buff *p, s if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush)) return -E2BIG; diff --git a/lede/target/linux/generic/pending-5.15/810-pci_disable_common_quirks.patch b/lede/target/linux/generic/pending-5.15/810-pci_disable_common_quirks.patch index f7f16ee37d..302051cc3b 100644 --- a/lede/target/linux/generic/pending-5.15/810-pci_disable_common_quirks.patch +++ b/lede/target/linux/generic/pending-5.15/810-pci_disable_common_quirks.patch @@ -25,7 +25,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c -@@ -206,6 +206,7 @@ static void quirk_mmio_always_on(struct +@@ -207,6 +207,7 @@ static void quirk_mmio_always_on(struct DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_BRIDGE_HOST, 8, quirk_mmio_always_on); @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos /* * The Mellanox Tavor device gives false positive parity errors. Disable * parity error reporting. -@@ -3368,6 +3369,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I +@@ -3369,6 +3370,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); @@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos /* * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. * To work around this, query the size it should be configured to by the -@@ -3393,6 +3396,8 @@ static void quirk_intel_ntb(struct pci_d +@@ -3394,6 +3397,8 @@ static void quirk_intel_ntb(struct pci_d DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb); @@ -51,7 +51,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, even * though no one is handling them (e.g., if the i915 driver is never -@@ -3431,6 +3436,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3432,6 +3437,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/lede/target/linux/generic/pending-5.15/901-usb-add-more-modem-support.patch b/lede/target/linux/generic/pending-5.15/901-usb-add-more-modem-support.patch index 913f2d1609..53d3feeaf0 100644 --- a/lede/target/linux/generic/pending-5.15/901-usb-add-more-modem-support.patch +++ b/lede/target/linux/generic/pending-5.15/901-usb-add-more-modem-support.patch @@ -12,7 +12,7 @@ {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -2272,6 +2272,12 @@ static const struct usb_device_id option +@@ -2277,6 +2277,12 @@ static const struct usb_device_id option { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a3, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */ .driver_info = RSVD(4) }, diff --git a/lede/target/linux/generic/pending-6.1/655-increase_skb_pad.patch b/lede/target/linux/generic/pending-6.1/655-increase_skb_pad.patch index 3e5c2337e9..8af331cb23 100644 --- a/lede/target/linux/generic/pending-6.1/655-increase_skb_pad.patch +++ b/lede/target/linux/generic/pending-6.1/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -3001,7 +3001,7 @@ static inline int pskb_network_may_pull( +@@ -3012,7 +3012,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/lede/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch b/lede/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch index 3e2db443db..4f703dbc00 100644 --- a/lede/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch +++ b/lede/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2752,6 +2752,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2746,6 +2746,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; diff --git a/lede/target/linux/mediatek/patches-5.15/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch b/lede/target/linux/mediatek/patches-5.15/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch index 1d8b509678..95e037583a 100644 --- a/lede/target/linux/mediatek/patches-5.15/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch +++ b/lede/target/linux/mediatek/patches-5.15/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch @@ -24,7 +24,7 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -11791,6 +11791,15 @@ S: Maintained +@@ -11798,6 +11798,15 @@ S: Maintained F: drivers/net/pcs/pcs-mtk-lynxi.c F: include/linux/pcs/pcs-mtk-lynxi.h diff --git a/lede/target/linux/rockchip/patches-5.15/101-net-realtek-r8169-add-LED-configuration-from-OF.patch b/lede/target/linux/rockchip/patches-5.15/101-net-realtek-r8169-add-LED-configuration-from-OF.patch index 7886589802..734525c785 100644 --- a/lede/target/linux/rockchip/patches-5.15/101-net-realtek-r8169-add-LED-configuration-from-OF.patch +++ b/lede/target/linux/rockchip/patches-5.15/101-net-realtek-r8169-add-LED-configuration-from-OF.patch @@ -25,7 +25,7 @@ Subject: [PATCH] r8169: add LED configuration from OF TxDescStartAddrLow = 0x20, TxDescStartAddrHigh = 0x24, TxHDescStartAddrLow = 0x28, -@@ -5305,6 +5307,22 @@ done: +@@ -5314,6 +5316,22 @@ done: rtl_rar_set(tp, mac_addr); } @@ -48,7 +48,7 @@ Subject: [PATCH] r8169: add LED configuration from OF static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { struct rtl8169_private *tp; -@@ -5469,6 +5487,7 @@ static int rtl_init_one(struct pci_dev * +@@ -5478,6 +5496,7 @@ static int rtl_init_one(struct pci_dev * if (!tp->counters) return -ENOMEM; diff --git a/lede/target/linux/rockchip/patches-5.15/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch b/lede/target/linux/rockchip/patches-5.15/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch index 5c04d81eae..c9a3c69f63 100644 --- a/lede/target/linux/rockchip/patches-5.15/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch +++ b/lede/target/linux/rockchip/patches-5.15/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch @@ -31,7 +31,7 @@ Signed-off-by: wevsty reg = <0x0 0xff100000 0x0 0x1000>; --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -1939,6 +1939,16 @@ +@@ -1947,6 +1947,16 @@ }; }; diff --git a/lede/target/linux/rockchip/patches-5.15/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch b/lede/target/linux/rockchip/patches-5.15/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch index d9c5f944d9..dd032bf8bf 100644 --- a/lede/target/linux/rockchip/patches-5.15/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch +++ b/lede/target/linux/rockchip/patches-5.15/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch @@ -11,7 +11,7 @@ Signed-off-by: Tianling Shen --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -1010,6 +1010,13 @@ +@@ -1019,6 +1019,13 @@ status = "disabled"; }; diff --git a/lede/target/linux/rockchip/patches-6.1/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch b/lede/target/linux/rockchip/patches-6.1/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch index 3e9af2bd93..f9445eb69a 100644 --- a/lede/target/linux/rockchip/patches-6.1/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch +++ b/lede/target/linux/rockchip/patches-6.1/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch @@ -31,7 +31,7 @@ Signed-off-by: wevsty reg = <0x0 0xff100000 0x0 0x1000>; --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -2045,6 +2045,16 @@ +@@ -2053,6 +2053,16 @@ }; }; diff --git a/lede/target/linux/rockchip/patches-6.1/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch b/lede/target/linux/rockchip/patches-6.1/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch index 6d8ce8da4a..72aa5de036 100644 --- a/lede/target/linux/rockchip/patches-6.1/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch +++ b/lede/target/linux/rockchip/patches-6.1/806-arm64-dts-rockchip-rk3328-add-dfi-node.patch @@ -11,7 +11,7 @@ Signed-off-by: Tianling Shen --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -1023,6 +1023,13 @@ +@@ -1032,6 +1032,13 @@ status = "disabled"; }; diff --git a/lede/target/linux/x86/config-5.15 b/lede/target/linux/x86/config-5.15 index fd864b0ee1..102da2f64b 100644 --- a/lede/target/linux/x86/config-5.15 +++ b/lede/target/linux/x86/config-5.15 @@ -364,8 +364,8 @@ CONFIG_POWER_SUPPLY=y CONFIG_PROC_PAGE_MONITOR=y CONFIG_PROC_PID_ARCH_STATUS=y # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set -CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_PTP_1588_CLOCK=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y # CONFIG_PUNIT_ATOM_DEBUG is not set # CONFIG_QCOM_QMI_HELPERS is not set CONFIG_RATIONAL=y diff --git a/lede/target/linux/x86/config-6.1 b/lede/target/linux/x86/config-6.1 index 89852a8d45..9cfbb38e2a 100644 --- a/lede/target/linux/x86/config-6.1 +++ b/lede/target/linux/x86/config-6.1 @@ -203,8 +203,6 @@ CONFIG_HWMON=y CONFIG_HW_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_VIA=y -# CONFIG_HYPERVISOR_GUEST is not set -CONFIG_HZ_PERIODIC=y CONFIG_HYPERV=y CONFIG_HYPERVISOR_GUEST=y CONFIG_HYPERV_BALLOON=y @@ -214,9 +212,8 @@ CONFIG_HYPERV_STORAGE=y # CONFIG_HYPERV_TESTING is not set CONFIG_HYPERV_TIMER=y CONFIG_HYPERV_UTILS=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_PTP_1588_CLOCK=y # CONFIG_HYPERV_VSOCKETS is not set +CONFIG_HZ_PERIODIC=y CONFIG_I2C=y CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_AMD_MP2 is not set @@ -403,6 +400,8 @@ CONFIG_PREEMPT_RCU=y CONFIG_PROC_PAGE_MONITOR=y CONFIG_PROC_PID_ARCH_STATUS=y # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set +CONFIG_PTP_1588_CLOCK=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y # CONFIG_PUNIT_ATOM_DEBUG is not set CONFIG_RANDOMIZE_KSTACK_OFFSET=y CONFIG_RANDSTRUCT_NONE=y diff --git a/small/luci-app-mosdns/Makefile b/small/luci-app-mosdns/Makefile index 7e0be771af..13e9982f21 100644 --- a/small/luci-app-mosdns/Makefile +++ b/small/luci-app-mosdns/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-mosdns -PKG_VERSION:=1.5.19 +PKG_VERSION:=1.5.20 PKG_RELEASE:=1 LUCI_TITLE:=LuCI Support for mosdns diff --git a/small/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh b/small/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh index 13320f2f82..a8fb606457 100755 --- a/small/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh +++ b/small/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh @@ -56,7 +56,6 @@ adlist_update() { [ "$(uci -q get mosdns.config.adblock)" != 1 ] && return 0 lock_file=/var/lock/mosdns_ad_update.lock ad_source=$(uci -q get mosdns.config.ad_source) - mirror="" : > /etc/mosdns/rule/.ad_source if [ -f "$lock_file" ]; then has_update=0 @@ -74,6 +73,8 @@ adlist_update() { filename=$(basename $url) if echo "$url" | grep -Eq "^https://raw.githubusercontent.com" ; then [ -n "$(uci -q get mosdns.config.github_proxy)" ] && mirror="$(uci -q get mosdns.config.github_proxy)/" + else + mirror="" fi echo -e "\e[1;32mDownloading $mirror$url\e[0m" curl --connect-timeout 5 -m 90 --ipv4 -kfSLo "$AD_TMPDIR/$filename" "$mirror$url" diff --git a/small/v2ray-geodata/Makefile b/small/v2ray-geodata/Makefile index 5f25c752a8..e7de774ebf 100644 --- a/small/v2ray-geodata/Makefile +++ b/small/v2ray-geodata/Makefile @@ -30,13 +30,13 @@ define Download/geosite HASH:=e74d3da9d4db57fba399f9093ffabbc6630a7cf10965ebcde07725a0f00e24d7 endef -GEOSITE_IRAN_VER:=202404080026 +GEOSITE_IRAN_VER:=202404150255 GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER) define Download/geosite-ir URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/ URL_FILE:=iran.dat FILE:=$(GEOSITE_IRAN_FILE) - HASH:=f6ec57fcf18bf4ef2149c038837ffea2a8d5d16f10f4218ad75f3ae65ec8f611 + HASH:=7b29fd53c2a25c6d79eeb6f76cc4b0a0770fe00eee1ea4d7a4a9f77d49ca44ad endef define Package/v2ray-geodata/template diff --git a/suyu/.reuse/dep5 b/suyu/.reuse/dep5 index baf1354bf6..9779726e3f 100644 --- a/suyu/.reuse/dep5 +++ b/suyu/.reuse/dep5 @@ -5,10 +5,13 @@ Comment: It is best to use this file to record copyright information about Files: dist/english_plurals/* dist/icons/controller/*.png dist/icons/overlay/*.png + dist/icons/overlay_dark/*.png dist/languages/* dist/qt_themes/*/icons/48x48/sd_card.png dist/qt_themes/*/icons/index.theme dist/qt_themes/default/style.qss + dist/qt_themes/*/icons.qrc + dist/qt_themes/*/style.qrc Copyright: yuzu Emulator Project suyu Emulator Project License: GPL-2.0-or-later @@ -22,8 +25,7 @@ Copyright: suyu Emulator Project License: GPL-2.0-or-later Files: dist/qt_themes/qdarkstyle*/LICENSE.* - dist/qt_themes/qdarkstyle*/style.qrc - dist/qt_themes/qdarkstyle*/style.qss + dist/qt_themes/qdarkstyle*/dark.qss Copyright: 2013 Colin Duquesnoy 2019 Daniel Cosmo Pizetta License: MIT @@ -33,28 +35,28 @@ Copyright: 2013 Colin Duquesnoy 2019 Daniel Cosmo Pizetta License: CC-BY-4.0 -Files: dist/qt_themes/default/icons/256x256/plus_folder.png - dist/qt_themes/default/icons/48x48/bad_folder.png - dist/qt_themes/default/icons/48x48/chip.png - dist/qt_themes/default/icons/48x48/folder.png - dist/qt_themes/default/icons/48x48/star.png - dist/qt_themes/qdarkstyle/icons/256x256/plus_folder.png - dist/qt_themes/qdarkstyle/icons/48x48/bad_folder.png - dist/qt_themes/qdarkstyle/icons/48x48/chip.png - dist/qt_themes/qdarkstyle/icons/48x48/folder.png - dist/qt_themes/qdarkstyle/icons/48x48/star.png +Files: dist/qt_themes/monochrome/icons/256x256/plus_folder.png + dist/qt_themes/monochrome/icons/48x48/bad_folder.png + dist/qt_themes/monochrome/icons/48x48/chip.png + dist/qt_themes/monochrome/icons/48x48/folder.png + dist/qt_themes/monochrome/icons/48x48/star.png + dist/qt_themes/monochrome_dark/icons/48x48/bad_folder.png + dist/qt_themes/monochrome_dark/icons/48x48/chip.png + dist/qt_themes/monochrome_dark/icons/48x48/folder.png + dist/qt_themes/monochrome_dark/icons/48x48/star.png + dist/qt_themes/monochrome_dark/icons/256x256/plus_folder.png Copyright: Refactoring UI Inc. License: MIT Comment: https://github.com/tailwindlabs/heroicons -Files: dist/qt_themes/colorful/icons/16x16/lock.png - dist/qt_themes/colorful/icons/256x256/plus_folder.png - dist/qt_themes/colorful/icons/48x48/bad_folder.png - dist/qt_themes/colorful/icons/48x48/chip.png - dist/qt_themes/colorful/icons/48x48/folder.png - dist/qt_themes/colorful_dark/icons/16x16/lock.png - dist/qt_themes/colorful/icons/16x16/info.png - dist/qt_themes/colorful/icons/16x16/sync.png +Files: dist/qt_themes/default/icons/16x16/lock.png + dist/qt_themes/default/icons/256x256/plus_folder.png + dist/qt_themes/default/icons/48x48/bad_folder.png + dist/qt_themes/default/icons/48x48/chip.png + dist/qt_themes/default/icons/48x48/folder.png + dist/qt_themes/default_dark/icons/16x16/lock.png + dist/qt_themes/default/icons/16x16/info.png + dist/qt_themes/default/icons/16x16/sync.png Copyright: Icons8 License: MIT Comment: https://github.com/icons8/flat-color-icons @@ -70,15 +72,15 @@ Files: dist/qt_themes/*/icons/48x48/no_avatar.png Copyright: Ionic (http://ionic.io/) License: MIT -Files: dist/qt_themes/colorful/icons/48x48/star.png - dist/qt_themes/colorful/icons/16x16/checked.png - dist/qt_themes/colorful/icons/16x16/failed.png +Files: dist/qt_themes/default/icons/48x48/star.png + dist/qt_themes/default/icons/16x16/checked.png + dist/qt_themes/default/icons/16x16/failed.png Copyright: SVG Repo License: CC0-1.0 Files: dist/qt_themes/*/icons/16x16/view-refresh.png - dist/qt_themes/default/icons/16x16/lock.png - dist/qt_themes/qdarkstyle/icons/16x16/lock.png + dist/qt_themes/monochrome/icons/16x16/lock.png + dist/qt_themes/monochrome_dark/icons/16x16/lock.png Copyright: Google, Inc. License: Apache-2.0 diff --git a/suyu/dist/icons/overlay/osk_button_backspace.png b/suyu/dist/icons/overlay/osk_button_backspace.png index b7dc33228250bc2af38d43d24d05c2c25cd73a2b..b212efbbc3301cb6cf45863ef2defefd7cfc69ae 100644 GIT binary patch literal 2938 zcmV-=3x)KFP)uq`Zoshq!_S2zX8&7#L{o>+3r{4XX+2!McR`QE*IHy=KHSOyDKpZW9WcQ0JH@RPvvoXSCAbVPy70R%i3cXoC@Fg!e5 zq0J%ibO6tV!1I#UM`8D01u_K?@Lb90@;!_)&(S7u!GZ;C)z#G>2cB27J_@`4DUca} zfaj|A_Vx{?G((j`;CTahE&!gts~i+YM=6jAfPm)9Op5-9*3Z)BkW1EIxO7R+^DnKB z!tQ7Vf(HnA)&kEhHp#26umAI$Idi1vX|wTD*k%kM7x3_y{sNEdp8%eH1pw|92(kwP z92qY7K0VKkHX$!vy0iuRi-D)l#!q28wF1EbWZ?NB@T{>(9Pr5CpbQfB+xW4yC7xQ^ z&}-{QV{giN%Q^p`#y*NoPym^g6F&oD}TEj;SSpPv9%?hWsH_Tw0QC2 z&(oGIw*KPSb8Z>x_zgdc`T3NuFH$f7nQzOlfaf!DgqnCP@Z87$eGb8fZT#5U3OxJv z?c09n(4ngG^72Cs4Go`73Zij%(DKs~2bw(T3!)$ZBH(%QZ6V-GZ4!r2_hNr7i8^fK z$JVwKo^fAEK{OGb@$>tFD0P4cxQZY*0nf*55{E!{V7~@lAk57nF z1&Dwb65Mv+`H)TGfag}g`KFBz7q-WO$2UaN!Q%^})Bqyj1|~#zFfn?DP4cn?k1vR# z!s7#?Q~)C2CT=d9xyd|L3(u@sv&I@58^1=+^8>99S9Vc)o{8sjbx#x*9@h{h4iEvK z(BI#`YybZJ@6;yHz;gre$oyEU9}PUNdLk`6E+I-3AOe0j^~<}cUw)f5>wI%ZcqIM; z@Z7ES;nI$ne$74Hm0F*C8HVUdR}s&{aeSCz4|#H38ON^lSaa_4Irs0iJ`w|nfZt=_ zIZoSH)9tS&;0LunT-(|90@9wim$Nj^IhAgS07SrNc6WF0IC$`2y*7d7+j0f)Y}Wel zWtU_^lRQ@xy}ScNz#rjec^fy)wNV;0*)enH&K;<$t6K>?k7|ARwo4+hNt`3DPF?{b z;PaRZ+QQ0->bMOXKfa=(qG!>fMJs^k8Lf|`?0hEJr*9j5ya7bOE2v-INd5ABZ3E}c zo7creqyw*q3c0LmA!>21DqVh%bJX;%* zPk5wFP60x+>-nbq1i$LycP?3fvV#tv14iWSbU5NxsnibJv^}bAQV=Bxj}<@$p4)-vhNvP=b{ypxPw@Yj0MC9KKUuK#4N=nY zr~yIw2R+u zV$j;UhA1s~v;b{%uyR65F{C78M4N=H+Zl*NORI$hvVeel$jg#i@i9^N*yBJ1zKT)i z2N-3R%UJ9W-KgBlAk->}wNODN;Ak!7EGhJ~G5Y4C^GhD+nE^Au%L9s7kr5qr}%|LXM79whV zUZ&RPJRs`Q`pA-s?no$L12BLb_yg$L3_fxb90itgM(RZ}=Y1_GiNA?sVmYG%3Y9M+m zt4~{4NcawIGJ)tuAi7;^pO&3Vc*dtEeE4*wkJC$7X`=}Gq~6}%rw$xA(4=XsS^qBc zWg9g1Y1sHov`^nQT6qJ=^hEDtUD$5cg~>jBu|H-VysSq3ZEWL&4U$N366c63n^%Ag zL}&A6oo4Nub%1D)djWZ?juf5+`AIUdNuDc;*xms$5M4mQ{Z_fIj4f5LRfPWE>*ga0KUTCcG$Y~m{rOb=9Y{eBm{Pz$|LWBhQA zSd7vW$!6sDEA0!j7zzXjkhv#1osG$NvoX264l4G?ET5KrrDMH5Aoht0gLFosqv+1% z?89tOzEfTq8Rhti$MCA}1Jo1C7Qyo7=HlZ?fgpRJlFQj86zD&w-7c6_uf42(T@FNl z@TA|2cN;W7=5n^0F`{4ayJ{l`%0Tu~1|pNMf1UB!_8>s;02zqB0z^O7#?NjbZ?YSR zl!5$H>!YxnT!BmgWFWc;h;G&<((FGi1!)~xABEk~3S$l6?m6LIlee1ECo^r$Xv=~BZo~u zbWvFH6s?&~fgk`f5LNQ;4j?*bx<(g&4@ZGu05TBOQU3iR=W@!j2&7SBi%(eLh+kBtQnDQz--4O&LgCKBUfP6u|;y zAo>8SL?6|x63u72!iy?sfDA1 k05T9+z0bpse1+Hl06GPGVnhOmSpWb407*qoM6N<$f-{k5TmS$7 delta 1263 zcmVCEmkaxCG}RWF%OnckANy6U%_W+heyPsJ_)Bnp(R%b9}bm&zm{ zQ6Re|=lFTdPv!AIqCj?A&h_)~YYqnz1>#MJnGdJ;1ri0)JbWYT z4kQWWO7<+pV}GA3cLI_GawT)V;^9-jbwFS$ox>JYT^j_(EYEUf zy@lp!$-DWie39YPipS9jqWD0rwY^vInCo4ONIXsu2_8Wd zALy6%d_wW?BG)Vyk025}f+#+a>B5&J&nZAG9zi5{1bjLV(mdfnu4K-Y#edKI-Vq}8K%{xXfn0N5C5s;vy9D(^ zqn0ATkO)n88U3ncm_{cp^1qWXQ?4M_86{=dkPgqMHo0Hpax@t?So zJbymg?lk}L2>e}3h!_Uy!`uxJl(IDZzy3OfNnvfDmDWg^RBM}A`fNOt28 zuuF?=@71vYknH#iV0I82K|h!wh!V3r zt9cGk{n9?K39|#lYx8-nPfkSPBY2ue1L^Q&LG&KG=0p@e#Ho40fn14~sHKo!+UG(P zJ_f9LG?0#KCci=-cdg?Qg$cmjZAv3Woc-RYXgBMLi;AbH{g0pGXfvwk9bwSOzc zBMLjrB6;Ei0p(77(@(^c5sdFK7jTdMEcZVkl9LcmJ z`HPomKDS632r!dr{F~Kw?WBQ#Y-!f~OCgozk_G~@b;YPKIW1`*z-}!@9)8QlBn<>` zFY%NAof(`o5MYlLM4#1qCk+J1*=X2zOqZmAT#1)^fr^{Fx#qmH08%%sc(?!(caOHu z7eM0Ln{O9D;y%Fqq5$%yGKk+5K;D$c^N#|^8@o8O0>~S#%$Ws{H)eg#Er2``r#~9m Z<4=bU9t_=IpXdMp002ovPDHLkV1g|JP>28k diff --git a/suyu/dist/icons/overlay/overlay.qrc b/suyu/dist/icons/overlay/overlay.qrc index 8d7833aca0..2319e6dd28 100644 --- a/suyu/dist/icons/overlay/overlay.qrc +++ b/suyu/dist/icons/overlay/overlay.qrc @@ -6,64 +6,66 @@ SPDX-License-Identifier: GPL-2.0-or-later arrow_left.png - arrow_left_dark.png arrow_right.png - arrow_right_dark.png button_minus.png - button_minus_dark.png button_plus.png - button_plus_dark.png button_A.png - button_A_dark.png button_B.png - button_B_dark.png button_X.png - button_X_dark.png button_Y.png - button_Y_dark.png button_L.png - button_L_dark.png button_R.png - button_R_dark.png button_press_stick.png - button_press_stick_dark.png osk_button_B.png osk_button_B_disabled.png - osk_button_B_dark.png - osk_button_B_dark_disabled.png osk_button_Y.png osk_button_Y_disabled.png - osk_button_Y_dark.png - osk_button_Y_dark_disabled.png osk_button_backspace.png - osk_button_backspace_dark.png osk_button_plus.png osk_button_plus_disabled.png - osk_button_plus_dark.png - osk_button_plus_dark_disabled.png osk_button_shift.png - osk_button_shift_dark.png osk_button_shift_on.png - osk_button_shift_on_dark.png osk_button_shift_lock_on.png osk_button_shift_lock_off.png controller_dual_joycon.png - controller_dual_joycon_dark.png controller_pro.png - controller_pro_dark.png controller_handheld.png - controller_handheld_dark.png controller_single_joycon_left.png - controller_single_joycon_left_dark.png controller_single_joycon_right.png - controller_single_joycon_right_dark.png controller_single_joycon_left_a.png - controller_single_joycon_left_a_dark.png controller_single_joycon_left_b.png - controller_single_joycon_left_b_dark.png controller_single_joycon_left_x.png - controller_single_joycon_left_x_dark.png controller_single_joycon_left_y.png - controller_single_joycon_left_y_dark.png + + + ../overlay_dark/arrow_left.png + ../overlay_dark/arrow_right.png + ../overlay_dark/button_minus.png + ../overlay_dark/button_plus.png + ../overlay_dark/button_A.png + ../overlay_dark/button_B.png + ../overlay_dark/button_X.png + ../overlay_dark/button_Y.png + ../overlay_dark/button_L.png + ../overlay_dark/button_R.png + ../overlay_dark/button_press_stick.png + ../overlay_dark/osk_button_B.png + ../overlay_dark/osk_button_B.png + ../overlay_dark/osk_button_Y.png + ../overlay_dark/osk_button_Y.png + ../overlay_dark/osk_button_backspace.png + ../overlay_dark/osk_button_plus.png + ../overlay_dark/osk_button_plus.png + ../overlay_dark/osk_button_shift.png + ../overlay_dark/osk_button_shift_on.png + ../overlay_dark/controller_dual_joycon.png + ../overlay_dark/controller_pro.png + ../overlay_dark/controller_handheld.png + ../overlay_dark/controller_single_joycon_left.png + ../overlay_dark/controller_single_joycon_right.png + ../overlay_dark/controller_single_joycon_left_a.png + ../overlay_dark/controller_single_joycon_left_b.png + ../overlay_dark/controller_single_joycon_left_x.png + ../overlay_dark/controller_single_joycon_left_y.png diff --git a/suyu/dist/icons/overlay/arrow_left_dark.png b/suyu/dist/icons/overlay_dark/arrow_left.png similarity index 100% rename from suyu/dist/icons/overlay/arrow_left_dark.png rename to suyu/dist/icons/overlay_dark/arrow_left.png diff --git a/suyu/dist/icons/overlay/arrow_right_dark.png b/suyu/dist/icons/overlay_dark/arrow_right.png similarity index 100% rename from suyu/dist/icons/overlay/arrow_right_dark.png rename to suyu/dist/icons/overlay_dark/arrow_right.png diff --git a/suyu/dist/icons/overlay/button_A_dark.png b/suyu/dist/icons/overlay_dark/button_A.png similarity index 100% rename from suyu/dist/icons/overlay/button_A_dark.png rename to suyu/dist/icons/overlay_dark/button_A.png diff --git a/suyu/dist/icons/overlay/button_B_dark.png b/suyu/dist/icons/overlay_dark/button_B.png similarity index 100% rename from suyu/dist/icons/overlay/button_B_dark.png rename to suyu/dist/icons/overlay_dark/button_B.png diff --git a/suyu/dist/icons/overlay/button_L_dark.png b/suyu/dist/icons/overlay_dark/button_L.png similarity index 100% rename from suyu/dist/icons/overlay/button_L_dark.png rename to suyu/dist/icons/overlay_dark/button_L.png diff --git a/suyu/dist/icons/overlay/button_R_dark.png b/suyu/dist/icons/overlay_dark/button_R.png similarity index 100% rename from suyu/dist/icons/overlay/button_R_dark.png rename to suyu/dist/icons/overlay_dark/button_R.png diff --git a/suyu/dist/icons/overlay/button_X_dark.png b/suyu/dist/icons/overlay_dark/button_X.png similarity index 100% rename from suyu/dist/icons/overlay/button_X_dark.png rename to suyu/dist/icons/overlay_dark/button_X.png diff --git a/suyu/dist/icons/overlay/button_Y_dark.png b/suyu/dist/icons/overlay_dark/button_Y.png similarity index 100% rename from suyu/dist/icons/overlay/button_Y_dark.png rename to suyu/dist/icons/overlay_dark/button_Y.png diff --git a/suyu/dist/icons/overlay/button_minus_dark.png b/suyu/dist/icons/overlay_dark/button_minus.png similarity index 100% rename from suyu/dist/icons/overlay/button_minus_dark.png rename to suyu/dist/icons/overlay_dark/button_minus.png diff --git a/suyu/dist/icons/overlay/button_plus_dark.png b/suyu/dist/icons/overlay_dark/button_plus.png similarity index 100% rename from suyu/dist/icons/overlay/button_plus_dark.png rename to suyu/dist/icons/overlay_dark/button_plus.png diff --git a/suyu/dist/icons/overlay/button_press_stick_dark.png b/suyu/dist/icons/overlay_dark/button_press_stick.png similarity index 100% rename from suyu/dist/icons/overlay/button_press_stick_dark.png rename to suyu/dist/icons/overlay_dark/button_press_stick.png diff --git a/suyu/dist/icons/overlay/controller_dual_joycon_dark.png b/suyu/dist/icons/overlay_dark/controller_dual_joycon.png similarity index 100% rename from suyu/dist/icons/overlay/controller_dual_joycon_dark.png rename to suyu/dist/icons/overlay_dark/controller_dual_joycon.png diff --git a/suyu/dist/icons/overlay/controller_handheld_dark.png b/suyu/dist/icons/overlay_dark/controller_handheld.png similarity index 100% rename from suyu/dist/icons/overlay/controller_handheld_dark.png rename to suyu/dist/icons/overlay_dark/controller_handheld.png diff --git a/suyu/dist/icons/overlay/controller_pro_dark.png b/suyu/dist/icons/overlay_dark/controller_pro.png similarity index 100% rename from suyu/dist/icons/overlay/controller_pro_dark.png rename to suyu/dist/icons/overlay_dark/controller_pro.png diff --git a/suyu/dist/icons/overlay/controller_single_joycon_left_dark.png b/suyu/dist/icons/overlay_dark/controller_single_joycon_left.png similarity index 100% rename from suyu/dist/icons/overlay/controller_single_joycon_left_dark.png rename to suyu/dist/icons/overlay_dark/controller_single_joycon_left.png diff --git a/suyu/dist/icons/overlay/controller_single_joycon_left_a_dark.png b/suyu/dist/icons/overlay_dark/controller_single_joycon_left_a.png similarity index 100% rename from suyu/dist/icons/overlay/controller_single_joycon_left_a_dark.png rename to suyu/dist/icons/overlay_dark/controller_single_joycon_left_a.png diff --git a/suyu/dist/icons/overlay/controller_single_joycon_left_b_dark.png b/suyu/dist/icons/overlay_dark/controller_single_joycon_left_b.png similarity index 100% rename from suyu/dist/icons/overlay/controller_single_joycon_left_b_dark.png rename to suyu/dist/icons/overlay_dark/controller_single_joycon_left_b.png diff --git a/suyu/dist/icons/overlay/controller_single_joycon_left_x_dark.png b/suyu/dist/icons/overlay_dark/controller_single_joycon_left_x.png similarity index 100% rename from suyu/dist/icons/overlay/controller_single_joycon_left_x_dark.png rename to suyu/dist/icons/overlay_dark/controller_single_joycon_left_x.png diff --git a/suyu/dist/icons/overlay/controller_single_joycon_left_y_dark.png b/suyu/dist/icons/overlay_dark/controller_single_joycon_left_y.png similarity index 100% rename from suyu/dist/icons/overlay/controller_single_joycon_left_y_dark.png rename to suyu/dist/icons/overlay_dark/controller_single_joycon_left_y.png diff --git a/suyu/dist/icons/overlay/controller_single_joycon_right_dark.png b/suyu/dist/icons/overlay_dark/controller_single_joycon_right.png similarity index 100% rename from suyu/dist/icons/overlay/controller_single_joycon_right_dark.png rename to suyu/dist/icons/overlay_dark/controller_single_joycon_right.png diff --git a/suyu/dist/icons/overlay/osk_button_B_dark.png b/suyu/dist/icons/overlay_dark/osk_button_B.png similarity index 100% rename from suyu/dist/icons/overlay/osk_button_B_dark.png rename to suyu/dist/icons/overlay_dark/osk_button_B.png diff --git a/suyu/dist/icons/overlay/osk_button_B_dark_disabled.png b/suyu/dist/icons/overlay_dark/osk_button_B_disabled.png similarity index 100% rename from suyu/dist/icons/overlay/osk_button_B_dark_disabled.png rename to suyu/dist/icons/overlay_dark/osk_button_B_disabled.png diff --git a/suyu/dist/icons/overlay/osk_button_Y_dark.png b/suyu/dist/icons/overlay_dark/osk_button_Y.png similarity index 100% rename from suyu/dist/icons/overlay/osk_button_Y_dark.png rename to suyu/dist/icons/overlay_dark/osk_button_Y.png diff --git a/suyu/dist/icons/overlay/osk_button_Y_dark_disabled.png b/suyu/dist/icons/overlay_dark/osk_button_Y_disabled.png similarity index 100% rename from suyu/dist/icons/overlay/osk_button_Y_dark_disabled.png rename to suyu/dist/icons/overlay_dark/osk_button_Y_disabled.png diff --git a/suyu/dist/icons/overlay/osk_button_backspace_dark.png b/suyu/dist/icons/overlay_dark/osk_button_backspace.png similarity index 100% rename from suyu/dist/icons/overlay/osk_button_backspace_dark.png rename to suyu/dist/icons/overlay_dark/osk_button_backspace.png diff --git a/suyu/dist/icons/overlay/osk_button_plus_dark.png b/suyu/dist/icons/overlay_dark/osk_button_plus.png similarity index 100% rename from suyu/dist/icons/overlay/osk_button_plus_dark.png rename to suyu/dist/icons/overlay_dark/osk_button_plus.png diff --git a/suyu/dist/icons/overlay/osk_button_plus_dark_disabled.png b/suyu/dist/icons/overlay_dark/osk_button_plus_disabled.png similarity index 100% rename from suyu/dist/icons/overlay/osk_button_plus_dark_disabled.png rename to suyu/dist/icons/overlay_dark/osk_button_plus_disabled.png diff --git a/suyu/dist/icons/overlay/osk_button_shift_dark.png b/suyu/dist/icons/overlay_dark/osk_button_shift.png similarity index 100% rename from suyu/dist/icons/overlay/osk_button_shift_dark.png rename to suyu/dist/icons/overlay_dark/osk_button_shift.png diff --git a/suyu/dist/icons/overlay/osk_button_shift_on_dark.png b/suyu/dist/icons/overlay_dark/osk_button_shift_on.png similarity index 100% rename from suyu/dist/icons/overlay/osk_button_shift_on_dark.png rename to suyu/dist/icons/overlay_dark/osk_button_shift_on.png diff --git a/suyu/dist/qt_themes/colorful/icons/16x16/connected.png b/suyu/dist/qt_themes/colorful/icons/16x16/connected.png deleted file mode 100644 index 0afc18cb7a19028fd567a7ca7ced62cd164657de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 575 zcmV-F0>J%=P)0k{|sIn0V`B1xGGFnerg>I4!7^B>UM&p)aM9vQI<{ZJ4 z8HZ4p+_%{7AT1;1-`r}Q8XRRVYW9}G=D3HXRO!FFg z<>v6FfXkm66-$M=OnPPtTpl}lK!#o^J26y#00VLkV5Ig4hAIxCZ~AU@6mMaG2|$+zA&;BarDZyi@16B z4lE8kTwX8y!4LxB2>hW4yn!GbZg+WiA%P|k^Ip;o774}ts6fO6U&y7=hp3TO@-WL? z{^Mh)gLW3&bGqIiV!1gSPQ{V|zW{P&fJjHVbAtc? N002ovPDHLkV1hH82Xp`c diff --git a/suyu/dist/qt_themes/colorful/icons/16x16/connected_notification.png b/suyu/dist/qt_themes/colorful/icons/16x16/connected_notification.png deleted file mode 100644 index 72466e098e471ae5a97c49a56536dd4bf62b3a08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 760 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0*y&TK~y+Tl~Y|v z6j2oZ?(CguoZVz~OB-RWz#nLd9z^@Yo&q%@j2=qtp^PLV$cmEeAL_xE^2wfrs242~ zp$Ef$h%#S%kW`EcLR4x6ZEJVk8F%j7>CU(tNkRF+;a<+Y=R4my_gvyQ4zjp<{ql`; zI^D*(O+BwTbI<>_2MD8-wl5<%-+In!I@(0@^Fzo{bD*j!D3xKFhG&Lp!dzV1$6_(` z^gLuV6YIgUEb0c8*Ie*2x#lAhY;J={1gb21z6E0ugAZC@F^euEux;jDmV`UFz7l>- zK|xT%#N<56!g^D3Wwr@)QUY z@d)MRLDK?Qog0L{ZY_3>K0_%MP_m~6ird7|QOF|6#=1I$H9tA_=53H>6>z~YHTJ@7 zb_Nd4PV}Lux(a+|27GF2$(u@fs~(9UHZ*jca>r)zc$_}(It@ippva0SLlzB`5RY_2 zDJ%pZ9`=H=;M3EPtE-_V5`;>`*WTHAw^h71&5pJA_QIN1DX?Z|p%fSYQs6=ghhYg- zVhSf|d1>iW;`5ymOPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0v$<2K~y+Tl~PS> zQ$Z9x^WL<1ZG=jLsqtf@CIu;o=wGnd1VlHD;-XFKLZw(mq)@*>1VJ>!or+OVq^`wu znJxuC&?1zmaamnO1NME*%5JoAzwQ9hHiSzzQVT5*fC(vPaz_Kh*+6Kq5b=Zyr$6d-BjRvNsUN9r<)$o0v zs;137DRgyhL@Z{(G)=_g8<0qB!nUp3v1>;LeY^L_vp9U_(^UgFXW)W|)!HD0fHMwq z`Rc|0_8q`L@sq zk>1%G63fVBGANuFmY*(fDuPllKmS8eCS`Em`r?L1hp>O&UTLdSRsk4e>gLt9;4C;0 zLcq{BFQXMa*Fk%G45d;@#y$LM{=|d(5AnGC1hkF9bzQ?)OM&Zp`Y#clJ$)W#YAJ!{ z4H0nGY&P-w?HjzG{fJLxahf`;55)a!M*cR#Fvf$Tw4UQO#< z+13h9kDdH|_{gEo)RvScR^ra>BKrFe$hQ&GwNfR74B5P3+o;Y|898=5|6Tg*(O>)p iN=@~G{{?26=FLU_5=aXOVS_yY0000ROSwGo6XvJPv zzlZ+oGn97-o-r-r&$VfgJ0KmA>2yufc!z{~qGQbm$8Tq=^*@-iIzITdZ+^wR?aTAG zy=^&a8Kl52V{ys6@63-oYYcdPN9cVtn5|nNv)ozk?u}LA z|1=jF*xy&`&-?QyY@&mH_rsJ||S^eTg=tDnm{r-UW|<05{U diff --git a/suyu/dist/qt_themes/colorful/icons/256x256/plus_folder.png b/suyu/dist/qt_themes/colorful/icons/256x256/plus_folder.png deleted file mode 100644 index 760fe6245e72cd0144b4dd198465db6c902ad400..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4643 zcmb_gbySo=*PmsVuBBw@5*JZG8kAU+6osXvLz<->Xmko?yFzklBMy!V_r_nF_^GxyHSt@A{qwbZC7SSbJi)Eer_x&S~3pAbMsLSSZI zh4usn^S-U2Pe!08WVTU+Ik|_ru{QuT@P7mHcMvU009kxgjC}Om?S1?odf5Sge}7>o zH)n5~haPsq?p_WVTXL)b(B)_-E9nPhZq7I*vHu7p{e3YaertTIe`C$4Gzk^T-C~eN zZ^X_^eCe4H57{!5|3QY*`oN$CS57rwZF|pMn)1etP&-)Zi z!lS@oN*ZN{G{lUE+rFM_P88NnUku49_7F3ZfXWQmbKzRx+>|9SY#BC;r4|~x4GJrU z?r;;t9GXb6vx!uTj*!9S!wEYa4@zNI68wSOQ)2o~l(xB2YZpm?c7(tmI*HrA*+AEc zq8o2dnj;c(nN4I%w8iU&k7EK}OzrF1_o0dGB6l z`>{LsrOhE|HLyM<4?tMIpX@&T0()$=yotK{}47&W**RHsC z(Q$~lJ%|oZS%@a$yQKZ__Du6yY&q=B4ZJ+{dWJ zgU%lOkp>AE*qV3~jfTDy2BQUwaeseYV}8sGsHssL(!se84Gg&w51d3!Br_EuNgB}S z0q*dj!hGkIwW-d>XNcY>KsgV!#JKbYZt$XRip_U_S?@lrjRHt`MWM{w8Oc*5prxF2 zSHb-WB5$l%uc0>5u|fBJUS-vS>hn8k)L4z@ajD3nfS%>Ud#TdQ;NwKHJm6(*R`v=l zbGvbH+0`4;GItW)Kv!P(Mc>IAf;M$7kry}-5-1NUB{uxN+sz;b4PuS-R>lm?26$Fs|&y@T(re3O=0m+uTWmf(Q zG3H?g6DhIQmI^Tt-y~n+GZj+faV4F^5>p1xWFJQIE|oSN34JC}`P8mIMl>Tf#O)ka zCy6^`P^{qh{#L<;q3jm6AaWP3sE3xqM9jKg=8zkoi=u3nWHU{~v3hz?8R6u;oQews z&=>U*oEUxH7V_uvj=d#2DTTelEQM8wLg?Aw%NCpWiGbJ;ul+j`k4O8UU*jjaHjDB9>R%$2- zNO@awEnv%vb-;JbN?X{7%Z530{DeNBQ3OYNz~rf9E+YJTFzjBXV||r2`S%Oc` zOnuwq>!B1D8%3R(Ggr-w=34WZQ(H?hp@HzEqR6=9pR^JtTakg+1$1u$)G4Sd!w}LQzXW17=bK{fT&hvNP35uP@G^FeQ0{iICO`N9hk;YS`ruySW{&}}FTo12qoasOj* zuzg~I&rYqgUA#^Jn)ppLa0&mGgV7z%|WLs16JyV^u zpr;5{c69n9Yka2RL^1=Cg!aAIOysItrYtwxa~TMT{SC*)VSW{Mq*65J4dfc{tj;UG z&?R_E=SH`|!VuKA8eiy`TkCh;ThOr-BoD>Lp~1yb2!qZC2~GF3s9yO!&UERrnd>Bg z<>QDCO7($Cu%zPZj*q(vKoO}_v{tJ(%~DhTGxdyl!x3hJw&b|CgvN0R zg=pyVKk72F?C_748#84*%@ud8kN2Q&#I*KOY9snI39|1UXxS z6_BMBs3Z!#x;cE8fK56F^~3~txkp4Znwd!r-+eM(Xj{I&>oj3kTG`o-nt7?cV|5NxHADn(*D`ZXad33#?-!w!OsxJhp`h8>y=)EJ z8?ur;Bd>ndruRL6_x2r6#=s+!PtG}%9A~ey#u#K)XlgPcDE>(W_+I7gsm;nlf%tjb z$g6@UCmZeo7JI+^vsxQ7w)e_%)||cw{p11h8AKB)OaAIDW0Iv932nG^G=x$8DRdlFuhc3-=+m z6@s;pZo7crZ$2I~l8po+;65kP7L6aB3nMxUe3JXnqu-7o*bpg6lF380X!djD`pnms z^;zdHKWCcvOE`h;qLYN>k&U)9Q44MGSxrFAUWk0@WXAe_Wfp3d-R<+F?CUkkVh@2w zlvrccE*@vCQqC6d$fphCwqK9Ef>!(X10T?WiXNWwaG@UDIn9Pb176*=T%a8tjmGj_1&3`H6^^zpaXjTEmGuhh0OHLCK&eXlmeN<2lCL1KQ?l^ zaSt4P{ zpJr!Ck&3jTbkC!EBcrU9rtsp2`mA(;O`FHnTgl(|f>gQxZS&K`oT|eg@_R!k!m;S^ z;Luqx{teu+60%zsNX+br$HF7gj>|1Y{ASV zC$5JoHY57uv8w%aR;G#E7l(P~vgkzr6j}UDFnv+4xLS<7AD)MV^e2t5>Uk&=r)3G4 zRY-F+PWp*F84W6{~vL6A)#ITR}=Et-D*kth@K-IBv2rY3%0g^*~b zpTCq(_lC*Q&LflY_%4r)3qt?KGE`ksbsu*L9~9nR;H@CDj@xNSA|&Bj*1xP+IuW(E z<x#EX#~OTAMu=Cj?$vykYrlaVXyPP^X7+xZ%97v^?=}p9+X!&MLk?hWus52kG-h zG%WTbYO7wb;+kl%f_FqEJ?>m)%Z7GDOLcA!IPCmhPkdzI@4lTD?73(1jx9wb{@~f% zn<&E>IJE;I{c7RXiUED~&;)7lwgD|%Rz2)2Moel`qvEEzZ)yaK} z%M$h?hwsEfq=v6I+jKm~+ICE*^7rV^Eg-p%^zeu@-!+JR0(bFi;2x^vl-fBOTB%i&^J zL(HtCX!_r#amBrOLRQ2{5(*Ssp4N_9(UCX45s~L;;OS=4{N&qXsizJAJuhVRc~uS^ zPS#}%CIuCF?Hw17D>!{3Cp3!@fkJy2-m@K3SgkSc5&rB&4%Z+lAI+9YjnC`-$hjM! zu;jX%1^d9enLegkj+X2Av$$4HvS1l>l;UZxmLb)_w8%4_Dr~e!;r7@!T66X?TnL=%ci8!HVh8EkHYh=tQSN$+>Jp}J&FGB^2 z5Sk{b$}|VQ1EkBmQT?RLwnu+hn62uIs*9H@JL~PLdiwku+d)oD)jW<^ud)c!gj%8W zC?Z0FLZQYAd!7pFBKNDdjZ2Jpd}{TkKw}x9>t+;OQS>?2aT}GTOJc~`q7o2WQ-3WW zM)BS|hn(08)Im1s)tMP*1SiPHTutKKOhdk{aTJsfA$k9QI=+5E`z5UWL5!_pHQ|R2 N&`{A*F1u|N`hPMhH%|Zn diff --git a/suyu/dist/qt_themes/colorful/icons/48x48/bad_folder.png b/suyu/dist/qt_themes/colorful/icons/48x48/bad_folder.png deleted file mode 100644 index 34069c6b230de579d436fa9f0c21ae37af905b2e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 528 zcmV+r0`L8aP)D=(%e@MHK8fkB=Bj zAo71N_TM-+BcNWZW5yA1JUFhvNgbx+#t;a7*^hmf6*R3n7W%qhe}R$vr)HtS?Z$}H zG4o!X(_6sz@(}sdBcmf285ttS{PG$t1;D%q2XCGsu;Kn*4EJ`EV}rNOsB1G50Q+ud zk;W!zsIv`2?JeY3^jMW_j?@CSU7w3IHc5j`^%!idCC8%2D%f^^N-bd7vjgnAMv6H$ zRRc8@7^o_rcZ`lz$ux@g9a}{@0rQS^^6Ppp>nQlxOkH&kI3Aw3BuX6#@;?!z_y14T zWD@^HDbsuT!ZivN`yU9kwIux}`Y&I&S~39%P%Vo&wyKl@Ww{HS`zJUY4#@7Hv$NlKH@gFOfWh#;p`a7> zHS|=Xi|Jg_aj&Q#lU501AZa|+UAa*$TBPeBeF7jKv8Dk59qm|`?ej*L3uX^12YbBVuC(8l1+gV$k**_t@c>ZJWBZB=;`hL$Y!X2M?Al&7anv=x5Djc` zF{wX=?AZ&m9kLRimbq{p`;P&?xFf(F2AivLfXd3&7a92KYV;p~>3ie@1>}zj8+*Yu zi1xtn5y8a+fD4SCBnjp`f!P{6Z7!DRe2Uhd-S73pU@#lExS?7!1ks16+4{ U)=xYDaR2}S07*qoM6N<$f@LZ5LI3~& diff --git a/suyu/dist/qt_themes/colorful/icons/48x48/folder.png b/suyu/dist/qt_themes/colorful/icons/48x48/folder.png deleted file mode 100644 index 498de4c62940559bcfa3c609f7e7474ee8d86ae3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 460 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!hD1*n$B+!?x05z{F*}O5F27(eFndMoj+0rh z&40xH>tws))HAoNDb{TF1AmTbg1vvM{SK{ta!*3~yJ+!)lAVWV&RycPFhE13E=fG| z{;|wSu|F(+sy(|uFZrH++0<`EXXd#6OY88yk-96naQ3a=s-IZ*Mcjyg^Hped$L!qi z%Nu{^ytsFDZ`S68H$NYoZToJXVxeu_-lz9MzHG4Dnwk1|k- z)~iH;!ZoYKb0iMl`PS*vyLEB3S>J-KUs+~KW%p^nb}KG(nEz~9`TJGQDeI0eyQ*M+ z{q3idHxmD6Mc3=>-?Mj)jN*D=sBp1PxMbenmA6-}RqQ-41{geD{an^LB{Ts5V+X_j diff --git a/suyu/dist/qt_themes/colorful/icons/48x48/list-add.png b/suyu/dist/qt_themes/colorful/icons/48x48/list-add.png deleted file mode 100644 index 74e4882aaedc98b57cce65ae5c0a2683bab31279..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCils0(?ST_0ALmnd!^rR{<%ek|4j}{|ryJ8+ZYEoCO|{#S9F5he4R}c>anM zprE6ti(`m~_uJEkTnq|4&KIBkn;y0>KuJVP%j$`*d51w2Hv=64#i!@TrNPv7(8A5T-G@yGywoSu{iDk diff --git a/suyu/dist/qt_themes/colorful/icons/48x48/sd_card.png b/suyu/dist/qt_themes/colorful/icons/48x48/sd_card.png deleted file mode 100644 index 652d61bc325bb1aad05f0cf316a540539007db27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?31We{epSZZGe6rASi z;uw-~@9nLFybTIGtq-ro-Z`MmY&og?*g;+yH}?gKEOH;;pFMK;H`B`8MbXZ(*FWEC z*meGH_WK=KKQs&offQDYsv`dLmWMB|uJoCySmSNRH zXNIRALK~_ob_p;r)JrZ;FIPU6$&C&jo{= O&EVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGff&c&uf&sqz;-vrp1L;XbK~!i%?U~PS zOi>ia&v{dXiliH?Ea>m5YV=J@_#cF(BsMmFOT@16TZoX5NLUE55E8}4qVW$P%nb1( zn$EO{AYwr)%!F#a<9pxSl&Kl>?zm68m``)xJLk-u`|dgC{+d@RQ>ILKNUVOj#2Qy= zH543u4+o~h}$Yl66AKfZVTN z1_u%lf3?qEJG%pMtyv?S3^;TM*WBQU6Utn$o&iZTwvu=cA^zF6h|BG%2U@d&{S0_= z5ZC;HacHlWtYI|+602FVnIO`WGQ!~RNa5ZVg^L5`$5`c)UviOSjm9gt7)J}8Ennd_IIhAYjbzV_$ z-R3U(L9hBZLcElHUSGJ0}_t za#K6u#u;t;A6y91c|}nN6uuK}$z90DX>AG*=5ypGw*=|DB9H?LhAYw#E3y`AjA6H(U1-B9gn0&roO)bscV1CJA0u^I4ve`2%!{>TpAy09=b-!WT>Oda@r{HvE!H;BCkj^gxa@IHsz20kcfvGmtMh4a|N#xYyvOee95 zjyfs!k|(V=Id - - - - icons/index.theme - icons/16x16/checked.png - icons/16x16/connected.png - icons/16x16/connected_notification.png - icons/16x16/disconnected.png - icons/16x16/failed.png - icons/16x16/info.png - icons/16x16/lock.png - icons/16x16/sync.png - icons/16x16/view-refresh.png - icons/48x48/bad_folder.png - icons/48x48/chip.png - icons/48x48/folder.png - icons/48x48/list-add.png - icons/48x48/no_avatar.png - icons/48x48/sd_card.png - icons/48x48/star.png - icons/256x256/plus_folder.png - - - ../default/style.qss - - diff --git a/suyu/dist/qt_themes/colorful_dark/icons/index.theme b/suyu/dist/qt_themes/colorful_dark/icons/index.theme deleted file mode 100644 index b37a06df78..0000000000 --- a/suyu/dist/qt_themes/colorful_dark/icons/index.theme +++ /dev/null @@ -1,8 +0,0 @@ -[Icon Theme] -Name=colorful_dark -Comment=Colorful theme (Dark style) -Inherits=colorful -Directories=16x16 - -[16x16] -Size=16 diff --git a/suyu/dist/qt_themes/colorful_dark/style.qrc b/suyu/dist/qt_themes/colorful_dark/style.qrc deleted file mode 100644 index 72451ef023..0000000000 --- a/suyu/dist/qt_themes/colorful_dark/style.qrc +++ /dev/null @@ -1,57 +0,0 @@ - - - - - icons/index.theme - icons/16x16/lock.png - icons/16x16/view-refresh.png - - - - ../qdarkstyle/rc/up_arrow_disabled.png - ../qdarkstyle/rc/Hmovetoolbar.png - ../qdarkstyle/rc/stylesheet-branch-end.png - ../qdarkstyle/rc/branch_closed-on.png - ../qdarkstyle/rc/stylesheet-vline.png - ../qdarkstyle/rc/branch_closed.png - ../qdarkstyle/rc/branch_open-on.png - ../qdarkstyle/rc/transparent.png - ../qdarkstyle/rc/right_arrow_disabled.png - ../qdarkstyle/rc/sizegrip.png - ../qdarkstyle/rc/close.png - ../qdarkstyle/rc/close-hover.png - ../qdarkstyle/rc/close-pressed.png - ../qdarkstyle/rc/down_arrow.png - ../qdarkstyle/rc/Vmovetoolbar.png - ../qdarkstyle/rc/left_arrow.png - ../qdarkstyle/rc/stylesheet-branch-more.png - ../qdarkstyle/rc/up_arrow.png - ../qdarkstyle/rc/right_arrow.png - ../qdarkstyle/rc/left_arrow_disabled.png - ../qdarkstyle/rc/Hsepartoolbar.png - ../qdarkstyle/rc/branch_open.png - ../qdarkstyle/rc/Vsepartoolbar.png - ../qdarkstyle/rc/down_arrow_disabled.png - ../qdarkstyle/rc/undock.png - ../qdarkstyle/rc/checkbox_checked_disabled.png - ../qdarkstyle/rc/checkbox_checked_focus.png - ../qdarkstyle/rc/checkbox_checked.png - ../qdarkstyle/rc/checkbox_indeterminate.png - ../qdarkstyle/rc/checkbox_indeterminate_focus.png - ../qdarkstyle/rc/checkbox_unchecked_disabled.png - ../qdarkstyle/rc/checkbox_unchecked_focus.png - ../qdarkstyle/rc/checkbox_unchecked.png - ../qdarkstyle/rc/radio_checked_disabled.png - ../qdarkstyle/rc/radio_checked_focus.png - ../qdarkstyle/rc/radio_checked.png - ../qdarkstyle/rc/radio_unchecked_disabled.png - ../qdarkstyle/rc/radio_unchecked_focus.png - ../qdarkstyle/rc/radio_unchecked.png - - - ../qdarkstyle/style.qss - - diff --git a/suyu/dist/qt_themes/colorful_midnight_blue/icons/index.theme b/suyu/dist/qt_themes/colorful_midnight_blue/icons/index.theme deleted file mode 100644 index dcb2c50d68..0000000000 --- a/suyu/dist/qt_themes/colorful_midnight_blue/icons/index.theme +++ /dev/null @@ -1,8 +0,0 @@ -[Icon Theme] -Name=colorful_midnight_blue -Comment=Colorful theme (Midnight Blue style) -Inherits=colorful -Directories=16x16 - -[16x16] -Size=16 diff --git a/suyu/dist/qt_themes/colorful_midnight_blue/style.qrc b/suyu/dist/qt_themes/colorful_midnight_blue/style.qrc deleted file mode 100644 index b9821c6722..0000000000 --- a/suyu/dist/qt_themes/colorful_midnight_blue/style.qrc +++ /dev/null @@ -1,63 +0,0 @@ - - - - - icons/index.theme - ../colorful_dark/icons/16x16/lock.png - ../qdarkstyle/icons/16x16/view-refresh.png - ../colorful/icons/48x48/bad_folder.png - ../colorful/icons/48x48/chip.png - ../colorful/icons/48x48/folder.png - ../colorful/icons/48x48/list-add.png - ../colorful/icons/48x48/sd_card.png - ../colorful/icons/256x256/plus_folder.png - - - - ../qdarkstyle_midnight_blue/rc/up_arrow_disabled.png - ../qdarkstyle_midnight_blue/rc/Hmovetoolbar.png - ../qdarkstyle_midnight_blue/rc/stylesheet-branch-end.png - ../qdarkstyle_midnight_blue/rc/branch_closed-on.png - ../qdarkstyle_midnight_blue/rc/stylesheet-vline.png - ../qdarkstyle_midnight_blue/rc/branch_closed.png - ../qdarkstyle_midnight_blue/rc/branch_open-on.png - ../qdarkstyle_midnight_blue/rc/transparent.png - ../qdarkstyle_midnight_blue/rc/right_arrow_disabled.png - ../qdarkstyle_midnight_blue/rc/sizegrip.png - ../qdarkstyle_midnight_blue/rc/close.png - ../qdarkstyle_midnight_blue/rc/close-hover.png - ../qdarkstyle_midnight_blue/rc/close-pressed.png - ../qdarkstyle_midnight_blue/rc/down_arrow.png - ../qdarkstyle_midnight_blue/rc/Vmovetoolbar.png - ../qdarkstyle_midnight_blue/rc/left_arrow.png - ../qdarkstyle_midnight_blue/rc/stylesheet-branch-more.png - ../qdarkstyle_midnight_blue/rc/up_arrow.png - ../qdarkstyle_midnight_blue/rc/right_arrow.png - ../qdarkstyle_midnight_blue/rc/left_arrow_disabled.png - ../qdarkstyle_midnight_blue/rc/Hsepartoolbar.png - ../qdarkstyle_midnight_blue/rc/branch_open.png - ../qdarkstyle_midnight_blue/rc/Vsepartoolbar.png - ../qdarkstyle_midnight_blue/rc/down_arrow_disabled.png - ../qdarkstyle_midnight_blue/rc/undock.png - ../qdarkstyle_midnight_blue/rc/checkbox_checked_disabled.png - ../qdarkstyle_midnight_blue/rc/checkbox_checked_focus.png - ../qdarkstyle_midnight_blue/rc/checkbox_checked.png - ../qdarkstyle_midnight_blue/rc/checkbox_indeterminate.png - ../qdarkstyle_midnight_blue/rc/checkbox_indeterminate_focus.png - ../qdarkstyle_midnight_blue/rc/checkbox_unchecked_disabled.png - ../qdarkstyle_midnight_blue/rc/checkbox_unchecked_focus.png - ../qdarkstyle_midnight_blue/rc/checkbox_unchecked.png - ../qdarkstyle_midnight_blue/rc/radio_checked_disabled.png - ../qdarkstyle_midnight_blue/rc/radio_checked_focus.png - ../qdarkstyle_midnight_blue/rc/radio_checked.png - ../qdarkstyle_midnight_blue/rc/radio_unchecked_disabled.png - ../qdarkstyle_midnight_blue/rc/radio_unchecked_focus.png - ../qdarkstyle_midnight_blue/rc/radio_unchecked.png - - - ../qdarkstyle_midnight_blue/style.qss - - diff --git a/suyu/dist/qt_themes/default/default.qrc b/suyu/dist/qt_themes/default/default.qrc index 4522865b4c..125bc3f342 100644 --- a/suyu/dist/qt_themes/default/default.qrc +++ b/suyu/dist/qt_themes/default/default.qrc @@ -4,23 +4,37 @@ SPDX-License-Identifier: GPL-2.0-or-later --> + + + style.qss + + + - icons/index.theme icons/16x16/connected.png icons/16x16/connected_notification.png icons/16x16/disconnected.png + icons/16x16/failed.png + icons/16x16/info.png icons/16x16/lock.png + icons/16x16/sync.png + icons/16x16/view-refresh.png icons/48x48/bad_folder.png icons/48x48/chip.png icons/48x48/folder.png icons/48x48/list-add.png + icons/48x48/no_avatar.png icons/48x48/sd_card.png icons/48x48/star.png icons/256x256/plus_folder.png icons/256x256/suyu.png - - style.qss + + + + ../default_dark/icons/index.theme + ../default_dark/icons/16x16/lock.png + ../default_dark/icons/16x16/view-refresh.png diff --git a/suyu/dist/qt_themes/colorful/icons/16x16/checked.png b/suyu/dist/qt_themes/default/icons/16x16/checked.png similarity index 100% rename from suyu/dist/qt_themes/colorful/icons/16x16/checked.png rename to suyu/dist/qt_themes/default/icons/16x16/checked.png diff --git a/suyu/dist/qt_themes/colorful/icons/16x16/failed.png b/suyu/dist/qt_themes/default/icons/16x16/failed.png similarity index 100% rename from suyu/dist/qt_themes/colorful/icons/16x16/failed.png rename to suyu/dist/qt_themes/default/icons/16x16/failed.png diff --git a/suyu/dist/qt_themes/colorful/icons/16x16/info.png b/suyu/dist/qt_themes/default/icons/16x16/info.png similarity index 100% rename from suyu/dist/qt_themes/colorful/icons/16x16/info.png rename to suyu/dist/qt_themes/default/icons/16x16/info.png diff --git a/suyu/dist/qt_themes/default/icons/16x16/lock.png b/suyu/dist/qt_themes/default/icons/16x16/lock.png index 69d399050804cfa45e00850d4330a5b7cfaa3a43..fd27069d807e26186c8a610bdbcc0ce172562af6 100644 GIT binary patch delta 252 zcmVCM8whdf>JxsruFf zb%+Dm4u(=#M8SY-MmmKS9@Y;9X%jfGqAb^b6~Ghx2q9%=Km*jAY9sCn*is%8f}*QX0VKElhHfx<~wrlZ+Rp qB)y(^kp^-mi|Z;_>7Bed=iCQi-Z^EWi_{zd0000>Xmko?yFzklBMy!V_r_nF_^GxyHSt@A{qwbZC7SSbJi)Eer_x&S~3pAbMsLSSZI zh4usn^S-U2Pe!08WVTU+Ik|_ru{QuT@P7mHcMvU009kxgjC}Om?S1?odf5Sge}7>o zH)n5~haPsq?p_WVTXL)b(B)_-E9nPhZq7I*vHu7p{e3YaertTIe`C$4Gzk^T-C~eN zZ^X_^eCe4H57{!5|3QY*`oN$CS57rwZF|pMn)1etP&-)Zi z!lS@oN*ZN{G{lUE+rFM_P88NnUku49_7F3ZfXWQmbKzRx+>|9SY#BC;r4|~x4GJrU z?r;;t9GXb6vx!uTj*!9S!wEYa4@zNI68wSOQ)2o~l(xB2YZpm?c7(tmI*HrA*+AEc zq8o2dnj;c(nN4I%w8iU&k7EK}OzrF1_o0dGB6l z`>{LsrOhE|HLyM<4?tMIpX@&T0()$=yotK{}47&W**RHsC z(Q$~lJ%|oZS%@a$yQKZ__Du6yY&q=B4ZJ+{dWJ zgU%lOkp>AE*qV3~jfTDy2BQUwaeseYV}8sGsHssL(!se84Gg&w51d3!Br_EuNgB}S z0q*dj!hGkIwW-d>XNcY>KsgV!#JKbYZt$XRip_U_S?@lrjRHt`MWM{w8Oc*5prxF2 zSHb-WB5$l%uc0>5u|fBJUS-vS>hn8k)L4z@ajD3nfS%>Ud#TdQ;NwKHJm6(*R`v=l zbGvbH+0`4;GItW)Kv!P(Mc>IAf;M$7kry}-5-1NUB{uxN+sz;b4PuS-R>lm?26$Fs|&y@T(re3O=0m+uTWmf(Q zG3H?g6DhIQmI^Tt-y~n+GZj+faV4F^5>p1xWFJQIE|oSN34JC}`P8mIMl>Tf#O)ka zCy6^`P^{qh{#L<;q3jm6AaWP3sE3xqM9jKg=8zkoi=u3nWHU{~v3hz?8R6u;oQews z&=>U*oEUxH7V_uvj=d#2DTTelEQM8wLg?Aw%NCpWiGbJ;ul+j`k4O8UU*jjaHjDB9>R%$2- zNO@awEnv%vb-;JbN?X{7%Z530{DeNBQ3OYNz~rf9E+YJTFzjBXV||r2`S%Oc` zOnuwq>!B1D8%3R(Ggr-w=34WZQ(H?hp@HzEqR6=9pR^JtTakg+1$1u$)G4Sd!w}LQzXW17=bK{fT&hvNP35uP@G^FeQ0{iICO`N9hk;YS`ruySW{&}}FTo12qoasOj* zuzg~I&rYqgUA#^Jn)ppLa0&mGgV7z%|WLs16JyV^u zpr;5{c69n9Yka2RL^1=Cg!aAIOysItrYtwxa~TMT{SC*)VSW{Mq*65J4dfc{tj;UG z&?R_E=SH`|!VuKA8eiy`TkCh;ThOr-BoD>Lp~1yb2!qZC2~GF3s9yO!&UERrnd>Bg z<>QDCO7($Cu%zPZj*q(vKoO}_v{tJ(%~DhTGxdyl!x3hJw&b|CgvN0R zg=pyVKk72F?C_748#84*%@ud8kN2Q&#I*KOY9snI39|1UXxS z6_BMBs3Z!#x;cE8fK56F^~3~txkp4Znwd!r-+eM(Xj{I&>oj3kTG`o-nt7?cV|5NxHADn(*D`ZXad33#?-!w!OsxJhp`h8>y=)EJ z8?ur;Bd>ndruRL6_x2r6#=s+!PtG}%9A~ey#u#K)XlgPcDE>(W_+I7gsm;nlf%tjb z$g6@UCmZeo7JI+^vsxQ7w)e_%)||cw{p11h8AKB)OaAIDW0Iv932nG^G=x$8DRdlFuhc3-=+m z6@s;pZo7crZ$2I~l8po+;65kP7L6aB3nMxUe3JXnqu-7o*bpg6lF380X!djD`pnms z^;zdHKWCcvOE`h;qLYN>k&U)9Q44MGSxrFAUWk0@WXAe_Wfp3d-R<+F?CUkkVh@2w zlvrccE*@vCQqC6d$fphCwqK9Ef>!(X10T?WiXNWwaG@UDIn9Pb176*=T%a8tjmGj_1&3`H6^^zpaXjTEmGuhh0OHLCK&eXlmeN<2lCL1KQ?l^ zaSt4P{ zpJr!Ck&3jTbkC!EBcrU9rtsp2`mA(;O`FHnTgl(|f>gQxZS&K`oT|eg@_R!k!m;S^ z;Luqx{teu+60%zsNX+br$HF7gj>|1Y{ASV zC$5JoHY57uv8w%aR;G#E7l(P~vgkzr6j}UDFnv+4xLS<7AD)MV^e2t5>Uk&=r)3G4 zRY-F+PWp*F84W6{~vL6A)#ITR}=Et-D*kth@K-IBv2rY3%0g^*~b zpTCq(_lC*Q&LflY_%4r)3qt?KGE`ksbsu*L9~9nR;H@CDj@xNSA|&Bj*1xP+IuW(E z<x#EX#~OTAMu=Cj?$vykYrlaVXyPP^X7+xZ%97v^?=}p9+X!&MLk?hWus52kG-h zG%WTbYO7wb;+kl%f_FqEJ?>m)%Z7GDOLcA!IPCmhPkdzI@4lTD?73(1jx9wb{@~f% zn<&E>IJE;I{c7RXiUED~&;)7lwgD|%Rz2)2Moel`qvEEzZ)yaK} z%M$h?hwsEfq=v6I+jKm~+ICE*^7rV^Eg-p%^zeu@-!+JR0(bFi;2x^vl-fBOTB%i&^J zL(HtCX!_r#amBrOLRQ2{5(*Ssp4N_9(UCX45s~L;;OS=4{N&qXsizJAJuhVRc~uS^ zPS#}%CIuCF?Hw17D>!{3Cp3!@fkJy2-m@K3SgkSc5&rB&4%Z+lAI+9YjnC`-$hjM! zu;jX%1^d9enLegkj+X2Av$$4HvS1l>l;UZxmLb)_w8%4_Dr~e!;r7@!T66X?TnL=%ci8!HVh8EkHYh=tQSN$+>Jp}J&FGB^2 z5Sk{b$}|VQ1EkBmQT?RLwnu+hn62uIs*9H@JL~PLdiwku+d)oD)jW<^ud)c!gj%8W zC?Z0FLZQYAd!7pFBKNDdjZ2Jpd}{TkKw}x9>t+;OQS>?2aT}GTOJc~`q7o2WQ-3WW zM)BS|hn(08)Im1s)tMP*1SiPHTutKKOhdk{aTJsfA$k9QI=+5E`z5UWL5!_pHQ|R2 N&`{A*F1u|N`hPMhH%|Zn literal 1948 zcma)-eKZsLAIHD5nN5aU-9;WUY$P#{Ym?Uzu!5(^E>B#&inOwpZ8zye?IvXKW~)!Ms)xH zinPlk0077;LI47`YG2aBX8=%(Bzd?~Q{*$RpiC?YcqtZz=o>c=z5GXg`t?63-4fe! zbFgeWf%WwJvdQ=(-W<2)YQ8C{o& zg%KN&u{8KkWTW87Pi~m!JOZ~0vCs!|#E3H1>6G~+t=_=;aI0LIErC@esf7Lra1lT< zUL{8U2vAuo{Vtqwgu!s|aBrP{@QutN5^`F0_o6&8;gQ@@I?pWGjd-lrrD{pw+McyA z<{Ydy^Jk#r2UV2syE+EOj$OiLBbl@NQp?+UMdpXKjail`u+IF!iDa{DftUI1h+kZE z0GS_^&O^mf2*W1qiNGM7b_(}mY%2?y`xRqy99f!HVTYN)XAGU`*d|ya^VQ;K8|kM- z3jerlBsC(&R(~b-X`bGWviEq7Ot&ga$msHIAeU8&^~lmUa?B{)?D9VH$U6Glq-j0I zVG~O986~Y8NtT8=+mA}G-v6l5Xy=%v5EiO@dM;7SYKk|(E>9S;k=Kh^VA*K0504J-a*hl;+5T^(q55GJg8L zGrVw>)<4d=*HGgH&Kl3&7W3+0{OI$?Hl(;#17=+B&dzr*eq8Ocx&Cu7$Vloc3+V!b zP5W29IX^(D)6G2y-le$U*necf?0F{^?!L6QC%M~=`WTkR0F&k&tS2iKEB;v@=;>aU z-V+rDpKb4vQb{)wg-;N~kLg`4QvOemgBk}HJ|)X2qj0LNQ2wtP0Y>E&w! zprWFIzR*eh{r&s!Yj?tGiji5!4`ydL~0$sKS0scSF>V;8?|7YEM!LB`Z zmR?&w2CJplJim6mDjn2JvbJo64=~OI&6E3Cl|#V!5_WX9Vhaa7s!LFjwY@$Fl+UoH z!XufdDz`gmVpLBCenlBaSoUaK2;YacVe4EgDcFNDl4e|pph5F&ey*#OgNQ;e3okpi z4wTdlpm|Ewy7@s6ac7qW&7Q5pDlTwYt+!~HszTdNn=fl7+iVt9T5A~fapw5%(-^z@ z`jK-=F<0UZ9SfCUs4p-fZ=17S4zl3uEJTv&55+ds3MzUm`s!cN=rO8R;iUfWc$X<9 zsHeJb(GnUqf6lYkc$cu%veQrhJ|p)lL@?r(Hy^ASWmYcejvVWma3e}yRmhqczNHRO z{Qt4szjrOkIM=WYFDgk~|MV3Im{s>|PXL=!^J)zp*`=;MF@^q%nbPwfpN7S=&TLA! z8pY?XtLtm?407y*TQt>JhtO6}*dj29k5*mfg&F@?*%z~H2o=l8TDBV4$XGz}1A^vH zzEO3f|0uK+_ChkgZRnUc5Z^Bf11ISl0O5G96Z=%#_uHYp5KA)D=r+*I%`|aKfKlB{ zJVPF|PtDbeloVc9See_AZ0NV*!?2-@vmgV5Y)oyzM`0m??Zw;f;=2m$5-iYGG0_Ua4T1^8k)8-V#duMR9 zXIl;?XR=ymU5;TUze(1MNnXErYbC>*;oPc336Ad{ZFR^bC;vJVxp7IVgjGB}tzbzn z|4S0x3?Yj*F|neAqv$MK)#FI3Q>ci5<$JoYif+Gx6oLfX?61r1Xu?Ra9W4v{9TJU1 z7g$?YVl`fyh@!qiB4@4tI$$Khwz>EEyCjhGB-mC*$NZF^>vz)^DdIR-#gN}6ekRh2 zXW-4fceM7Yf2c})q?U2LpH}v@xm!)PT~#?UM8l2rg3XhB#r7I^Sa2I^bnl6af#l9= zSa97AF_~Graq9C%$({)7W-ABh(CV_(f)Stg4S(jqR|HN@)z*jx=9Dzo(vvF)-y8In zN;B_{gg0;}oOt89<$}b7@)%a%IE|*ryp<|@O!;-otCVvUqLYVTaL0Al{MS!3CGi%} Yh89WFHBF|yt6vw8JpDWxh~e3P1CC-@r2qf` diff --git a/suyu/dist/qt_themes/default/icons/48x48/bad_folder.png b/suyu/dist/qt_themes/default/icons/48x48/bad_folder.png index 364ec646f6f1c6b5b632fb68efd2602aa2c87f25..34069c6b230de579d436fa9f0c21ae37af905b2e 100644 GIT binary patch delta 503 zcmVMLN`2`L5i1E*bZ0xZA+EWiRRzyd75 z0+!u4eEZa7(PBUW_oJiOcj^3O-H(qLOCa)pFZSO!HzS~4t7FCya6CA!z)2mZY~eTSYnn^Nw}$ z>v}KiDEQb+U3CvQ9-g=)N*xLEKM|z&|4-Fq68}Xh(|h^CH3}8`9|*OzB>g7(FJHJ? tG64xtEsHs}s+0m{xeJ{8Cpa7q$popE`M?eo;{B1n&osBYyw^b5ch_0Itp)=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vG$ zaR2}!aRGnSI!pin1B6LLK~!i%?U_qx6G0fqceY8JQfje^v^`Z?C}^vKU~SWss8#7B zq7>^BQS_o%D&FixC}>dx@paXk2fb`ZDZ`N1#yeVg56zU<8GBU+9eIp#J@EUkFq1{j3pFdw?%DLe;9&1{xf4~HRFVJbWs4gO*0WZOnAGQDDfvngJ|B@|Er_CrMLvI&}KUPF63tDU+} zHu4pokB2E_rhtzd8%iVXf$ngJ|1ia3wJcx6(n_)N0)IwY>*smAo+q4f{9^0^#k5Ym ztsLbAOnAJ#=$_Rg1-yDZ&wETH%28TCcyq84L#s!mNifwNjkY#ciBu_Sk3cNek5?c3 zsWD#541F15Iv?a4d3h(WRF1L&A|d~3Ea>`)7%IQ{_+{Dc2QLu6iLc^a(T>K3c&rX3 z1zsWj3B_=;jZ8e^3rO;8hQYp#oK3eX^~iLVl1+rr`)T^lJu zs({Fr#zpu9r#Zfe>&A1#;Lj+IubP5$t@m?VuzyUXQpg>F3B3<}qC{lrP&}zm9v86` zt_ui<{7W%#_ltBIm~H4%;-W|$;0Ne4MB*CvM}X_6@#={usi5)06$6iY$_E~HqlmX+ zwH@rsPKnqx5?zS5ieMU;b{2<2fxY35rhVAXKES8oTAPSmy9)Xt1OR#6SL$==RR>Ov#XPMuh06U)WY3f(Jf3*aAUt?W0XXD{?frwy}FYEx@1Okp>)ccpBU+GsvjbfN_gL8l$FL3%p3 z7AA3;zv7H zv$NlKH@gFOfWh#;p`a7>HS|=Xi|Jg_aj&Q#lU501AZa|+UAa*$TBPeBeF7jKv8Dk5 ze;w^um+kXLmkVYMlpEEerQBx#g;3;qrw4ny->$UZmIbjTWRb2Te(?ZM&|~|G3*z^{ zq-+vF0qojdHgVK7zYq;~zqlj79R{1La)8Rp))yK0 z>T2{Kfa!bW0|n%d2^)LCHHh}W@Dahqe*=IEjGiP3<~)Jf8ar(+mgszn)}G`TEFb57 zrOHkr+06?jN9vE!)Eh{BA4vTZFb0xF)Cb}q+CH!X7z0To>I0Mk^tVg^WtNXe+6UHl z0>7F3WqnsRU-W+9EdCE@3Mha(U=39Kwt-~tF_(V@tbhe@rpPOZE8smK ze>p4rtoJlw(sS~Sy_Ung-iEwoLv)`?aNS?OM9DdRze{bt7Y*)v=M)A$(H#DiS)^wYk?h>bk0U9E8N#dFJ zk7Z7Z{bBJ_?b-c#$@lcjrhY3rGspE`T8H<(#ta z__C`C_SfHjI(Z}Ue^zw8&i*}n=g26o2Zjq5>x4_@{atx`@A(p6txs?A`x& zH+P$zDR?}dd{Y-5qcq?&j$$V^VkMm620jJ78Zm`e_>qz)*nf;QVHMxeR!9z)a0X9MeSdR~J!&X``4#E0ETKP|3pDHOwoRWba)+CxW{lhf5VzqmN=u#sSn&Z| z;{&+H2XKuK;2IymH9mlAd;r(@0IpF0t+klgR;^uQtEs2}_oa4>zVMhO2Et<$-76Q` z@eQMQ`;Vx#7cGgnMl~#>_8Fozs^&HfIKb$Wd2k=g^itz9+6HD()!K_OR?wVESyVL! z%ZfH8@e*w(W;ppv)}K?`k`@X>S1?**}8GQ4U;xaoziYw&aP9>#K6FCLDMcJ zMv;L*jPcAXhggPH51kpFeh6)-s@NsKz)&x_JiT1`SSCY{P>+xfP&EvkxzRcGd*aWf ccAs{iWzSA@?$SRO+zyiTboFyt=akR{02`=D;Q#;t delta 149 zcmaFDc#Ls^WqpOGi(^Q}y|>pL`5Fv3SR6k5uRo@K6Ysy;;tX-dvfr70TTlQgYD^lA8tm5GmKYK9DMB>XWemnD#Xmdutj3| x>TEw(y-SO~EY62-=%@ed%(4DlnH&a{XiVnHj+glfIxdw<{Dl&Kl>?zm68m``)x zJLk-u`|dgC{+d@RQ>ILKNUVOj#2Qy=H543u4+o~h}$Yl66AKfZVTN1_u%lf3?qEJG%pMtyv?S3^;TM*WBQU6Utn$ zo&iZTwvu=cA%FhawusB^sRvrKg8dA5auC=2fpKWBmaJhl0}`ukA$A@?EYz-GLc83N zR2i~@-3+j^UtP0GUKoGfTDF3<3`o4O3FGG}#9~1~7Gx=Rq*UF1#$pCUt@}aRW7M*? zFIdTd+^cDzNaPvBpaJoSxrN<+^__ph*a3+*&Bya=F@F$haL%bA;cA#&lm&i;;Jijj z;F$58JZBI+8HE1>9PN9b{WutT9gy42RWxmMAsSzZM)jRA#;F-)j;a$PBPcJBp*{ra zCAz4~kC)iVanB{k0g2ZigJmnCTcu4?3#MW8?Hosw<8vr?%vOyZMuj_Cn|cVvX)Jw2 zYd$#+aDUD75vq)IV#wUorm2I-Ey{db%`4u1)fS)pbKt?UY2;AG*=5ypGw*=|DB9H?LhAYw#E3y`AjA6H(U1-B9gn0&r zoPT;;ZFgQ#K_4S^S`Li41I&xHWS;Hp;0--D^p*T0lzP1k(b_t$Elx!bCsZtp)qj<*O-oPg=d**0_9}GA%|M|Xej&tVxXD-ZPc9DpYdjqf?NCHoQ zS21cCMHX-wW!zdW0rO_jS7;o=X+Bks&Z4hSNC5qKPoST8mu+NJV>djmi?yxVq@d|F zxlh#Z0}n*oUVp=yM)4l|)2;^^MB9g1a~FX1*o{sA`M^Tpr|4T}O4Q^MlFR22Fot>u z9tXt!6L^FDDIc=*9Tt6WXWU%?)?ha{2^3lS7XiOT%xV+Drk0Rg65YU%r9O;GC;Y}_ zglv!Y1wak3EF{lCQNQgHa|_sEsW$@OLh=s)&rlmfAb++2pYi^h29-ZRi3@Lu?#q<- z6RNkNi5e1&2_I@uEpq4@ujnh^_`3|fS^c&gka;sZN^$|~JHSj|z0HJWjM@5Z#Y5tIWjT|}m^rw8d` z7tUQKskO>|#$|+Dpv^^4=KATN8|MRQBj#;e9)A%(M&Ob;SLj_Pg-p`v98v$80Y?g7 z0=NT_$prR`dXyzJ<3~-?2XwECfY?wk1p9nqi-DcG6#K;W3C?;WPCd{i#9CcqvQR0n z_1iH9oYH*~t%9@5xND91I1fAWns6y9{r1Y`UjWO+n2jQ449JUP0(*qeC+rusb-;HY z^M9!_jD5RIpi&cSOkErk=oBLDx;+o*@Gv{5i(6j@(@(lx^mUpxpM$z4v5M3HYk?jQ zgAY;X*HZnrTTGAUs1fZ$WbjS!gWT>0ffk%wY7%vUbsYQhO6WFuxs}u$Eja&E#_msH z`nN7?ChGP?dx1(Ho=P3#Hdb=hnw&r}@Mz0JI909@?jw}1WBs@$2zTI53+Ft7r4Ob>lo6-L4Y};3R4rOrlcXJ3v_k&NARG(<%BeaDteBN6Q9Q0EGrQ3sIBtx~rYT d9Om%9;xE_n=@mA1l}`Ww002ovPDHLkV1gj%$m9S3 diff --git a/suyu/dist/qt_themes/default/icons/index.theme b/suyu/dist/qt_themes/default/icons/index.theme index 21b35e3e3c..6c455463ee 100644 --- a/suyu/dist/qt_themes/default/icons/index.theme +++ b/suyu/dist/qt_themes/default/icons/index.theme @@ -1,7 +1,6 @@ [Icon Theme] Name=default -Comment=default theme -Inherits=colorful +Comment=Colorful theme Directories=16x16,48x48,256x256 [16x16] @@ -9,6 +8,6 @@ Size=16 [48x48] Size=48 - + [256x256] Size=256 diff --git a/suyu/dist/qt_themes/default/style.qss b/suyu/dist/qt_themes/default/style.qss index 921950c6c0..16b779b1b8 100644 --- a/suyu/dist/qt_themes/default/style.qss +++ b/suyu/dist/qt_themes/default/style.qss @@ -1,3 +1,14 @@ +/* +* SPDX-FileCopyrightText: 2018 yuzu Emulator Project +* SPDX-FileCopyrightText: 2024 suyu Emulator Project +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +QWidget:item:hover { + background-color: #28668d; + color: #eff0f1; +} + QAbstractSpinBox { min-height: 19px; } @@ -11,7 +22,7 @@ QPushButton#TogglableStatusBarButton { } QPushButton#TogglableStatusBarButton:checked { - color: #000000; + color: palette(text); } QPushButton#TogglableStatusBarButton:hover { @@ -38,6 +49,10 @@ QPushButton#RendererStatusBarButton:!checked { color: #0066ff; } +QPushButton#RendererStatusBarButton:!checked[dark=true] { + color: #00ccdd; +} + QPushButton#GPUStatusBarButton { color: #656565; border: 1px solid transparent; @@ -54,13 +69,21 @@ QPushButton#GPUStatusBarButton:checked { color: #b06020; } +QPushButton#GPUStatusBarButton:checked[dark=true] { + color: #ff8040; +} + QPushButton#GPUStatusBarButton:!checked { color: #109010; } +QPushButton#GPUStatusBarButton:!checked[dark=true] { + color: #40dd40; +} + QPushButton#DockingStatusBarButton { min-width: 0px; - color: #000000; + color: palette(text); border: 1px solid transparent; background-color: transparent; padding: 0px 3px 0px 3px; @@ -94,21 +117,21 @@ QGroupBox#groupPlayer5Connected:checked, QGroupBox#groupPlayer6Connected:checked, QGroupBox#groupPlayer7Connected:checked, QGroupBox#groupPlayer8Connected:checked { - background-color: #f5f5f5; + background-color: palette(window); } QWidget#topControllerApplet { - border-bottom: 1px solid #828790 + border-bottom: 1px solid palette(dark) } QWidget#bottomPerGameInput, QWidget#bottomControllerApplet { - border-top: 1px solid #828790 + border-top: 1px solid palette(dark) } QWidget#topPerGameInput, QWidget#middleControllerApplet { - background-color: #fff; + background-color: palette(base) } QWidget#topPerGameInput QComboBox, @@ -120,10 +143,6 @@ QWidget#connectedControllers { background: transparent; } -QWidget#closeButtons { - background: transparent; -} - QWidget#playersSupported, QWidget#controllersSupported, QWidget#controllerSupported1, @@ -345,7 +364,7 @@ QWidget#lineDialog { QStackedWidget#bottomOSK, QWidget#contentDialog, QWidget#contentRichDialog { - background: rgba(240, 240, 240, 1); + background: palette(base); } QWidget#contentDialog, @@ -372,7 +391,7 @@ QStackedWidget#stackedDialog QTextBrowser QScrollBar::vertical { border-radius: 4px; } -QStackedWidget#stackedDialog QTextBrowser QScrollBar::horizoncal { +QStackedWidget#stackedDialog QTextBrowser QScrollBar::horizontal { background: #cdcdcd; height: 15px; margin: 3px 15px 3px 15px; @@ -402,6 +421,7 @@ QWidget#inputOSK QLineEdit { background: transparent; border: none; color: #ccc; + padding: 0px; } QWidget#inputBoxOSK { @@ -431,6 +451,27 @@ QWidget#boxOSK QLabel#label_characters_box { color: #ccc; } +QWidget#buttonsDialog, +QWidget#buttonsRichDialog, +QWidget#mainOSK, +QWidget#headerOSK, +QWidget#normalOSK, +QWidget#shiftOSK, +QWidget#numOSK, +QWidget#subOSK, +QWidget#inputOSK, +QWidget#inputBoxOSK, +QWidget#charactersOSK, +QWidget#charactersBoxOSK, +QWidget#legendOSK, +QWidget#legendOSK QWidget, +QWidget#legendOSKshift, +QWidget#legendOSKshift QWidget, +QWidget#legendOSKnum, +QWidget#legendOSKnum QWidget { + background: transparent; +} + QWidget#contentDialog QLabel#label_title, QWidget#contentRichDialog QLabel#label_title_rich { color: #888; @@ -471,8 +512,8 @@ QDialog#OverlayDialog QPushButton:pressed { } QDialog#QtSoftwareKeyboardDialog QPushButton { - background: rgba(232, 232, 232, 1); - border: 2px solid rgba(240, 240, 240, 1); + background: palette(window); + border: 2px solid palette(base); } QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift, @@ -481,27 +522,35 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift, QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift, QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { - background: rgba(218, 218, 218, 1); - border: 2px solid rgba(240, 240, 240, 1); + background: palette(alternate-base); + border: 2px solid palette(base); } QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { - color: rgba(240, 240, 240, 1); - background: rgba(44, 44, 44, 1); - border: 2px solid rgba(240, 240, 240, 1); + color: palette(base); + background: palette(mid); + border: 2px solid palette(base); } QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { - color: rgba(240, 240, 240, 1); - background: rgba(49, 79, 239, 1); - border: 2px solid rgba(240, 240, 240, 1); + color: palette(base); + background: palette(highlight); + border: 2px solid palette(base); } QDialog#QtSoftwareKeyboardDialog QPushButton:focus, +QDialog#QtSoftwareKeyboardDialog QPushButton:hover +{ + background: palette(base); + border: 5px solid rgba(148, 250, 202, 1); + border-radius: 6px; + outline: none; +} + QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:focus, QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift:focus, QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:focus, @@ -514,8 +563,6 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift:focus, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:focus, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:focus, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:focus, - -QDialog#QtSoftwareKeyboardDialog QPushButton:hover, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:hover, QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift:hover, QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:hover, @@ -524,12 +571,11 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:hover, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:hover, QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift:hover, QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift:hover, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:hover, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:hover { - color: rgba(0, 0, 0, 1); - background: rgba(255, 255, 255, 1); +QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift:hover, +QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:hover +{ border: 5px solid rgba(148, 250, 202, 1); border-radius: 6px; outline: none; @@ -548,48 +594,12 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift:pressed, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:pressed, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:pressed, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:pressed { - color: rgba(240, 240, 240, 1); + color: palette(base); background: rgba(150, 150, 150, 1); border: 5px solid rgba(148, 250, 202, 1); border-radius: 6px; } -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { - image: url(:/overlay/osk_button_B.png); - image-position: right; - qproperty-icon: url(:/overlay/osk_button_backspace.png); - qproperty-iconSize: 36px; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { - image: url(:/overlay/osk_button_Y.png); - image-position: right; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { - image: url(:/overlay/osk_button_plus.png); - image-position: right; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { - image: url(:/overlay/osk_button_shift_lock_off.png); - image-position: left; - qproperty-icon: url(:/overlay/osk_button_shift.png); - qproperty-iconSize: 36px; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { - image: url(:/overlay/osk_button_shift_lock_off.png); - image-position: left; - qproperty-icon: url(:/overlay/osk_button_shift_on.png); - qproperty-iconSize: 36px; -} - QDialog#QtSoftwareKeyboardDialog QPushButton#button_left_bracket, QDialog#QtSoftwareKeyboardDialog QPushButton#button_right_bracket, QDialog#QtSoftwareKeyboardDialog QPushButton#button_left_parenthesis, @@ -602,47 +612,6 @@ QDialog#QtSoftwareKeyboardDialog QWidget#titleOSK QLabel { color: #ccc; } -QDialog#QtSoftwareKeyboardDialog QWidget#button_L, -QDialog#QtSoftwareKeyboardDialog QWidget#button_L_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_L_num { - image: url(:/overlay/button_L.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left_num { - image: url(:/overlay/arrow_left.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_R, -QDialog#QtSoftwareKeyboardDialog QWidget#button_R_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_R_num { - image: url(:/overlay/button_R.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right_num { - image: url(:/overlay/arrow_right.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_press_stick, -QDialog#QtSoftwareKeyboardDialog QWidget#button_press_stick_shift { - image: url(:/overlay/button_press_stick.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_X, -QDialog#QtSoftwareKeyboardDialog QWidget#button_X_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_X_num { - image: url(:/overlay/button_X.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_A, -QDialog#QtSoftwareKeyboardDialog QWidget#button_A_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_A_num { - image: url(:/overlay/button_A.png); -} - QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled, @@ -653,8 +622,8 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { - color: rgba(164, 164, 164, 1); - background-color: rgba(218, 218, 218, 1); + color: palette(midlight); + background-color: palette(alternate-base); } QDialog#QtSoftwareKeyboardDialog QPushButton#button_at:disabled, @@ -671,22 +640,5 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_8:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_9:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_0:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled { - color: rgba(164, 164, 164, 1); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { - image: url(:/overlay/osk_button_plus_disabled.png); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { - image: url(:/overlay/osk_button_B_disabled.png); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { - image: url(:/overlay/osk_button_Y_disabled.png); + color: palette(midlight); } diff --git a/suyu/dist/qt_themes/colorful_dark/icons/16x16/lock.png b/suyu/dist/qt_themes/default_dark/icons/16x16/lock.png similarity index 100% rename from suyu/dist/qt_themes/colorful_dark/icons/16x16/lock.png rename to suyu/dist/qt_themes/default_dark/icons/16x16/lock.png diff --git a/suyu/dist/qt_themes/colorful_dark/icons/16x16/view-refresh.png b/suyu/dist/qt_themes/default_dark/icons/16x16/view-refresh.png similarity index 100% rename from suyu/dist/qt_themes/colorful_dark/icons/16x16/view-refresh.png rename to suyu/dist/qt_themes/default_dark/icons/16x16/view-refresh.png diff --git a/suyu/dist/qt_themes/default_dark/icons/index.theme b/suyu/dist/qt_themes/default_dark/icons/index.theme index 60a072d1d6..32d84fa9bd 100644 --- a/suyu/dist/qt_themes/default_dark/icons/index.theme +++ b/suyu/dist/qt_themes/default_dark/icons/index.theme @@ -1,7 +1,7 @@ [Icon Theme] Name=default_dark Comment=Colorful theme (Dark style) -Inherits=colorful +Inherits=default Directories=16x16 [16x16] diff --git a/suyu/dist/qt_themes/default_dark/style.qrc b/suyu/dist/qt_themes/default_dark/style.qrc deleted file mode 100644 index 7de4737c2c..0000000000 --- a/suyu/dist/qt_themes/default_dark/style.qrc +++ /dev/null @@ -1,25 +0,0 @@ - - - - ../colorful/icons/16x16/connected.png - ../colorful/icons/16x16/connected_notification.png - ../colorful/icons/16x16/disconnected.png - icons/index.theme - ../colorful_dark/icons/16x16/lock.png - ../colorful_dark/icons/16x16/view-refresh.png - ../colorful/icons/48x48/bad_folder.png - ../colorful/icons/48x48/chip.png - ../colorful/icons/48x48/folder.png - ../qdarkstyle/icons/48x48/no_avatar.png - ../colorful/icons/48x48/list-add.png - ../colorful/icons/48x48/sd_card.png - ../colorful/icons/256x256/plus_folder.png - - - - style.qss - - diff --git a/suyu/dist/qt_themes/default_dark/style.qss b/suyu/dist/qt_themes/default_dark/style.qss deleted file mode 100644 index ca6daa2d52..0000000000 --- a/suyu/dist/qt_themes/default_dark/style.qss +++ /dev/null @@ -1,687 +0,0 @@ -/* -* SPDX-FileCopyrightText: 2018 yuzu Emulator Project -* SPDX-License-Identifier: GPL-2.0-or-later -*/ -QAbstractSpinBox { - min-height: 19px; -} - -QPushButton#TogglableStatusBarButton { - color: #959595; - border: 1px solid transparent; - background-color: transparent; - padding: 0px 3px 0px 3px; - text-align: center; -} - -QPushButton#TogglableStatusBarButton:checked { - color: palette(text); -} - -QPushButton#TogglableStatusBarButton:hover { - border: 1px solid #76797C; -} - -QPushButton#RendererStatusBarButton { - color: #656565; - border: 1px solid transparent; - background-color: transparent; - padding: 0px 3px 0px 3px; - text-align: center; -} - -QPushButton#RendererStatusBarButton:hover { - border: 1px solid #76797C; -} - -QPushButton#RendererStatusBarButton:checked { - color: #e85c00; -} - -QPushButton#RendererStatusBarButton:!checked { - color: #00ccdd; -} - -QPushButton#GPUStatusBarButton { - color: #656565; - border: 1px solid transparent; - background-color: transparent; - padding: 0px 3px 0px 3px; - text-align: center; -} - -QPushButton#GPUStatusBarButton:hover { - border: 1px solid #76797C; -} - -QPushButton#GPUStatusBarButton:checked { - color: #ff8040; -} - -QPushButton#GPUStatusBarButton:!checked { - color: #40dd40; -} - -QPushButton#DockingStatusBarButton { - min-width: 0px; - color: palette(text); - border: 1px solid transparent; - background-color: transparent; - padding: 0px 3px 0px 3px; - text-align: center; -} - -QPushButton#DockingStatusBarButton:hover { - border: 1px solid #76797C; -} - -QPushButton#buttonRefreshDevices { - min-width: 21px; - min-height: 21px; - max-width: 21px; - max-height: 21px; -} - -QWidget#bottomPerGameInput, -QWidget#topControllerApplet, -QWidget#bottomControllerApplet, -QGroupBox#groupPlayer1Connected:checked, -QGroupBox#groupPlayer2Connected:checked, -QGroupBox#groupPlayer3Connected:checked, -QGroupBox#groupPlayer4Connected:checked, -QGroupBox#groupPlayer5Connected:checked, -QGroupBox#groupPlayer6Connected:checked, -QGroupBox#groupPlayer7Connected:checked, -QGroupBox#groupPlayer8Connected:checked { - background-color: #f5f5f5; -} - -QWidget#topControllerApplet { - border-bottom: 1px solid #828790 -} - -QWidget#bottomPerGameInput, -QWidget#bottomControllerApplet { - border-top: 1px solid #828790 -} - -QWidget#topPerGameInput, -QWidget#middleControllerApplet { - background-color: #fff; -} - -QWidget#topPerGameInput QComboBox, -QWidget#middleControllerApplet QComboBox { - width: 120px; -} - -QWidget#connectedControllers { - background: transparent; -} - -QWidget#playersSupported, -QWidget#controllersSupported, -QWidget#controllerSupported1, -QWidget#controllerSupported2, -QWidget#controllerSupported3, -QWidget#controllerSupported4, -QWidget#controllerSupported5, -QWidget#controllerSupported6 { - border: none; - background: transparent; -} - -QGroupBox#groupPlayer1Connected, -QGroupBox#groupPlayer2Connected, -QGroupBox#groupPlayer3Connected, -QGroupBox#groupPlayer4Connected, -QGroupBox#groupPlayer5Connected, -QGroupBox#groupPlayer6Connected, -QGroupBox#groupPlayer7Connected, -QGroupBox#groupPlayer8Connected { - border: 1px solid #828790; - border-radius: 3px; - padding: 0px; - min-height: 98px; - max-height: 98px; -} - -QGroupBox#groupPlayer1Connected:unchecked, -QGroupBox#groupPlayer2Connected:unchecked, -QGroupBox#groupPlayer3Connected:unchecked, -QGroupBox#groupPlayer4Connected:unchecked, -QGroupBox#groupPlayer5Connected:unchecked, -QGroupBox#groupPlayer6Connected:unchecked, -QGroupBox#groupPlayer7Connected:unchecked, -QGroupBox#groupPlayer8Connected:unchecked { - border: 1px solid #d9d9d9; -} - -QGroupBox#groupPlayer1Connected::title, -QGroupBox#groupPlayer2Connected::title, -QGroupBox#groupPlayer3Connected::title, -QGroupBox#groupPlayer4Connected::title, -QGroupBox#groupPlayer5Connected::title, -QGroupBox#groupPlayer6Connected::title, -QGroupBox#groupPlayer7Connected::title, -QGroupBox#groupPlayer8Connected::title { - subcontrol-origin: margin; - subcontrol-position: top left; - padding-left: 0px; - padding-right: 0px; - padding-top: 1px; - margin-left: 0px; - margin-right: -4px; - margin-bottom: 4px; -} - -QCheckBox#checkboxPlayer1Connected, -QCheckBox#checkboxPlayer2Connected, -QCheckBox#checkboxPlayer3Connected, -QCheckBox#checkboxPlayer4Connected, -QCheckBox#checkboxPlayer5Connected, -QCheckBox#checkboxPlayer6Connected, -QCheckBox#checkboxPlayer7Connected, -QCheckBox#checkboxPlayer8Connected { - spacing: 0px; -} - -QWidget#Player1LEDs QCheckBox, -QWidget#Player2LEDs QCheckBox, -QWidget#Player3LEDs QCheckBox, -QWidget#Player4LEDs QCheckBox, -QWidget#Player5LEDs QCheckBox, -QWidget#Player6LEDs QCheckBox, -QWidget#Player7LEDs QCheckBox, -QWidget#Player8LEDs QCheckBox { - spacing: 0px; -} - -QWidget#Player1LEDs QCheckBox::indicator, -QWidget#Player2LEDs QCheckBox::indicator, -QWidget#Player3LEDs QCheckBox::indicator, -QWidget#Player4LEDs QCheckBox::indicator, -QWidget#Player5LEDs QCheckBox::indicator, -QWidget#Player6LEDs QCheckBox::indicator, -QWidget#Player7LEDs QCheckBox::indicator, -QWidget#Player8LEDs QCheckBox::indicator { - width: 6px; - height: 6px; - margin-left: 0px; -} - -QWidget#bottomPerGameInput QCheckBox#checkboxPlayer1Connected::indicator, -QWidget#bottomPerGameInput QCheckBox#checkboxPlayer2Connected::indicator, -QWidget#bottomPerGameInput QCheckBox#checkboxPlayer3Connected::indicator, -QWidget#bottomPerGameInput QCheckBox#checkboxPlayer4Connected::indicator, -QWidget#bottomPerGameInput QCheckBox#checkboxPlayer5Connected::indicator, -QWidget#bottomPerGameInput QCheckBox#checkboxPlayer6Connected::indicator, -QWidget#bottomPerGameInput QCheckBox#checkboxPlayer7Connected::indicator, -QWidget#bottomPerGameInput QCheckBox#checkboxPlayer8Connected::indicator { - width: 12px; - height: 12px; -} - -QCheckBox#checkboxPlayer1Connected::indicator, -QCheckBox#checkboxPlayer2Connected::indicator, -QCheckBox#checkboxPlayer3Connected::indicator, -QCheckBox#checkboxPlayer4Connected::indicator, -QCheckBox#checkboxPlayer5Connected::indicator, -QCheckBox#checkboxPlayer6Connected::indicator, -QCheckBox#checkboxPlayer7Connected::indicator, -QCheckBox#checkboxPlayer8Connected::indicator { - width: 14px; - height: 14px; -} - -QGroupBox#groupPlayer1Connected::indicator, -QGroupBox#groupPlayer2Connected::indicator, -QGroupBox#groupPlayer3Connected::indicator, -QGroupBox#groupPlayer4Connected::indicator, -QGroupBox#groupPlayer5Connected::indicator, -QGroupBox#groupPlayer6Connected::indicator, -QGroupBox#groupPlayer7Connected::indicator, -QGroupBox#groupPlayer8Connected::indicator { - width: 16px; - height: 16px; -} - -QWidget#Player1LEDs QCheckBox::indicator:checked, -QWidget#Player2LEDs QCheckBox::indicator:checked, -QWidget#Player3LEDs QCheckBox::indicator:checked, -QWidget#Player4LEDs QCheckBox::indicator:checked, -QWidget#Player5LEDs QCheckBox::indicator:checked, -QWidget#Player6LEDs QCheckBox::indicator:checked, -QWidget#Player7LEDs QCheckBox::indicator:checked, -QWidget#Player8LEDs QCheckBox::indicator:checked, -QGroupBox#groupPlayer1Connected::indicator:checked, -QGroupBox#groupPlayer2Connected::indicator:checked, -QGroupBox#groupPlayer3Connected::indicator:checked, -QGroupBox#groupPlayer4Connected::indicator:checked, -QGroupBox#groupPlayer5Connected::indicator:checked, -QGroupBox#groupPlayer6Connected::indicator:checked, -QGroupBox#groupPlayer7Connected::indicator:checked, -QGroupBox#groupPlayer8Connected::indicator:checked, -QCheckBox#checkboxPlayer1Connected::indicator:checked, -QCheckBox#checkboxPlayer2Connected::indicator:checked, -QCheckBox#checkboxPlayer3Connected::indicator:checked, -QCheckBox#checkboxPlayer4Connected::indicator:checked, -QCheckBox#checkboxPlayer5Connected::indicator:checked, -QCheckBox#checkboxPlayer6Connected::indicator:checked, -QCheckBox#checkboxPlayer7Connected::indicator:checked, -QCheckBox#checkboxPlayer8Connected::indicator:checked, -QGroupBox#groupConnectedController::indicator:checked { - border-radius: 2px; - border: 1px solid #929192; - background: #39ff14; - image: none; -} - -QWidget#Player1LEDs QCheckBox::indicator:unchecked, -QWidget#Player2LEDs QCheckBox::indicator:unchecked, -QWidget#Player3LEDs QCheckBox::indicator:unchecked, -QWidget#Player4LEDs QCheckBox::indicator:unchecked, -QWidget#Player5LEDs QCheckBox::indicator:unchecked, -QWidget#Player6LEDs QCheckBox::indicator:unchecked, -QWidget#Player7LEDs QCheckBox::indicator:unchecked, -QWidget#Player8LEDs QCheckBox::indicator:unchecked, -QGroupBox#groupPlayer1Connected::indicator:unchecked, -QGroupBox#groupPlayer2Connected::indicator:unchecked, -QGroupBox#groupPlayer3Connected::indicator:unchecked, -QGroupBox#groupPlayer4Connected::indicator:unchecked, -QGroupBox#groupPlayer5Connected::indicator:unchecked, -QGroupBox#groupPlayer6Connected::indicator:unchecked, -QGroupBox#groupPlayer7Connected::indicator:unchecked, -QGroupBox#groupPlayer8Connected::indicator:unchecked, -QCheckBox#checkboxPlayer1Connected::indicator:unchecked, -QCheckBox#checkboxPlayer2Connected::indicator:unchecked, -QCheckBox#checkboxPlayer3Connected::indicator:unchecked, -QCheckBox#checkboxPlayer4Connected::indicator:unchecked, -QCheckBox#checkboxPlayer5Connected::indicator:unchecked, -QCheckBox#checkboxPlayer6Connected::indicator:unchecked, -QCheckBox#checkboxPlayer7Connected::indicator:unchecked, -QCheckBox#checkboxPlayer8Connected::indicator:unchecked, -QGroupBox#groupConnectedController::indicator:unchecked { - border-radius: 2px; - border: 1px solid #929192; - background: transparent; - image: none; -} - -QWidget#controllerPlayer1, -QWidget#controllerPlayer2, -QWidget#controllerPlayer3, -QWidget#controllerPlayer4, -QWidget#controllerPlayer5, -QWidget#controllerPlayer6, -QWidget#controllerPlayer7, -QWidget#controllerPlayer8 { - background: transparent; -} - -QDialog#QtSoftwareKeyboardDialog, -QStackedWidget#topOSK { - background: rgba(51, 51, 51, .9); -} - - -QDialog#OverlayDialog, -QStackedWidget#stackedDialog { - background: rgba(51, 51, 51, .7); -} - -QWidget#boxOSK, -QWidget#lineOSK, -QWidget#richDialog, -QWidget#lineDialog { - background: transparent; -} - -QStackedWidget#bottomOSK, -QWidget#contentDialog, -QWidget#contentRichDialog { - background: rgba(240, 240, 240, 1); -} - -QWidget#contentDialog, -QWidget#contentRichDialog { - margin: 5px; - border-radius: 6px; -} - -QWidget#buttonsDialog, -QWidget#buttonsRichDialog { - margin: 5px; - border-top: 2px solid rgba(44, 44, 44, 1); -} - -QWidget#legendOSKnum { - border-top: 1px solid rgba(44, 44, 44, 1); -} - -QStackedWidget#stackedDialog QTextBrowser QScrollBar::vertical { - background: #cdcdcd; - width: 15px; - margin: 15px 3px 15px 3px; - border: 1px transparent; - border-radius: 4px; -} - -QStackedWidget#stackedDialog QTextBrowser QScrollBar::horizoncal { - background: #cdcdcd; - height: 15px; - margin: 3px 15px 3px 15px; - border: 1px transparent; - border-radius: 4px; -} - -QStackedWidget#stackedDialog QTextBrowser QScrollBar::handle { - background: #fff; - border-radius: 4px; - min-height: 5px; - min-width: 5px; -} - -QStackedWidget#stackedDialog QTextBrowser QScrollBar::add-line, -QStackedWidget#stackedDialog QTextBrowser QScrollBar::sub-line, -QStackedWidget#stackedDialog QTextBrowser QScrollBar::add-page, -QStackedWidget#stackedDialog QTextBrowser QScrollBar::sub-page { - background: none; -} - -QWidget#inputOSK { - border-bottom: 3px solid rgba(255, 255, 255, .9); -} - -QWidget#inputOSK QLineEdit { - background: transparent; - border: none; - color: #ccc; -} - -QWidget#inputBoxOSK { - border: 2px solid rgba(255, 255, 255, .9); -} - -QWidget#inputBoxOSK QTextEdit { - background: transparent; - border: none; - color: #ccc; -} - -QWidget#richDialog QTextBrowser { - background: transparent; - border: none; - padding: 35px 65px; -} - - -QWidget#lineOSK QLabel#label_header { - color: #f0f0f0; -} - -QWidget#lineOSK QLabel#label_sub, -QWidget#lineOSK QLabel#label_characters, -QWidget#boxOSK QLabel#label_characters_box { - color: #ccc; -} - -QWidget#contentDialog QLabel#label_title, -QWidget#contentRichDialog QLabel#label_title_rich { - color: #888; -} - -QWidget#contentDialog QLabel#label_dialog { - padding: 20px 65px; -} - -QWidget#contentDialog QLabel#label_title, -QWidget#contentRichDialog QLabel#label_title_rich { - padding: 0px 65px; -} - -QDialog#OverlayDialog QPushButton { - color: rgba(49, 79, 239, 1); - background: transparent; - border: none; - padding: 0px; - min-width: 0px; -} - -QDialog#OverlayDialog QPushButton:focus, -QDialog#OverlayDialog QPushButton:hover { - color: rgba(49, 79, 239, 1); - background: rgba(255, 255, 255, 1); - border: 5px solid rgba(148, 250, 202, 1); - border-radius: 6px; - outline: none; -} - -QDialog#OverlayDialog QPushButton:pressed { - color: rgba(240, 240, 240, 1); - background: rgba(150, 150, 150, 1); - border: 5px solid rgba(148, 250, 202, 1); - border-radius: 6px; - outline: none; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton { - background: rgba(232, 232, 232, 1); - border: 2px solid rgba(240, 240, 240, 1); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { - background: rgba(218, 218, 218, 1); - border: 2px solid rgba(240, 240, 240, 1); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { - color: rgba(240, 240, 240, 1); - background: rgba(44, 44, 44, 1); - border: 2px solid rgba(240, 240, 240, 1); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { - color: rgba(240, 240, 240, 1); - background: rgba(49, 79, 239, 1); - border: 2px solid rgba(240, 240, 240, 1); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:focus, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:focus, - -QDialog#QtSoftwareKeyboardDialog QPushButton:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:hover, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:hover { - color: rgba(0, 0, 0, 1); - background: rgba(255, 255, 255, 1); - border: 5px solid rgba(148, 250, 202, 1); - border-radius: 6px; - outline: none; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:pressed, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:pressed { - color: rgba(240, 240, 240, 1); - background: rgba(150, 150, 150, 1); - border: 5px solid rgba(148, 250, 202, 1); - border-radius: 6px; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { - image: url(:/overlay/osk_button_B.png); - image-position: right; - qproperty-icon: url(:/overlay/osk_button_backspace.png); - qproperty-iconSize: 36px; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { - image: url(:/overlay/osk_button_Y.png); - image-position: right; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { - image: url(:/overlay/osk_button_plus.png); - image-position: right; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { - image: url(:/overlay/osk_button_shift_lock_off.png); - image-position: left; - qproperty-icon: url(:/overlay/osk_button_shift.png); - qproperty-iconSize: 36px; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { - image: url(:/overlay/osk_button_shift_lock_off.png); - image-position: left; - qproperty-icon: url(:/overlay/osk_button_shift_on.png); - qproperty-iconSize: 36px; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_left_bracket, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_right_bracket, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_left_parenthesis, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_right_parenthesis { - padding-bottom: 7px; -} - -QDialog#QtSoftwareKeyboardDialog QWidget#titleOSK QLabel { - background: transparent; - color: #ccc; -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_L, -QDialog#QtSoftwareKeyboardDialog QWidget#button_L_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_L_num { - image: url(:/overlay/button_L.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left_num { - image: url(:/overlay/arrow_left.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_R, -QDialog#QtSoftwareKeyboardDialog QWidget#button_R_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_R_num { - image: url(:/overlay/button_R.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right_num { - image: url(:/overlay/arrow_right.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_press_stick, -QDialog#QtSoftwareKeyboardDialog QWidget#button_press_stick_shift { - image: url(:/overlay/button_press_stick.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_X, -QDialog#QtSoftwareKeyboardDialog QWidget#button_X_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_X_num { - image: url(:/overlay/button_X.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_A, -QDialog#QtSoftwareKeyboardDialog QWidget#button_A_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_A_num { - image: url(:/overlay/button_A.png); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { - color: rgba(164, 164, 164, 1); - background-color: rgba(218, 218, 218, 1); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_at:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_slash:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_percent:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_1:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_2:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_3:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_4:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_5:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_6:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_7:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_8:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_9:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_0:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled { - color: rgba(164, 164, 164, 1); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { - image: url(:/overlay/osk_button_plus_disabled.png); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { - image: url(:/overlay/osk_button_B_disabled.png); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { - image: url(:/overlay/osk_button_Y_disabled.png); -} diff --git a/suyu/dist/qt_themes/monochrome/icons.qrc b/suyu/dist/qt_themes/monochrome/icons.qrc new file mode 100644 index 0000000000..4eb16294fe --- /dev/null +++ b/suyu/dist/qt_themes/monochrome/icons.qrc @@ -0,0 +1,32 @@ + + + + + icons/index.theme + icons/16x16/lock.png + icons/48x48/bad_folder.png + icons/48x48/chip.png + icons/48x48/folder.png + icons/48x48/list-add.png + icons/48x48/sd_card.png + icons/48x48/star.png + icons/256x256/plus_folder.png + + + + + ../monochrome_dark/icons/index.theme + ../monochrome_dark/icons/16x16/lock.png + ../monochrome_dark/icons/48x48/bad_folder.png + ../monochrome_dark/icons/48x48/chip.png + ../monochrome_dark/icons/48x48/folder.png + ../monochrome_dark/icons/48x48/list-add.png + ../monochrome_dark/icons/48x48/no_avatar.png + ../monochrome_dark/icons/48x48/sd_card.png + ../monochrome_dark/icons/48x48/star.png + ../monochrome_dark/icons/256x256/plus_folder.png + + diff --git a/suyu/dist/qt_themes/monochrome/icons/16x16/lock.png b/suyu/dist/qt_themes/monochrome/icons/16x16/lock.png new file mode 100644 index 0000000000000000000000000000000000000000..69d399050804cfa45e00850d4330a5b7cfaa3a43 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!ONa5jv*HQQzsd6F&PTDF7BvcigwK2xb0Ff zhuneUh?|ux2k!;nxOsckjoY_Y^!}UPGoe*wHNV_%W63ndp3?>s!+)Bcyi&JF|NSS8 z=V~*h%D1jjJsVrkHDP68_`=NlGZsGSH;3>PO&93KD~2sN7CUWf&8hc?pDt;S^FO@r z!vyx7-tt$_Rg!A$X2A*{aP#H<=j0M&+o7&+_Oww)O|$;=sgBcS3j3^ HP6Ym?Uzu!5(^E>B#&inOwpZ8zye?IvXKW~)!Ms)xH zinPlk0077;LI47`YG2aBX8=%(Bzd?~Q{*$RpiC?YcqtZz=o>c=z5GXg`t?63-4fe! zbFgeWf%WwJvdQ=(-W<2)YQ8C{o& zg%KN&u{8KkWTW87Pi~m!JOZ~0vCs!|#E3H1>6G~+t=_=;aI0LIErC@esf7Lra1lT< zUL{8U2vAuo{Vtqwgu!s|aBrP{@QutN5^`F0_o6&8;gQ@@I?pWGjd-lrrD{pw+McyA z<{Ydy^Jk#r2UV2syE+EOj$OiLBbl@NQp?+UMdpXKjail`u+IF!iDa{DftUI1h+kZE z0GS_^&O^mf2*W1qiNGM7b_(}mY%2?y`xRqy99f!HVTYN)XAGU`*d|ya^VQ;K8|kM- z3jerlBsC(&R(~b-X`bGWviEq7Ot&ga$msHIAeU8&^~lmUa?B{)?D9VH$U6Glq-j0I zVG~O986~Y8NtT8=+mA}G-v6l5Xy=%v5EiO@dM;7SYKk|(E>9S;k=Kh^VA*K0504J-a*hl;+5T^(q55GJg8L zGrVw>)<4d=*HGgH&Kl3&7W3+0{OI$?Hl(;#17=+B&dzr*eq8Ocx&Cu7$Vloc3+V!b zP5W29IX^(D)6G2y-le$U*necf?0F{^?!L6QC%M~=`WTkR0F&k&tS2iKEB;v@=;>aU z-V+rDpKb4vQb{)wg-;N~kLg`4QvOemgBk}HJ|)X2qj0LNQ2wtP0Y>E&w! zprWFIzR*eh{r&s!Yj?tGiji5!4`ydL~0$sKS0scSF>V;8?|7YEM!LB`Z zmR?&w2CJplJim6mDjn2JvbJo64=~OI&6E3Cl|#V!5_WX9Vhaa7s!LFjwY@$Fl+UoH z!XufdDz`gmVpLBCenlBaSoUaK2;YacVe4EgDcFNDl4e|pph5F&ey*#OgNQ;e3okpi z4wTdlpm|Ewy7@s6ac7qW&7Q5pDlTwYt+!~HszTdNn=fl7+iVt9T5A~fapw5%(-^z@ z`jK-=F<0UZ9SfCUs4p-fZ=17S4zl3uEJTv&55+ds3MzUm`s!cN=rO8R;iUfWc$X<9 zsHeJb(GnUqf6lYkc$cu%veQrhJ|p)lL@?r(Hy^ASWmYcejvVWma3e}yRmhqczNHRO z{Qt4szjrOkIM=WYFDgk~|MV3Im{s>|PXL=!^J)zp*`=;MF@^q%nbPwfpN7S=&TLA! z8pY?XtLtm?407y*TQt>JhtO6}*dj29k5*mfg&F@?*%z~H2o=l8TDBV4$XGz}1A^vH zzEO3f|0uK+_ChkgZRnUc5Z^Bf11ISl0O5G96Z=%#_uHYp5KA)D=r+*I%`|aKfKlB{ zJVPF|PtDbeloVc9See_AZ0NV*!?2-@vmgV5Y)oyzM`0m??Zw;f;=2m$5-iYGG0_Ua4T1^8k)8-V#duMR9 zXIl;?XR=ymU5;TUze(1MNnXErYbC>*;oPc336Ad{ZFR^bC;vJVxp7IVgjGB}tzbzn z|4S0x3?Yj*F|neAqv$MK)#FI3Q>ci5<$JoYif+Gx6oLfX?61r1Xu?Ra9W4v{9TJU1 z7g$?YVl`fyh@!qiB4@4tI$$Khwz>EEyCjhGB-mC*$NZF^>vz)^DdIR-#gN}6ekRh2 zXW-4fceM7Yf2c})q?U2LpH}v@xm!)PT~#?UM8l2rg3XhB#r7I^Sa2I^bnl6af#l9= zSa97AF_~Graq9C%$({)7W-ABh(CV_(f)Stg4S(jqR|HN@)z*jx=9Dzo(vvF)-y8In zN;B_{gg0;}oOt89<$}b7@)%a%IE|*ryp<|@O!;-otCVvUqLYVTaL0Al{MS!3CGi%} Yh89WFHBF|yt6vw8JpDWxh~e3P1CC-@r2qf` literal 0 HcmV?d00001 diff --git a/suyu/dist/qt_themes/monochrome/icons/48x48/bad_folder.png b/suyu/dist/qt_themes/monochrome/icons/48x48/bad_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..364ec646f6f1c6b5b632fb68efd2602aa2c87f25 GIT binary patch literal 1007 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vG$aR2}!aRGnSI!pin1B6LLK~!i%?U_qx z6G0fqceY8JQfje^v^`Z?C}^vKU~SWss8#7Bq7>^BQS_o%D&FixC}>dx@paXk2fb!jWysaGN1x$Fnz386RA_cs9JkNVfB+5}*KzMVo z5<{y;q)9N<9gVg&R*6(8YL7rH){j>o{HZZs%M5)PVmcq>8+myruvCt+0wN**YAopb zi5M!s`S@ko?FTOqzlpEnUD1xlhIp(FB?VwYW}3myAWYoh(Hxy15i^77XU%ODqNIRm zsA)TAnqQsWj3B_=;jZ8e^3r zO;8hQYp#oK3eX^~iLVl1+rr`)T^lJus({Fr#zpu9r#Zfe>&A1#;Lj+IubP5$t@m?V zuuP;<$Q^+Ry$^k&L}ckuJgH9}7qJws3kZk&OEGZwi*y>8ZRk?sqDUR!2k0|I;u`ly zfa|C6>WL?*pz*^M1CM&j2Of5#h__<39qh|aiP$v~U5K}eU>cZq7KcNDz2T0geb~-E zz^C9^n}}TFz5u5E5Rnrej8uAxaM_G!0EK=Rp=(?hfG77T^ho4iLv7dvX}nq6NNrBuZx2B0n{&Y%FbQ3BjX|dkvr%emElgoI zw0EU!l-g)MR&=5T4ne0Kvq5?~w-zRGn!oAM^*Tr!RzSCZ@~MLUANU0C!aI=u%gB)< d$Nzz*{RLYl6+9v2Tqpnl002ovPDHLkV1lP2!l3{F literal 0 HcmV?d00001 diff --git a/suyu/dist/qt_themes/monochrome/icons/48x48/chip.png b/suyu/dist/qt_themes/monochrome/icons/48x48/chip.png new file mode 100644 index 0000000000000000000000000000000000000000..1b573d51af66864f03a7e20179d3ea4d5f36a012 GIT binary patch literal 511 zcmV9EdCE@3Mha(U=39Kwt-~tF_(V@tbhe@rpPOZE8smKIV=0D_cUSBbMlS7Ve^b~ zpCI|hZY>H}i=fZIrA1)D1@I{LT3H0%iJ()9pbkp0*SBv$NROG$ZR`C;c@8vM#WlBm z{-GACg|z-hS|#Kl^7*&fDJ`V(w`ieRqP0$ZEg|VT>qFz6Y$1y&q@7Zx@kTj?21PC) zHMxM)jIsc&7LsTWuF!bVv`}9saWpNoO|;gDRts6n>E5-FHCYQuD)BkSjYNaI%<}%J z58;F3UVI|X%|r>jh`p8;fgjL6pjLKcQNTIyl_2?73nvPx#1ZP1_K>z@;j|==^1poj532;bRa{vG$asU7#askq98zBGy0jx!G;=NG{;w3(V&)^%7sC5cDp(K0(Eum7VP&2?Hew~5;RZehy&5rvSNM^VC)kWN zVHMxeR!9z)a0X9MeRGaIYAAsD73r}op+A}nH0$iPO`j}shnuBljNAke zx8X5LOP&H)@c~@p1GvTqaE%Y(8Xv$lK7ea{0N3~cu2BH3wV2petzBcQsi*+=rFM+I z@R%hA!ebQOD;L`F4WoDakEpd5Es3~BH7uj{8KO0+<~9sC!03~Ca39O`<1^X@W>MAJ zi!oNvoJv_#H3rLyHYV{BZ6{_ytlBSEK+1 z9X(wfLp;3So;KuSP~dUC`0U^Gu!R9iB3fEjPkbdm@pg-Z*l@4;Y#AsZGNCu2rl{_h ojlvg2t|q1;trMCncE~dD#zk`|?lR_b0UE~O>FVdQ&MBb@0NraiKmY&$ literal 0 HcmV?d00001 diff --git a/suyu/dist/qt_themes/monochrome/icons/48x48/sd_card.png b/suyu/dist/qt_themes/monochrome/icons/48x48/sd_card.png new file mode 100644 index 0000000000000000000000000000000000000000..6bcb7f6b1d93ab9bf8731849832aa88df68b0fd3 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC&H|6fVg?31We{epSZZGe6s+)c zaSX}0_x8FYUxNV$i^GTi^~cn&+=x(=%u};{v&H06PkCtJvZCsP{SW0+&pdlL-EzG| z-1TF9PY%8>U;^s5J>Boa&B$C$hNGxBS?WfCd ieyFWGC%N1H)%2fvs!qH~tv4HLK~kQselF{r5}E)AjzNq7 literal 0 HcmV?d00001 diff --git a/suyu/dist/qt_themes/monochrome/icons/48x48/star.png b/suyu/dist/qt_themes/monochrome/icons/48x48/star.png new file mode 100644 index 0000000000000000000000000000000000000000..c2b78f0c3e543913b18d4f95956109c7d2646ba8 GIT binary patch literal 1029 zcmV+g1p51lP)X)lQZo@-L=cu)ZHg3&%A{3AU{olP z1-a8`)uIOkK?H#db72rfkkLY-$D*Q0B3jg{0v8dMp}mlZe3E70Z83B4od0>=d**0_ z9}GA%|M|Xej&tVxXD-ZPc9DpYdjqf?NCHoQS21cCMHX-wW!zdW0rO_jS7;o=X+Bks z&Z4hSNC5qKPoST8mu+NJV>djmi?yxVq@d|Fxlh#Z0}n*oUc;J3@gDort_K=K+lN_m z7l8HHjZOghz(U}s=v!w>)Z`M9%jXd=hI$7c2gLppc!T{ZAF}iv7JYAL++6_HU^h4k z6j}Ng0l!7eY7@eymXKT$-N2BgK8#8y{KjO2Y>)N@Kn<`gB+o%nzwHup3)o?)Hv->6 z@(%#dP#Z%awgI2<{+b4rKR}5KZ;9^9l=l;`HOTxDU^IeA61d{Se>Eca2vF)bfin>W zo}%`CFBG7bLKKbDRzmp>tP=HJZ7K*qfakzHE#ieypcdE-YyuXC;I0MAeLUK50sCyH zfQvwG2qDwR)!I|S(|Nx^<+#6SuYrmf%}P{gP3dD2SQ#|h?r?fl42qN*&`iR&v&woIo+~%R@L- zt`Y7dl&@p`xF!g9;7<$ZJj6y&w`}R6QIB=wJR9Av6A9oXY8y>Un14sh237!t2005+lkvK%ox>dF@W0|O*YW8UHg=Uy00000NkvXXu0mjfk8a2c literal 0 HcmV?d00001 diff --git a/suyu/dist/qt_themes/colorful/icons/index.theme b/suyu/dist/qt_themes/monochrome/icons/index.theme similarity index 60% rename from suyu/dist/qt_themes/colorful/icons/index.theme rename to suyu/dist/qt_themes/monochrome/icons/index.theme index 6eb3c69495..c2764622e0 100644 --- a/suyu/dist/qt_themes/colorful/icons/index.theme +++ b/suyu/dist/qt_themes/monochrome/icons/index.theme @@ -1,8 +1,9 @@ [Icon Theme] -Name=colorful -Comment=Colorful theme +Name=monochrome +Comment=Monochrome light icons +Inherits=default Directories=16x16,48x48,256x256 - + [16x16] Size=16 diff --git a/suyu/dist/qt_themes/monochrome/style.qrc b/suyu/dist/qt_themes/monochrome/style.qrc new file mode 100644 index 0000000000..54778e2f54 --- /dev/null +++ b/suyu/dist/qt_themes/monochrome/style.qrc @@ -0,0 +1,5 @@ + + + ../default/style.qss + + diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/16x16/lock.png b/suyu/dist/qt_themes/monochrome_dark/icons/16x16/lock.png similarity index 100% rename from suyu/dist/qt_themes/qdarkstyle/icons/16x16/lock.png rename to suyu/dist/qt_themes/monochrome_dark/icons/16x16/lock.png diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/256x256/plus_folder.png b/suyu/dist/qt_themes/monochrome_dark/icons/256x256/plus_folder.png similarity index 100% rename from suyu/dist/qt_themes/qdarkstyle/icons/256x256/plus_folder.png rename to suyu/dist/qt_themes/monochrome_dark/icons/256x256/plus_folder.png diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/48x48/bad_folder.png b/suyu/dist/qt_themes/monochrome_dark/icons/48x48/bad_folder.png similarity index 100% rename from suyu/dist/qt_themes/qdarkstyle/icons/48x48/bad_folder.png rename to suyu/dist/qt_themes/monochrome_dark/icons/48x48/bad_folder.png diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/48x48/chip.png b/suyu/dist/qt_themes/monochrome_dark/icons/48x48/chip.png similarity index 100% rename from suyu/dist/qt_themes/qdarkstyle/icons/48x48/chip.png rename to suyu/dist/qt_themes/monochrome_dark/icons/48x48/chip.png diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/48x48/folder.png b/suyu/dist/qt_themes/monochrome_dark/icons/48x48/folder.png similarity index 100% rename from suyu/dist/qt_themes/qdarkstyle/icons/48x48/folder.png rename to suyu/dist/qt_themes/monochrome_dark/icons/48x48/folder.png diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/48x48/list-add.png b/suyu/dist/qt_themes/monochrome_dark/icons/48x48/list-add.png similarity index 100% rename from suyu/dist/qt_themes/qdarkstyle/icons/48x48/list-add.png rename to suyu/dist/qt_themes/monochrome_dark/icons/48x48/list-add.png diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/48x48/no_avatar.png b/suyu/dist/qt_themes/monochrome_dark/icons/48x48/no_avatar.png similarity index 100% rename from suyu/dist/qt_themes/qdarkstyle/icons/48x48/no_avatar.png rename to suyu/dist/qt_themes/monochrome_dark/icons/48x48/no_avatar.png diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/48x48/sd_card.png b/suyu/dist/qt_themes/monochrome_dark/icons/48x48/sd_card.png similarity index 100% rename from suyu/dist/qt_themes/qdarkstyle/icons/48x48/sd_card.png rename to suyu/dist/qt_themes/monochrome_dark/icons/48x48/sd_card.png diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/48x48/star.png b/suyu/dist/qt_themes/monochrome_dark/icons/48x48/star.png similarity index 100% rename from suyu/dist/qt_themes/qdarkstyle/icons/48x48/star.png rename to suyu/dist/qt_themes/monochrome_dark/icons/48x48/star.png diff --git a/suyu/dist/qt_themes/monochrome_dark/icons/index.theme b/suyu/dist/qt_themes/monochrome_dark/icons/index.theme new file mode 100644 index 0000000000..9ca318d09e --- /dev/null +++ b/suyu/dist/qt_themes/monochrome_dark/icons/index.theme @@ -0,0 +1,14 @@ +[Icon Theme] +Name=monochrome_dark +Comment=Monochrome dark icons +Inherits=default_dark +Directories=16x16,48x48,256x256 + +[16x16] +Size=16 + +[48x48] +Size=48 + +[256x256] +Size=256 diff --git a/suyu/dist/qt_themes/qdarkstyle/style.qss b/suyu/dist/qt_themes/qdarkstyle/dark.qss similarity index 93% rename from suyu/dist/qt_themes/qdarkstyle/style.qss rename to suyu/dist/qt_themes/qdarkstyle/dark.qss index 328ac942fc..95e575c42f 100644 --- a/suyu/dist/qt_themes/qdarkstyle/style.qss +++ b/suyu/dist/qt_themes/qdarkstyle/dark.qss @@ -944,6 +944,10 @@ QListView::indicator:indeterminate:pressed { image: url(:/qss_icons/rc/checkbox_indeterminate_focus.png); } +QSlider:horizontal { + height: 20px; +} + QSlider::groove:horizontal { border: 1px solid #565a5e; height: 4px; @@ -1380,10 +1384,6 @@ QWidget#connectedControllers { background: transparent; } -QWidget#closeButtons { - background: transparent; -} - QWidget#playersSupported, QWidget#controllersSupported, QWidget#controllerSupported1, @@ -1843,40 +1843,17 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:pressed { QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { - image: url(:/overlay/osk_button_B_dark.png); image-position: right; - qproperty-icon: url(:/overlay/osk_button_backspace_dark.png); qproperty-iconSize: 36px; } -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { - image: url(:/overlay/osk_button_Y_dark.png); - image-position: right; -} - QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { color: rgba(44, 44, 44, 1); - image: url(:/overlay/osk_button_plus_dark.png); image-position: right; } -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { - image: url(:/overlay/osk_button_shift_lock_off.png); - image-position: left; - qproperty-icon: url(:/overlay/osk_button_shift_dark.png); - qproperty-iconSize: 36px; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { - image: url(:/overlay/osk_button_shift_lock_off.png); - image-position: left; - qproperty-icon: url(:/overlay/osk_button_shift_on_dark.png); - qproperty-iconSize: 36px; -} - QDialog#QtSoftwareKeyboardDialog QPushButton#button_left_bracket, QDialog#QtSoftwareKeyboardDialog QPushButton#button_right_bracket, QDialog#QtSoftwareKeyboardDialog QPushButton#button_left_parenthesis, @@ -1889,47 +1866,6 @@ QDialog#QtSoftwareKeyboardDialog QWidget#titleOSK QLabel { color: #ccc; } -QDialog#QtSoftwareKeyboardDialog QWidget#button_L, -QDialog#QtSoftwareKeyboardDialog QWidget#button_L_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_L_num { - image: url(:/overlay/button_L_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left_num { - image: url(:/overlay/arrow_left_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_R, -QDialog#QtSoftwareKeyboardDialog QWidget#button_R_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_R_num { - image: url(:/overlay/button_R_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right_num { - image: url(:/overlay/arrow_right_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_press_stick, -QDialog#QtSoftwareKeyboardDialog QWidget#button_press_stick_shift { - image: url(:/overlay/button_press_stick_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_X, -QDialog#QtSoftwareKeyboardDialog QWidget#button_X_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_X_num { - image: url(:/overlay/button_X_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_A, -QDialog#QtSoftwareKeyboardDialog QWidget#button_A_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_A_num { - image: url(:/overlay/button_A_dark.png); -} - QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled, @@ -1961,23 +1897,6 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled { color: rgba(144, 144, 144, 1); } -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { - image: url(:/overlay/osk_button_plus_dark_disabled.png); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { - image: url(:/overlay/osk_button_B_dark_disabled.png); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { - image: url(:/overlay/osk_button_Y_dark_disabled.png); -} - QDialog#QtSoftwareKeyboardDialog QFrame, QDialog#QtSoftwareKeyboardDialog QFrame[frameShape="0"], QDialog#OverlayDialog QFrame, diff --git a/suyu/dist/qt_themes/qdarkstyle/icons.qrc b/suyu/dist/qt_themes/qdarkstyle/icons.qrc new file mode 100644 index 0000000000..d7ec900649 --- /dev/null +++ b/suyu/dist/qt_themes/qdarkstyle/icons.qrc @@ -0,0 +1,51 @@ + + + icons/index.theme + ../default_dark/icons/16x16/lock.png + + + icons/index.theme + ../default_dark/icons/16x16/lock.png + + + rc/branch_closed-on.png + rc/branch_closed.png + rc/branch_open-on.png + rc/branch_open.png + rc/checkbox_checked.png + rc/checkbox_checked_disabled.png + rc/checkbox_checked_focus.png + rc/checkbox_indeterminate.png + rc/checkbox_indeterminate_focus.png + rc/checkbox_unchecked.png + rc/checkbox_unchecked_disabled.png + rc/checkbox_unchecked_focus.png + rc/close-hover.png + rc/close-pressed.png + rc/close.png + rc/down_arrow.png + rc/down_arrow_disabled.png + rc/Hmovetoolbar.png + rc/Hsepartoolbar.png + rc/left_arrow.png + rc/left_arrow_disabled.png + rc/radio_checked.png + rc/radio_checked_disabled.png + rc/radio_checked_focus.png + rc/radio_unchecked.png + rc/radio_unchecked_disabled.png + rc/radio_unchecked_focus.png + rc/right_arrow.png + rc/right_arrow_disabled.png + rc/sizegrip.png + rc/stylesheet-branch-end.png + rc/stylesheet-branch-more.png + rc/stylesheet-vline.png + rc/transparent.png + rc/undock.png + rc/up_arrow.png + rc/up_arrow_disabled.png + rc/Vmovetoolbar.png + rc/Vsepartoolbar.png + + diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/16x16/connected.png b/suyu/dist/qt_themes/qdarkstyle/icons/16x16/connected.png deleted file mode 100644 index 0afc18cb7a19028fd567a7ca7ced62cd164657de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 575 zcmV-F0>J%=P)0k{|sIn0V`B1xGGFnerg>I4!7^B>UM&p)aM9vQI<{ZJ4 z8HZ4p+_%{7AT1;1-`r}Q8XRRVYW9}G=D3HXRO!FFg z<>v6FfXkm66-$M=OnPPtTpl}lK!#o^J26y#00VLkV5Ig4hAIxCZ~AU@6mMaG2|$+zA&;BarDZyi@16B z4lE8kTwX8y!4LxB2>hW4yn!GbZg+WiA%P|k^Ip;o774}ts6fO6U&y7=hp3TO@-WL? z{^Mh)gLW3&bGqIiV!1gSPQ{V|zW{P&fJjHVbAtc? N002ovPDHLkV1hH82Xp`c diff --git a/suyu/dist/qt_themes/qdarkstyle/icons/16x16/connected_notification.png b/suyu/dist/qt_themes/qdarkstyle/icons/16x16/connected_notification.png deleted file mode 100644 index 72466e098e471ae5a97c49a56536dd4bf62b3a08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 760 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0*y&TK~y+Tl~Y|v z6j2oZ?(CguoZVz~OB-RWz#nLd9z^@Yo&q%@j2=qtp^PLV$cmEeAL_xE^2wfrs242~ zp$Ef$h%#S%kW`EcLR4x6ZEJVk8F%j7>CU(tNkRF+;a<+Y=R4my_gvyQ4zjp<{ql`; zI^D*(O+BwTbI<>_2MD8-wl5<%-+In!I@(0@^Fzo{bD*j!D3xKFhG&Lp!dzV1$6_(` z^gLuV6YIgUEb0c8*Ie*2x#lAhY;J={1gb21z6E0ugAZC@F^euEux;jDmV`UFz7l>- zK|xT%#N<56!g^D3Wwr@)QUY z@d)MRLDK?Qog0L{ZY_3>K0_%MP_m~6ird7|QOF|6#=1I$H9tA_=53H>6>z~YHTJ@7 zb_Nd4PV}Lux(a+|27GF2$(u@fs~(9UHZ*jca>r)zc$_}(It@ippva0SLlzB`5RY_2 zDJ%pZ9`=H=;M3EPtE-_V5`;>`*WTHAw^h71&5pJA_QIN1DX?Z|p%fSYQs6=ghhYg- zVhSf|d1>iW;`5ymOPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0v$<2K~y+Tl~PS> zQ$Z9x^WL<1ZG=jLsqtf@CIu;o=wGnd1VlHD;-XFKLZw(mq)@*>1VJ>!or+OVq^`wu znJxuC&?1zmaamnO1NME*%5JoAzwQ9hHiSzzQVT5*fC(vPaz_Kh*+6Kq5b=Zyr$6d-BjRvNsUN9r<)$o0v zs;137DRgyhL@Z{(G)=_g8<0qB!nUp3v1>;LeY^L_vp9U_(^UgFXW)W|)!HD0fHMwq z`Rc|0_8q`L@sq zk>1%G63fVBGANuFmY*(fDuPllKmS8eCS`Em`r?L1hp>O&UTLdSRsk4e>gLt9;4C;0 zLcq{BFQXMa*Fk%G45d;@#y$LM{=|d(5AnGC1hkF9bzQ?)OM&Zp`Y#clJ$)W#YAJ!{ z4H0nGY&P-w?HjzG{fJLxahf`;55)a!M*cR#Fvf$Tw4UQO#< z+13h9kDdH|_{gEo)RvScR^ra>BKrFe$hQ&GwNfR74B5P3+o;Y|898=5|6Tg*(O>)p iN=@~G{{?26=FLU_5=aXOVS_yY00002?p zD}XSgpwrRCKtah8*NBqf{Irtt#G+J&^73-M%)IR4TP^t%4d#k2I8Aju - - icons/index.theme - icons/16x16/connected.png - icons/16x16/disconnected.png - icons/16x16/connected_notification.png - icons/16x16/lock.png - icons/16x16/view-refresh.png - icons/48x48/bad_folder.png - icons/48x48/chip.png - icons/48x48/folder.png - icons/48x48/no_avatar.png - icons/48x48/list-add.png - icons/48x48/sd_card.png - icons/48x48/star.png - icons/256x256/plus_folder.png - - - rc/up_arrow_disabled.png - rc/Hmovetoolbar.png - rc/stylesheet-branch-end.png - rc/branch_closed-on.png - rc/stylesheet-vline.png - rc/branch_closed.png - rc/branch_open-on.png - rc/transparent.png - rc/right_arrow_disabled.png - rc/sizegrip.png - rc/close.png - rc/close-hover.png - rc/close-pressed.png - rc/down_arrow.png - rc/Vmovetoolbar.png - rc/left_arrow.png - rc/stylesheet-branch-more.png - rc/up_arrow.png - rc/right_arrow.png - rc/left_arrow_disabled.png - rc/Hsepartoolbar.png - rc/branch_open.png - rc/Vsepartoolbar.png - rc/down_arrow_disabled.png - rc/undock.png - rc/checkbox_checked_disabled.png - rc/checkbox_checked_focus.png - rc/checkbox_checked.png - rc/checkbox_indeterminate.png - rc/checkbox_indeterminate_focus.png - rc/checkbox_unchecked_disabled.png - rc/checkbox_unchecked_focus.png - rc/checkbox_unchecked.png - rc/radio_checked_disabled.png - rc/radio_checked_focus.png - rc/radio_checked.png - rc/radio_unchecked_disabled.png - rc/radio_unchecked_focus.png - rc/radio_unchecked.png - - - style.qss - + + dark.qss + diff --git a/suyu/dist/qt_themes/qdarkstyle_midnight_blue/style.qss b/suyu/dist/qt_themes/qdarkstyle_midnight_blue/dark.qss similarity index 95% rename from suyu/dist/qt_themes/qdarkstyle_midnight_blue/style.qss rename to suyu/dist/qt_themes/qdarkstyle_midnight_blue/dark.qss index eb0889b139..3086b90ade 100644 --- a/suyu/dist/qt_themes/qdarkstyle_midnight_blue/style.qss +++ b/suyu/dist/qt_themes/qdarkstyle_midnight_blue/dark.qss @@ -1296,6 +1296,10 @@ QSlider:focus { border: none; } +QSlider:horizontal { + height: 20px; +} + QSlider::groove:horizontal { background: #32414B; border: 1px solid #32414B; @@ -2779,41 +2783,10 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:pressed { border-radius: 6px; } -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num { - image: url(:/overlay/osk_button_B_dark.png); - image-position: right; - qproperty-icon: url(:/overlay/osk_button_backspace_dark.png); - qproperty-iconSize: 36px; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift { - image: url(:/overlay/osk_button_Y_dark.png); - image-position: right; -} - QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift, QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num { color: rgba(44, 44, 44, 1); - image: url(:/overlay/osk_button_plus_dark.png); - image-position: right; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift { - image: url(:/overlay/osk_button_shift_lock_off.png); - image-position: left; - qproperty-icon: url(:/overlay/osk_button_shift_dark.png); - qproperty-iconSize: 36px; -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_shift_shift { - image: url(:/overlay/osk_button_shift_lock_off.png); - image-position: left; - qproperty-icon: url(:/overlay/osk_button_shift_on_dark.png); - qproperty-iconSize: 36px; } QDialog#QtSoftwareKeyboardDialog QPushButton#button_left_bracket, @@ -2828,47 +2801,6 @@ QDialog#QtSoftwareKeyboardDialog QWidget#titleOSK QLabel { color: #ccc; } -QDialog#QtSoftwareKeyboardDialog QWidget#button_L, -QDialog#QtSoftwareKeyboardDialog QWidget#button_L_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_L_num { - image: url(:/overlay/button_L_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_left_num { - image: url(:/overlay/arrow_left_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_R, -QDialog#QtSoftwareKeyboardDialog QWidget#button_R_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_R_num { - image: url(:/overlay/button_R_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#arrow_right_num { - image: url(:/overlay/arrow_right_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_press_stick, -QDialog#QtSoftwareKeyboardDialog QWidget#button_press_stick_shift { - image: url(:/overlay/button_press_stick_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_X, -QDialog#QtSoftwareKeyboardDialog QWidget#button_X_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_X_num { - image: url(:/overlay/button_X_dark.png); -} - -QDialog#QtSoftwareKeyboardDialog QWidget#button_A, -QDialog#QtSoftwareKeyboardDialog QWidget#button_A_shift, -QDialog#QtSoftwareKeyboardDialog QWidget#button_A_num { - image: url(:/overlay/button_A_dark.png); -} - QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled, @@ -2899,20 +2831,3 @@ QDialog#QtSoftwareKeyboardDialog QPushButton#button_0:disabled, QDialog#QtSoftwareKeyboardDialog QPushButton#button_return:disabled { color: rgba(144, 144, 144, 1); } - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_ok_num:disabled { - image: url(:/overlay/osk_button_plus_dark_disabled.png); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_shift:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_backspace_num:disabled { - image: url(:/overlay/osk_button_B_dark_disabled.png); -} - -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space:disabled, -QDialog#QtSoftwareKeyboardDialog QPushButton#button_space_shift:disabled { - image: url(:/overlay/osk_button_Y_dark_disabled.png); -} diff --git a/suyu/dist/qt_themes/qdarkstyle_midnight_blue/icons.qrc b/suyu/dist/qt_themes/qdarkstyle_midnight_blue/icons.qrc new file mode 100644 index 0000000000..1a071adda6 --- /dev/null +++ b/suyu/dist/qt_themes/qdarkstyle_midnight_blue/icons.qrc @@ -0,0 +1,224 @@ + + + + + icons/index.theme + + + icons/index.theme + + + + rc/arrow_down.png + rc/arrow_down@2x.png + rc/arrow_down_disabled.png + rc/arrow_down_disabled@2x.png + rc/arrow_down_focus.png + rc/arrow_down_focus@2x.png + rc/arrow_down_pressed.png + rc/arrow_down_pressed@2x.png + rc/arrow_left.png + rc/arrow_left@2x.png + rc/arrow_left_disabled.png + rc/arrow_left_disabled@2x.png + rc/arrow_left_focus.png + rc/arrow_left_focus@2x.png + rc/arrow_left_pressed.png + rc/arrow_left_pressed@2x.png + rc/arrow_right.png + rc/arrow_right@2x.png + rc/arrow_right_disabled.png + rc/arrow_right_disabled@2x.png + rc/arrow_right_focus.png + rc/arrow_right_focus@2x.png + rc/arrow_right_pressed.png + rc/arrow_right_pressed@2x.png + rc/arrow_up.png + rc/arrow_up@2x.png + rc/arrow_up_disabled.png + rc/arrow_up_disabled@2x.png + rc/arrow_up_focus.png + rc/arrow_up_focus@2x.png + rc/arrow_up_pressed.png + rc/arrow_up_pressed@2x.png + rc/base_icon.png + rc/base_icon@2x.png + rc/base_icon_disabled.png + rc/base_icon_disabled@2x.png + rc/base_icon_focus.png + rc/base_icon_focus@2x.png + rc/base_icon_pressed.png + rc/base_icon_pressed@2x.png + rc/branch_closed.png + rc/branch_closed@2x.png + rc/branch_closed_disabled.png + rc/branch_closed_disabled@2x.png + rc/branch_closed_focus.png + rc/branch_closed_focus@2x.png + rc/branch_closed_pressed.png + rc/branch_closed_pressed@2x.png + rc/branch_end.png + rc/branch_end@2x.png + rc/branch_end_disabled.png + rc/branch_end_disabled@2x.png + rc/branch_end_focus.png + rc/branch_end_focus@2x.png + rc/branch_end_pressed.png + rc/branch_end_pressed@2x.png + rc/branch_line.png + rc/branch_line@2x.png + rc/branch_line_disabled.png + rc/branch_line_disabled@2x.png + rc/branch_line_focus.png + rc/branch_line_focus@2x.png + rc/branch_line_pressed.png + rc/branch_line_pressed@2x.png + rc/branch_more.png + rc/branch_more@2x.png + rc/branch_more_disabled.png + rc/branch_more_disabled@2x.png + rc/branch_more_focus.png + rc/branch_more_focus@2x.png + rc/branch_more_pressed.png + rc/branch_more_pressed@2x.png + rc/branch_open.png + rc/branch_open@2x.png + rc/branch_open_disabled.png + rc/branch_open_disabled@2x.png + rc/branch_open_focus.png + rc/branch_open_focus@2x.png + rc/branch_open_pressed.png + rc/branch_open_pressed@2x.png + rc/checkbox_checked.png + rc/checkbox_checked@2x.png + rc/checkbox_checked_disabled.png + rc/checkbox_checked_disabled@2x.png + rc/checkbox_checked_focus.png + rc/checkbox_checked_focus@2x.png + rc/checkbox_checked_pressed.png + rc/checkbox_checked_pressed@2x.png + rc/checkbox_indeterminate.png + rc/checkbox_indeterminate@2x.png + rc/checkbox_indeterminate_disabled.png + rc/checkbox_indeterminate_disabled@2x.png + rc/checkbox_indeterminate_focus.png + rc/checkbox_indeterminate_focus@2x.png + rc/checkbox_indeterminate_pressed.png + rc/checkbox_indeterminate_pressed@2x.png + rc/checkbox_unchecked.png + rc/checkbox_unchecked@2x.png + rc/checkbox_unchecked_disabled.png + rc/checkbox_unchecked_disabled@2x.png + rc/checkbox_unchecked_focus.png + rc/checkbox_unchecked_focus@2x.png + rc/checkbox_unchecked_pressed.png + rc/checkbox_unchecked_pressed@2x.png + rc/line_horizontal.png + rc/line_horizontal@2x.png + rc/line_horizontal_disabled.png + rc/line_horizontal_disabled@2x.png + rc/line_horizontal_focus.png + rc/line_horizontal_focus@2x.png + rc/line_horizontal_pressed.png + rc/line_horizontal_pressed@2x.png + rc/line_vertical.png + rc/line_vertical@2x.png + rc/line_vertical_disabled.png + rc/line_vertical_disabled@2x.png + rc/line_vertical_focus.png + rc/line_vertical_focus@2x.png + rc/line_vertical_pressed.png + rc/line_vertical_pressed@2x.png + rc/radio_checked.png + rc/radio_checked@2x.png + rc/radio_checked_disabled.png + rc/radio_checked_disabled@2x.png + rc/radio_checked_focus.png + rc/radio_checked_focus@2x.png + rc/radio_checked_pressed.png + rc/radio_checked_pressed@2x.png + rc/radio_unchecked.png + rc/radio_unchecked@2x.png + rc/radio_unchecked_disabled.png + rc/radio_unchecked_disabled@2x.png + rc/radio_unchecked_focus.png + rc/radio_unchecked_focus@2x.png + rc/radio_unchecked_pressed.png + rc/radio_unchecked_pressed@2x.png + rc/toolbar_move_horizontal.png + rc/toolbar_move_horizontal@2x.png + rc/toolbar_move_horizontal_disabled.png + rc/toolbar_move_horizontal_disabled@2x.png + rc/toolbar_move_horizontal_focus.png + rc/toolbar_move_horizontal_focus@2x.png + rc/toolbar_move_horizontal_pressed.png + rc/toolbar_move_horizontal_pressed@2x.png + rc/toolbar_move_vertical.png + rc/toolbar_move_vertical@2x.png + rc/toolbar_move_vertical_disabled.png + rc/toolbar_move_vertical_disabled@2x.png + rc/toolbar_move_vertical_focus.png + rc/toolbar_move_vertical_focus@2x.png + rc/toolbar_move_vertical_pressed.png + rc/toolbar_move_vertical_pressed@2x.png + rc/toolbar_separator_horizontal.png + rc/toolbar_separator_horizontal@2x.png + rc/toolbar_separator_horizontal_disabled.png + rc/toolbar_separator_horizontal_disabled@2x.png + rc/toolbar_separator_horizontal_focus.png + rc/toolbar_separator_horizontal_focus@2x.png + rc/toolbar_separator_horizontal_pressed.png + rc/toolbar_separator_horizontal_pressed@2x.png + rc/toolbar_separator_vertical.png + rc/toolbar_separator_vertical@2x.png + rc/toolbar_separator_vertical_disabled.png + rc/toolbar_separator_vertical_disabled@2x.png + rc/toolbar_separator_vertical_focus.png + rc/toolbar_separator_vertical_focus@2x.png + rc/toolbar_separator_vertical_pressed.png + rc/toolbar_separator_vertical_pressed@2x.png + rc/transparent.png + rc/transparent@2x.png + rc/transparent_disabled.png + rc/transparent_disabled@2x.png + rc/transparent_focus.png + rc/transparent_focus@2x.png + rc/transparent_pressed.png + rc/transparent_pressed@2x.png + rc/window_close.png + rc/window_close@2x.png + rc/window_close_disabled.png + rc/window_close_disabled@2x.png + rc/window_close_focus.png + rc/window_close_focus@2x.png + rc/window_close_pressed.png + rc/window_close_pressed@2x.png + rc/window_grip.png + rc/window_grip@2x.png + rc/window_grip_disabled.png + rc/window_grip_disabled@2x.png + rc/window_grip_focus.png + rc/window_grip_focus@2x.png + rc/window_grip_pressed.png + rc/window_grip_pressed@2x.png + rc/window_minimize.png + rc/window_minimize@2x.png + rc/window_minimize_disabled.png + rc/window_minimize_disabled@2x.png + rc/window_minimize_focus.png + rc/window_minimize_focus@2x.png + rc/window_minimize_pressed.png + rc/window_minimize_pressed@2x.png + rc/window_undock.png + rc/window_undock@2x.png + rc/window_undock_disabled.png + rc/window_undock_disabled@2x.png + rc/window_undock_focus.png + rc/window_undock_focus@2x.png + rc/window_undock_pressed.png + rc/window_undock_pressed@2x.png + + diff --git a/suyu/dist/qt_themes/qdarkstyle_midnight_blue/icons/index.theme b/suyu/dist/qt_themes/qdarkstyle_midnight_blue/icons/index.theme index 20f9f6d633..34c449f19a 100644 --- a/suyu/dist/qt_themes/qdarkstyle_midnight_blue/icons/index.theme +++ b/suyu/dist/qt_themes/qdarkstyle_midnight_blue/icons/index.theme @@ -1,14 +1,4 @@ [Icon Theme] Name=qdarkstyle_midnight_blue -Comment=dark theme -Inherits=colorful -Directories=16x16,48x48,256x256 - -[16x16] -Size=16 - -[48x48] -Size=48 - -[256x256] -Size=256 +Comment=Dark theme (Midnight Blue style) +Inherits=default_dark diff --git a/suyu/dist/qt_themes/qdarkstyle_midnight_blue/style.qrc b/suyu/dist/qt_themes/qdarkstyle_midnight_blue/style.qrc index dc3d7fecbd..0cdaefa035 100644 --- a/suyu/dist/qt_themes/qdarkstyle_midnight_blue/style.qrc +++ b/suyu/dist/qt_themes/qdarkstyle_midnight_blue/style.qrc @@ -1,228 +1,5 @@ - - icons/index.theme - ../qdarkstyle/icons/16x16/lock.png - ../qdarkstyle/icons/16x16/view-refresh.png - ../qdarkstyle/icons/48x48/bad_folder.png - ../qdarkstyle/icons/48x48/chip.png - ../qdarkstyle/icons/48x48/folder.png - ../qdarkstyle/icons/48x48/no_avatar.png - ../qdarkstyle/icons/48x48/list-add.png - ../qdarkstyle/icons/48x48/sd_card.png - ../qdarkstyle/icons/48x48/star.png - ../qdarkstyle/icons/256x256/plus_folder.png - - - rc/arrow_down.png - rc/arrow_down@2x.png - rc/arrow_down_disabled.png - rc/arrow_down_disabled@2x.png - rc/arrow_down_focus.png - rc/arrow_down_focus@2x.png - rc/arrow_down_pressed.png - rc/arrow_down_pressed@2x.png - rc/arrow_left.png - rc/arrow_left@2x.png - rc/arrow_left_disabled.png - rc/arrow_left_disabled@2x.png - rc/arrow_left_focus.png - rc/arrow_left_focus@2x.png - rc/arrow_left_pressed.png - rc/arrow_left_pressed@2x.png - rc/arrow_right.png - rc/arrow_right@2x.png - rc/arrow_right_disabled.png - rc/arrow_right_disabled@2x.png - rc/arrow_right_focus.png - rc/arrow_right_focus@2x.png - rc/arrow_right_pressed.png - rc/arrow_right_pressed@2x.png - rc/arrow_up.png - rc/arrow_up@2x.png - rc/arrow_up_disabled.png - rc/arrow_up_disabled@2x.png - rc/arrow_up_focus.png - rc/arrow_up_focus@2x.png - rc/arrow_up_pressed.png - rc/arrow_up_pressed@2x.png - rc/base_icon.png - rc/base_icon@2x.png - rc/base_icon_disabled.png - rc/base_icon_disabled@2x.png - rc/base_icon_focus.png - rc/base_icon_focus@2x.png - rc/base_icon_pressed.png - rc/base_icon_pressed@2x.png - rc/branch_closed.png - rc/branch_closed@2x.png - rc/branch_closed_disabled.png - rc/branch_closed_disabled@2x.png - rc/branch_closed_focus.png - rc/branch_closed_focus@2x.png - rc/branch_closed_pressed.png - rc/branch_closed_pressed@2x.png - rc/branch_end.png - rc/branch_end@2x.png - rc/branch_end_disabled.png - rc/branch_end_disabled@2x.png - rc/branch_end_focus.png - rc/branch_end_focus@2x.png - rc/branch_end_pressed.png - rc/branch_end_pressed@2x.png - rc/branch_line.png - rc/branch_line@2x.png - rc/branch_line_disabled.png - rc/branch_line_disabled@2x.png - rc/branch_line_focus.png - rc/branch_line_focus@2x.png - rc/branch_line_pressed.png - rc/branch_line_pressed@2x.png - rc/branch_more.png - rc/branch_more@2x.png - rc/branch_more_disabled.png - rc/branch_more_disabled@2x.png - rc/branch_more_focus.png - rc/branch_more_focus@2x.png - rc/branch_more_pressed.png - rc/branch_more_pressed@2x.png - rc/branch_open.png - rc/branch_open@2x.png - rc/branch_open_disabled.png - rc/branch_open_disabled@2x.png - rc/branch_open_focus.png - rc/branch_open_focus@2x.png - rc/branch_open_pressed.png - rc/branch_open_pressed@2x.png - rc/checkbox_checked.png - rc/checkbox_checked@2x.png - rc/checkbox_checked_disabled.png - rc/checkbox_checked_disabled@2x.png - rc/checkbox_checked_focus.png - rc/checkbox_checked_focus@2x.png - rc/checkbox_checked_pressed.png - rc/checkbox_checked_pressed@2x.png - rc/checkbox_indeterminate.png - rc/checkbox_indeterminate@2x.png - rc/checkbox_indeterminate_disabled.png - rc/checkbox_indeterminate_disabled@2x.png - rc/checkbox_indeterminate_focus.png - rc/checkbox_indeterminate_focus@2x.png - rc/checkbox_indeterminate_pressed.png - rc/checkbox_indeterminate_pressed@2x.png - rc/checkbox_unchecked.png - rc/checkbox_unchecked@2x.png - rc/checkbox_unchecked_disabled.png - rc/checkbox_unchecked_disabled@2x.png - rc/checkbox_unchecked_focus.png - rc/checkbox_unchecked_focus@2x.png - rc/checkbox_unchecked_pressed.png - rc/checkbox_unchecked_pressed@2x.png - rc/line_horizontal.png - rc/line_horizontal@2x.png - rc/line_horizontal_disabled.png - rc/line_horizontal_disabled@2x.png - rc/line_horizontal_focus.png - rc/line_horizontal_focus@2x.png - rc/line_horizontal_pressed.png - rc/line_horizontal_pressed@2x.png - rc/line_vertical.png - rc/line_vertical@2x.png - rc/line_vertical_disabled.png - rc/line_vertical_disabled@2x.png - rc/line_vertical_focus.png - rc/line_vertical_focus@2x.png - rc/line_vertical_pressed.png - rc/line_vertical_pressed@2x.png - rc/radio_checked.png - rc/radio_checked@2x.png - rc/radio_checked_disabled.png - rc/radio_checked_disabled@2x.png - rc/radio_checked_focus.png - rc/radio_checked_focus@2x.png - rc/radio_checked_pressed.png - rc/radio_checked_pressed@2x.png - rc/radio_unchecked.png - rc/radio_unchecked@2x.png - rc/radio_unchecked_disabled.png - rc/radio_unchecked_disabled@2x.png - rc/radio_unchecked_focus.png - rc/radio_unchecked_focus@2x.png - rc/radio_unchecked_pressed.png - rc/radio_unchecked_pressed@2x.png - rc/toolbar_move_horizontal.png - rc/toolbar_move_horizontal@2x.png - rc/toolbar_move_horizontal_disabled.png - rc/toolbar_move_horizontal_disabled@2x.png - rc/toolbar_move_horizontal_focus.png - rc/toolbar_move_horizontal_focus@2x.png - rc/toolbar_move_horizontal_pressed.png - rc/toolbar_move_horizontal_pressed@2x.png - rc/toolbar_move_vertical.png - rc/toolbar_move_vertical@2x.png - rc/toolbar_move_vertical_disabled.png - rc/toolbar_move_vertical_disabled@2x.png - rc/toolbar_move_vertical_focus.png - rc/toolbar_move_vertical_focus@2x.png - rc/toolbar_move_vertical_pressed.png - rc/toolbar_move_vertical_pressed@2x.png - rc/toolbar_separator_horizontal.png - rc/toolbar_separator_horizontal@2x.png - rc/toolbar_separator_horizontal_disabled.png - rc/toolbar_separator_horizontal_disabled@2x.png - rc/toolbar_separator_horizontal_focus.png - rc/toolbar_separator_horizontal_focus@2x.png - rc/toolbar_separator_horizontal_pressed.png - rc/toolbar_separator_horizontal_pressed@2x.png - rc/toolbar_separator_vertical.png - rc/toolbar_separator_vertical@2x.png - rc/toolbar_separator_vertical_disabled.png - rc/toolbar_separator_vertical_disabled@2x.png - rc/toolbar_separator_vertical_focus.png - rc/toolbar_separator_vertical_focus@2x.png - rc/toolbar_separator_vertical_pressed.png - rc/toolbar_separator_vertical_pressed@2x.png - rc/transparent.png - rc/transparent@2x.png - rc/transparent_disabled.png - rc/transparent_disabled@2x.png - rc/transparent_focus.png - rc/transparent_focus@2x.png - rc/transparent_pressed.png - rc/transparent_pressed@2x.png - rc/window_close.png - rc/window_close@2x.png - rc/window_close_disabled.png - rc/window_close_disabled@2x.png - rc/window_close_focus.png - rc/window_close_focus@2x.png - rc/window_close_pressed.png - rc/window_close_pressed@2x.png - rc/window_grip.png - rc/window_grip@2x.png - rc/window_grip_disabled.png - rc/window_grip_disabled@2x.png - rc/window_grip_focus.png - rc/window_grip_focus@2x.png - rc/window_grip_pressed.png - rc/window_grip_pressed@2x.png - rc/window_minimize.png - rc/window_minimize@2x.png - rc/window_minimize_disabled.png - rc/window_minimize_disabled@2x.png - rc/window_minimize_focus.png - rc/window_minimize_focus@2x.png - rc/window_minimize_pressed.png - rc/window_minimize_pressed@2x.png - rc/window_undock.png - rc/window_undock@2x.png - rc/window_undock_disabled.png - rc/window_undock_disabled@2x.png - rc/window_undock_focus.png - rc/window_undock_focus@2x.png - rc/window_undock_pressed.png - rc/window_undock_pressed@2x.png - - - style.qss - + + dark.qss + diff --git a/suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/icons.qrc b/suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/icons.qrc new file mode 100644 index 0000000000..60b95db02a --- /dev/null +++ b/suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/icons.qrc @@ -0,0 +1,33 @@ + + + + + + + icons/index.theme + ../monochrome_dark/icons/16x16/lock.png + ../monochrome_dark/icons/48x48/bad_folder.png + ../monochrome_dark/icons/48x48/chip.png + ../monochrome_dark/icons/48x48/folder.png + ../monochrome_dark/icons/48x48/list-add.png + ../monochrome_dark/icons/48x48/sd_card.png + ../monochrome_dark/icons/48x48/star.png + ../monochrome_dark/icons/256x256/plus_folder.png + + + + icons/index.theme + ../monochrome_dark/icons/16x16/lock.png + ../monochrome_dark/icons/48x48/bad_folder.png + ../monochrome_dark/icons/48x48/chip.png + ../monochrome_dark/icons/48x48/folder.png + ../monochrome_dark/icons/48x48/list-add.png + ../monochrome_dark/icons/48x48/no_avatar.png + ../monochrome_dark/icons/48x48/sd_card.png + ../monochrome_dark/icons/48x48/star.png + ../monochrome_dark/icons/256x256/plus_folder.png + + diff --git a/suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/icons/index.theme b/suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/icons/index.theme new file mode 100644 index 0000000000..d6ed7d55ec --- /dev/null +++ b/suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/icons/index.theme @@ -0,0 +1,14 @@ +[Icon Theme] +Name=qdarkstyle_midnight_blue_monochrome +Comment=Monochrome dark theme (Midnight Blue style) +Inherits=qdarkstyle_midnight_blue +Directories=16x16,48x48,256x256 + +[16x16] +Size=16 + +[48x48] +Size=48 + +[256x256] +Size=256 diff --git a/suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/style.qrc b/suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/style.qrc new file mode 100644 index 0000000000..eeb5f34cbb --- /dev/null +++ b/suyu/dist/qt_themes/qdarkstyle_midnight_blue_monochrome/style.qrc @@ -0,0 +1,8 @@ + + + ../qdarkstyle_midnight_blue/dark.qss + + + ../qdarkstyle/dark.qss + + diff --git a/suyu/dist/qt_themes/qdarkstyle_monochrome/icons.qrc b/suyu/dist/qt_themes/qdarkstyle_monochrome/icons.qrc new file mode 100644 index 0000000000..355fe22beb --- /dev/null +++ b/suyu/dist/qt_themes/qdarkstyle_monochrome/icons.qrc @@ -0,0 +1,33 @@ + + + + + + + icons/index.theme + ../monochrome_dark/icons/16x16/lock.png + ../monochrome_dark/icons/48x48/bad_folder.png + ../monochrome_dark/icons/48x48/chip.png + ../monochrome_dark/icons/48x48/folder.png + ../monochrome_dark/icons/48x48/list-add.png + ../monochrome_dark/icons/48x48/sd_card.png + ../monochrome_dark/icons/48x48/star.png + ../monochrome_dark/icons/256x256/plus_folder.png + + + + icons/index.theme + ../monochrome_dark/icons/16x16/lock.png + ../monochrome_dark/icons/48x48/bad_folder.png + ../monochrome_dark/icons/48x48/chip.png + ../monochrome_dark/icons/48x48/folder.png + ../monochrome_dark/icons/48x48/list-add.png + ../monochrome_dark/icons/48x48/no_avatar.png + ../monochrome_dark/icons/48x48/sd_card.png + ../monochrome_dark/icons/48x48/star.png + ../monochrome_dark/icons/256x256/plus_folder.png + + diff --git a/suyu/dist/qt_themes/qdarkstyle_monochrome/icons/index.theme b/suyu/dist/qt_themes/qdarkstyle_monochrome/icons/index.theme new file mode 100644 index 0000000000..a8fd60ba29 --- /dev/null +++ b/suyu/dist/qt_themes/qdarkstyle_monochrome/icons/index.theme @@ -0,0 +1,14 @@ +[Icon Theme] +Name=qdarkstyle_monochrome +Comment=Monochrome dark theme (Mine Shaft style) +Inherits=qdarkstyle +Directories=16x16,48x48,256x256 + +[16x16] +Size=16 + +[48x48] +Size=48 + +[256x256] +Size=256 diff --git a/suyu/dist/qt_themes/qdarkstyle_monochrome/style.qrc b/suyu/dist/qt_themes/qdarkstyle_monochrome/style.qrc new file mode 100644 index 0000000000..76f7767ca8 --- /dev/null +++ b/suyu/dist/qt_themes/qdarkstyle_monochrome/style.qrc @@ -0,0 +1,8 @@ + + + ../qdarkstyle/dark.qss + + + ../qdarkstyle/dark.qss + + diff --git a/suyu/src/common/fs/fs_paths.h b/suyu/src/common/fs/fs_paths.h index 3720976efe..de06571a6f 100644 --- a/suyu/src/common/fs/fs_paths.h +++ b/suyu/src/common/fs/fs_paths.h @@ -15,6 +15,7 @@ #define CONFIG_DIR "config" #define CRASH_DUMPS_DIR "crash_dumps" #define DUMP_DIR "dump" +#define ICONS_DIR "icons" #define KEYS_DIR "keys" #define LOAD_DIR "load" #define LOG_DIR "log" @@ -24,7 +25,7 @@ #define SDMC_DIR "sdmc" #define SHADER_DIR "shader" #define TAS_DIR "tas" -#define ICONS_DIR "icons" +#define THEMES_DIR "qt_themes" // suyu-specific files diff --git a/suyu/src/common/fs/path_util.cpp b/suyu/src/common/fs/path_util.cpp index e23f53fb9d..9362e18c39 100644 --- a/suyu/src/common/fs/path_util.cpp +++ b/suyu/src/common/fs/path_util.cpp @@ -121,6 +121,7 @@ public: GenerateSuyuPath(SuyuPath::ConfigDir, suyu_path_config); GenerateSuyuPath(SuyuPath::CrashDumpsDir, suyu_path / CRASH_DUMPS_DIR); GenerateSuyuPath(SuyuPath::DumpDir, suyu_path / DUMP_DIR); + GenerateSuyuPath(SuyuPath::IconsDir, suyu_path / ICONS_DIR); GenerateSuyuPath(SuyuPath::KeysDir, suyu_path / KEYS_DIR); GenerateSuyuPath(SuyuPath::LoadDir, suyu_path / LOAD_DIR); GenerateSuyuPath(SuyuPath::LogDir, suyu_path / LOG_DIR); @@ -130,7 +131,7 @@ public: GenerateSuyuPath(SuyuPath::SDMCDir, suyu_path / SDMC_DIR); GenerateSuyuPath(SuyuPath::ShaderDir, suyu_path / SHADER_DIR); GenerateSuyuPath(SuyuPath::TASDir, suyu_path / TAS_DIR); - GenerateSuyuPath(SuyuPath::IconsDir, suyu_path / ICONS_DIR); + GenerateSuyuPath(SuyuPath::ThemesDir, suyu_path / THEMES_DIR); } private: diff --git a/suyu/src/common/fs/path_util.h b/suyu/src/common/fs/path_util.h index 2076fbcd43..1ac4a26eea 100644 --- a/suyu/src/common/fs/path_util.h +++ b/suyu/src/common/fs/path_util.h @@ -17,6 +17,7 @@ enum class SuyuPath { ConfigDir, // Where config files are stored. CrashDumpsDir, // Where crash dumps are stored. DumpDir, // Where dumped data is stored. + IconsDir, // Where Icons for Windows shortcuts are stored. KeysDir, // Where key files are stored. LoadDir, // Where cheat/mod files are stored. LogDir, // Where log files are stored. @@ -26,7 +27,7 @@ enum class SuyuPath { SDMCDir, // Where the emulated SDMC is stored. ShaderDir, // Where shaders are stored. TASDir, // Where TAS scripts are stored. - IconsDir, // Where Icons for Windows shortcuts are stored. + ThemesDir, // Where users should put their custom themes }; /** diff --git a/suyu/src/common/settings.cpp b/suyu/src/common/settings.cpp index 948c557674..3339d5b4f0 100644 --- a/suyu/src/common/settings.cpp +++ b/suyu/src/common/settings.cpp @@ -67,6 +67,7 @@ SWITCHABLE(u8, true); // Used in UISettings // TODO see if we can move this to uisettings.cpp SWITCHABLE(ConfirmStop, true); +SWITCHABLE(DarkModeState, true); #undef SETTING #undef SWITCHABLE diff --git a/suyu/src/common/settings.h b/suyu/src/common/settings.h index 98c3958c00..4e993ea622 100644 --- a/suyu/src/common/settings.h +++ b/suyu/src/common/settings.h @@ -88,6 +88,7 @@ SWITCHABLE(u8, true); // Used in UISettings // TODO see if we can move this to uisettings.h SWITCHABLE(ConfirmStop, true); +SWITCHABLE(DarkModeState, true); #undef SETTING #undef SWITCHABLE diff --git a/suyu/src/common/settings_enums.h b/suyu/src/common/settings_enums.h index fabae6d687..777f5b1b0a 100644 --- a/suyu/src/common/settings_enums.h +++ b/suyu/src/common/settings_enums.h @@ -155,6 +155,8 @@ ENUM(ConsoleMode, Handheld, Docked); ENUM(AppletMode, HLE, LLE); +ENUM(DarkModeState, Off, On, Auto); + template inline std::string CanonicalizeEnum(Type id) { const auto group = EnumMetadata::Canonicalizations(); diff --git a/suyu/src/suyu/applets/qt_controller.cpp b/suyu/src/suyu/applets/qt_controller.cpp index f27ab835e5..d41d23eceb 100644 --- a/suyu/src/suyu/applets/qt_controller.cpp +++ b/suyu/src/suyu/applets/qt_controller.cpp @@ -384,10 +384,12 @@ bool QtControllerSelectorDialog::CheckIfParametersMet() { void QtControllerSelectorDialog::SetSupportedControllers() { const QString theme = [] { - if (QIcon::themeName().contains(QStringLiteral("dark"))) { - return QStringLiteral("_dark"); - } else if (QIcon::themeName().contains(QStringLiteral("midnight"))) { + if (QIcon::themeName().contains(QStringLiteral("midnight"))) { return QStringLiteral("_midnight"); + } else if (GMainWindow::CheckDarkMode() || + QIcon::themeName().contains(QStringLiteral("dark"))) { + // Use dark icons if current OS mode is dark, or the theme contains "dark" in its name + return QStringLiteral("_dark"); } else { return QString{}; } @@ -572,10 +574,12 @@ void QtControllerSelectorDialog::UpdateControllerIcon(std::size_t player_index) } const QString theme = [] { - if (QIcon::themeName().contains(QStringLiteral("dark"))) { - return QStringLiteral("_dark"); - } else if (QIcon::themeName().contains(QStringLiteral("midnight"))) { + if (QIcon::themeName().contains(QStringLiteral("midnight"))) { return QStringLiteral("_midnight"); + } else if (GMainWindow::CheckDarkMode() || + QIcon::themeName().contains(QStringLiteral("dark"))) { + // Use dark icons if current OS mode is dark, or the theme contains "dark" in its name + return QStringLiteral("_dark"); } else { return QString{}; } diff --git a/suyu/src/suyu/applets/qt_software_keyboard.cpp b/suyu/src/suyu/applets/qt_software_keyboard.cpp index a1bcfa717e..3a88656a17 100644 --- a/suyu/src/suyu/applets/qt_software_keyboard.cpp +++ b/suyu/src/suyu/applets/qt_software_keyboard.cpp @@ -372,6 +372,14 @@ QtSoftwareKeyboardDialog::~QtSoftwareKeyboardDialog() { StopInputThread(); } +QString QtSoftwareKeyboardDialog::theme() { + if (GMainWindow::CheckDarkMode()) { + return QStringLiteral("_dark"); + } else { + return QString{}; + } +} + void QtSoftwareKeyboardDialog::ShowNormalKeyboard(QPoint pos, QSize size) { if (isVisible()) { return; @@ -382,6 +390,7 @@ void QtSoftwareKeyboardDialog::ShowNormalKeyboard(QPoint pos, QSize size) { SetKeyboardType(); SetPasswordMode(); SetControllerImage(); + SetButtonImages(); DisableKeyboardButtons(); SetBackspaceOkEnabled(); @@ -449,6 +458,7 @@ void QtSoftwareKeyboardDialog::ShowInlineKeyboard( SetKeyboardType(); SetControllerImage(); + SetButtonImages(); DisableKeyboardButtons(); SetBackspaceOkEnabled(); @@ -822,68 +832,146 @@ void QtSoftwareKeyboardDialog::SetControllerImage() { const auto controller_type = handheld->IsConnected() ? handheld->GetNpadStyleIndex() : player_1->GetNpadStyleIndex(); - const QString theme = [] { - if (QIcon::themeName().contains(QStringLiteral("dark")) || - QIcon::themeName().contains(QStringLiteral("midnight"))) { - return QStringLiteral("_dark"); - } else { - return QString{}; - } - }(); - switch (controller_type) { case Core::HID::NpadStyleIndex::Fullkey: case Core::HID::NpadStyleIndex::GameCube: ui->icon_controller->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_pro%1.png);").arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_pro.png);").arg(theme())); ui->icon_controller_shift->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_pro%1.png);").arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_pro.png);").arg(theme())); ui->icon_controller_num->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_pro%1.png);").arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_pro.png);").arg(theme())); break; case Core::HID::NpadStyleIndex::JoyconDual: ui->icon_controller->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_dual_joycon%1.png);").arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_dual_joycon.png);").arg(theme())); ui->icon_controller_shift->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_dual_joycon%1.png);").arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_dual_joycon.png);").arg(theme())); ui->icon_controller_num->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_dual_joycon%1.png);").arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_dual_joycon.png);").arg(theme())); break; case Core::HID::NpadStyleIndex::JoyconLeft: ui->icon_controller->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_single_joycon_left%1.png);") - .arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_single_joycon_left.png);") + .arg(theme())); ui->icon_controller_shift->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_single_joycon_left%1.png);") - .arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_single_joycon_left.png);") + .arg(theme())); ui->icon_controller_num->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_single_joycon_left%1.png);") - .arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_single_joycon_left.png);") + .arg(theme())); break; case Core::HID::NpadStyleIndex::JoyconRight: ui->icon_controller->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_single_joycon_right%1.png);") - .arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_single_joycon_right.png);") + .arg(theme())); ui->icon_controller_shift->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_single_joycon_right%1.png);") - .arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_single_joycon_right.png);") + .arg(theme())); ui->icon_controller_num->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_single_joycon_right%1.png);") - .arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_single_joycon_right.png);") + .arg(theme())); break; case Core::HID::NpadStyleIndex::Handheld: ui->icon_controller->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_handheld%1.png);").arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_handheld.png);").arg(theme())); ui->icon_controller_shift->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_handheld%1.png);").arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_handheld.png);").arg(theme())); ui->icon_controller_num->setStyleSheet( - QStringLiteral("image: url(:/overlay/controller_handheld%1.png);").arg(theme)); + QStringLiteral("image: url(:/overlay%1/controller_handheld.png);").arg(theme())); break; default: break; } } +void QtSoftwareKeyboardDialog::SetButtonImages() { + QString button_backspace_stylesheet = + QStringLiteral("QPushButton {" + " image: url(:/overlay%1/osk_button_B.png);" + " image-position: right;" + " qproperty-icon: url(:/overlay%1/osk_button_backspace.png); }" + "QPushButton:disabled { image: url(:/overlay%1/osk_button_B_disabled.png);}") + .arg(theme()); + ui->button_backspace->setStyleSheet(button_backspace_stylesheet); + ui->button_backspace_shift->setStyleSheet(button_backspace_stylesheet); + ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); + ui->button_backspace_num->setStyleSheet(button_backspace_stylesheet); + + QString button_space_stylesheet = + QStringLiteral("QPushButton {" + " image: url(:/overlay%1/osk_button_Y.png);" + " image-position: right;" + " qproperty-icon: url(:/overlay%1/osk_button_space.png); }" + "QPushButton:disabled { image: url(:/overlay%1/osk_button_Y_disabled.png);}") + .arg(theme()); + ui->button_space->setStyleSheet(button_space_stylesheet); + ui->button_space_shift->setStyleSheet(button_space_stylesheet); + + QString button_ok_stylesheet = + QStringLiteral( + "QPushButton { image: url(:/overlay%1/osk_button_plus.png); }" + "QPushButton:disabled { image: url(:/overlay%1/osk_button_plus_disabled.png); }") + .arg(theme()); + ui->button_ok->setStyleSheet(button_ok_stylesheet); + ui->button_ok_shift->setStyleSheet(button_ok_stylesheet); + ui->button_ok_num->setStyleSheet(button_ok_stylesheet); + + QString button_shift_stylesheet = + QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);" + "image-position: left;" + "qproperty-icon: url(:/overlay%1/osk_button_shift.png);") + .arg(theme()); + ui->button_shift->setStyleSheet(button_shift_stylesheet); + + QString button_shift_shift_stylesheet = + QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);" + "image-position: left;" + "qproperty-icon: url(:/overlay%1/osk_button_shift_on.png);") + .arg(theme()); + ui->button_shift_shift->setStyleSheet(button_shift_shift_stylesheet); + ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); + + QString L_stylesheet = QStringLiteral("image: url(:/overlay%1/button_L.png);").arg(theme()); + ui->button_L->setStyleSheet(L_stylesheet); + ui->button_L_shift->setStyleSheet(L_stylesheet); + ui->button_L_num->setStyleSheet(L_stylesheet); + + QString R_stylesheet = QStringLiteral("image: url(:/overlay%1/button_R.png);").arg(theme()); + ui->button_R->setStyleSheet(R_stylesheet); + ui->button_R_shift->setStyleSheet(R_stylesheet); + ui->button_R_num->setStyleSheet(R_stylesheet); + + QString arrow_left_stylesheet = + QStringLiteral("image: url(:/overlay%1/arrow_left.png);").arg(theme()); + ui->arrow_left->setStyleSheet(arrow_left_stylesheet); + ui->arrow_left_shift->setStyleSheet(arrow_left_stylesheet); + ui->arrow_left_num->setStyleSheet(arrow_left_stylesheet); + + QString arrow_right_stylesheet = + QStringLiteral("image: url(:/overlay%1/arrow_right.png);").arg(theme()); + ui->arrow_right->setStyleSheet(arrow_right_stylesheet); + ui->arrow_right_shift->setStyleSheet(arrow_right_stylesheet); + ui->arrow_right_num->setStyleSheet(arrow_right_stylesheet); + + QString button_press_stick_stylesheet = + QStringLiteral("image: url(:/overlay%1/button_press_stick.png);").arg(theme()); + ui->button_press_stick->setStyleSheet(button_press_stick_stylesheet); + ui->button_press_stick_shift->setStyleSheet(button_press_stick_stylesheet); + + QString button_X_stylesheet = + QStringLiteral("image: url(:/overlay%1/button_X.png);").arg(theme()); + ui->button_X->setStyleSheet(button_X_stylesheet); + ui->button_X_shift->setStyleSheet(button_X_stylesheet); + ui->button_X_num->setStyleSheet(button_X_stylesheet); + + QString button_A_stylesheet = + QStringLiteral("image: url(:/overlay%1/button_A.png);").arg(theme()); + ui->button_A->setStyleSheet(button_A_stylesheet); + ui->button_A_shift->setStyleSheet(button_A_stylesheet); + ui->button_A_num->setStyleSheet(button_A_stylesheet); +} + void QtSoftwareKeyboardDialog::DisableKeyboardButtons() { switch (bottom_osk_index) { case BottomOSKIndex::LowerCase: @@ -1050,10 +1138,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() { ui->bottomOSK->setCurrentIndex(static_cast(bottom_osk_index)); ui->button_shift_shift->setStyleSheet( - QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);" - "\nimage-position: left;")); + QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);")); - ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); break; case BottomOSKIndex::UpperCase: @@ -1064,9 +1150,6 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() { QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);" "\nimage-position: left;")); - ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); - ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); - ui->label_shift_shift->setText(QStringLiteral("Caps Lock")); bottom_osk_index = BottomOSKIndex::LowerCase; @@ -1078,9 +1161,6 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() { QStringLiteral("image: url(:/overlay/osk_button_shift_lock_on.png);" "\nimage-position: left;")); - ui->button_shift_shift->setIconSize(ui->button_shift->iconSize()); - ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize()); - ui->label_shift_shift->setText(QStringLiteral("Caps Lock Off")); } break; diff --git a/suyu/src/suyu/applets/qt_software_keyboard.h b/suyu/src/suyu/applets/qt_software_keyboard.h index 7e2fdf09ea..fda6ac623d 100644 --- a/suyu/src/suyu/applets/qt_software_keyboard.h +++ b/suyu/src/suyu/applets/qt_software_keyboard.h @@ -80,6 +80,12 @@ private: NumberPad, }; + /** + * Get the current theme suffix + * @return an empty string for light theme, "_dark" for dark theme + */ + QString theme(); + /** * Moves and resizes the window to a specified position and size. * @@ -109,6 +115,9 @@ private: /// Sets the controller image at the bottom left of the software keyboard. void SetControllerImage(); + /// Sets the controller image at the bottom left of the software keyboard. + void SetButtonImages(); + /// Disables buttons based on initialize_parameters. void DisableKeyboardButtons(); diff --git a/suyu/src/suyu/configuration/configure_input_player.ui b/suyu/src/suyu/configuration/configure_input_player.ui index 5beb1b6bfc..761015cd94 100644 --- a/suyu/src/suyu/configuration/configure_input_player.ui +++ b/suyu/src/suyu/configuration/configure_input_player.ui @@ -1430,12 +1430,12 @@ - - - 0 - 0 - - + + + 0 + 0 + + ZL @@ -1481,20 +1481,20 @@ - - - - 70 - 15 - - - - 100 - - - Qt::Horizontal - - + + + + 70 + 40 + + + + 100 + + + Qt::Horizontal + + @@ -1927,22 +1927,22 @@ - - - - - 70 - 15 - - - - 100 - - - Qt::Horizontal - - - + + + + + 70 + 40 + + + + 100 + + + Qt::Horizontal + + + diff --git a/suyu/src/suyu/configuration/configure_ui.cpp b/suyu/src/suyu/configuration/configure_ui.cpp index a3648c5b1c..589c035589 100644 --- a/suyu/src/suyu/configuration/configure_ui.cpp +++ b/suyu/src/suyu/configuration/configure_ui.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "common/common_types.h" #include "common/fs/path_util.h" @@ -29,6 +30,8 @@ #include "suyu/uisettings.h" #include "ui_configure_ui.h" +using Settings::DarkModeState; + namespace { constexpr std::array default_game_icon_sizes{ std::make_pair(0, QT_TRANSLATE_NOOP("ConfigureUI", "None")), @@ -106,11 +109,31 @@ ConfigureUi::ConfigureUi(Core::System& system_, QWidget* parent) InitializeLanguageComboBox(); - for (const auto& theme : UISettings::themes) { + for (const auto& theme : UISettings::included_themes) { ui->theme_combobox->addItem(QString::fromUtf8(theme.first), QString::fromUtf8(theme.second)); } + // Add custom styles stored in yuzu directory + const QDir themes_local_dir( + QString::fromStdString(Common::FS::GetSuyuPathString(Common::FS::SuyuPath::ThemesDir))); + for (const QString& theme_dir : + themes_local_dir.entryList(QDir::NoDot | QDir::NoDotDot | QDir::Dirs)) { + // folders ending with "_dark" are reserved for dark variant icons of other styles + if (theme_dir.endsWith(QStringLiteral("_dark"))) { + continue; + } + // Split at _ and capitalize words in name + QStringList cased_name; + for (QString word : theme_dir.split(QChar::fromLatin1('_'))) { + cased_name.append(word.at(0).toUpper() + word.mid(1)); + } + QString theme_name = cased_name.join(QChar::fromLatin1(' ')); + theme_name += QStringLiteral(" (%1)").arg(tr("Custom")); + + ui->theme_combobox->addItem(theme_name, themes_local_dir.filePath(theme_dir)); + } + InitializeIconSizeComboBox(); InitializeRowComboBoxes(); @@ -133,6 +156,9 @@ ConfigureUi::ConfigureUi(Core::System& system_, QWidget* parent) &ConfigureUi::RequestGameListUpdate); connect(ui->row_2_text_combobox, QOverload::of(&QComboBox::currentIndexChanged), this, &ConfigureUi::RequestGameListUpdate); + // Update available dark mode options depending on selected style + connect(ui->theme_combobox, QOverload::of(&QComboBox::currentIndexChanged), this, + &ConfigureUi::UpdateDarkModeOptions); // Update text ComboBoxes after user interaction. connect(ui->row_1_text_combobox, QOverload::of(&QComboBox::activated), @@ -164,7 +190,9 @@ ConfigureUi::~ConfigureUi() = default; void ConfigureUi::ApplyConfiguration() { UISettings::values.theme = - ui->theme_combobox->itemData(ui->theme_combobox->currentIndex()).toString().toStdString(); + ui->theme_combobox->itemData(ui->theme_combobox->currentIndex()).toString(); + UISettings::values.dark_mode_state = + static_cast(ui->dark_mode_combobox->currentData().toUInt()); UISettings::values.show_add_ons = ui->show_add_ons->isChecked(); UISettings::values.show_compat = ui->show_compat->isChecked(); UISettings::values.show_size = ui->show_size->isChecked(); @@ -186,13 +214,71 @@ void ConfigureUi::ApplyConfiguration() { system.ApplySettings(); } +void ConfigureUi::UpdateDarkModeOptions() { + ui->dark_mode_combobox->clear(); + + QString selected_theme = ui->theme_combobox->currentData().toString(); + + /* Dark mode option are added according to the modes the current style supports */ + bool has_common_style = QFile::exists(selected_theme + QStringLiteral("/style.qss")); + bool has_light_style = QFile::exists(selected_theme + QStringLiteral("/light.qss")); + bool has_dark_style = QFile::exists(selected_theme + QStringLiteral("/dark.qss")); +#ifdef _WIN32 + // Indicate which option needs a restart to be applied, depending on current environment + // variable + QByteArray current_qt_qpa = qgetenv("QT_QPA_PLATFORM"); + if (current_qt_qpa.contains("darkmode=2")) { + if (has_common_style || (has_dark_style && has_light_style)) { + ui->dark_mode_combobox->addItem(tr("Auto"), QVariant::fromValue(DarkModeState::Auto)); + } + if (has_common_style || has_dark_style) { + ui->dark_mode_combobox->addItem(tr("Always On") + + QStringLiteral(" (%1)").arg(tr("Needs restart")), + QVariant::fromValue(DarkModeState::On)); + } + if (has_common_style || has_light_style) { + ui->dark_mode_combobox->addItem(tr("Always Off") + + QStringLiteral(" (%1)").arg(tr("Needs restart")), + QVariant::fromValue(DarkModeState::Off)); + } + } else { + if (has_common_style || (has_dark_style && has_light_style)) { + ui->dark_mode_combobox->addItem(tr("Auto") + + QStringLiteral(" (%1)").arg(tr("Needs restart")), + QVariant::fromValue(DarkModeState::Auto)); + } + if (has_common_style || has_dark_style) { + ui->dark_mode_combobox->addItem(tr("Always On"), + QVariant::fromValue(DarkModeState::On)); + } + if (has_common_style || has_light_style) { + ui->dark_mode_combobox->addItem(tr("Always Off"), + QVariant::fromValue(DarkModeState::Off)); + } + } +#else + if (has_common_style || (has_dark_style && has_light_style)) { + ui->dark_mode_combobox->addItem(tr("Auto"), QVariant::fromValue(DarkModeState::Auto)); + } + if (has_common_style || has_dark_style) { + ui->dark_mode_combobox->addItem(tr("Always On"), QVariant::fromValue(DarkModeState::On)); + } + if (has_common_style || has_light_style) { + ui->dark_mode_combobox->addItem(tr("Always Off"), QVariant::fromValue(DarkModeState::Off)); + } +#endif +} + void ConfigureUi::RequestGameListUpdate() { UISettings::values.is_game_list_reload_pending.exchange(true); } void ConfigureUi::SetConfiguration() { - ui->theme_combobox->setCurrentIndex( - ui->theme_combobox->findData(QString::fromStdString(UISettings::values.theme))); + ui->theme_combobox->setCurrentIndex(ui->theme_combobox->findData(UISettings::values.theme)); + // Dark mode options are populated after the theme is selected, to get the current configuration + UpdateDarkModeOptions(); + ui->dark_mode_combobox->setCurrentIndex( + ui->dark_mode_combobox->findData(QVariant::fromValue(UISettings::values.dark_mode_state))); ui->language_combobox->setCurrentIndex(ui->language_combobox->findData( QString::fromStdString(UISettings::values.language.GetValue()))); ui->show_add_ons->setChecked(UISettings::values.show_add_ons.GetValue()); diff --git a/suyu/src/suyu/configuration/configure_ui.h b/suyu/src/suyu/configuration/configure_ui.h index 2a2563a131..a52ad7cc74 100644 --- a/suyu/src/suyu/configuration/configure_ui.h +++ b/suyu/src/suyu/configuration/configure_ui.h @@ -34,6 +34,7 @@ signals: void LanguageChanged(const QString& locale); private: + void UpdateDarkModeOptions(); void RequestGameListUpdate(); void SetConfiguration(); diff --git a/suyu/src/suyu/configuration/configure_ui.ui b/suyu/src/suyu/configuration/configure_ui.ui index b8e6483814..cdd46005fd 100644 --- a/suyu/src/suyu/configuration/configure_ui.ui +++ b/suyu/src/suyu/configuration/configure_ui.ui @@ -63,6 +63,20 @@ + + + + + + Dark Mode: + + + + + + + + diff --git a/suyu/src/suyu/configuration/qt_config.cpp b/suyu/src/suyu/configuration/qt_config.cpp index 37951b9c84..2ed14ee2be 100644 --- a/suyu/src/suyu/configuration/qt_config.cpp +++ b/suyu/src/suyu/configuration/qt_config.cpp @@ -260,9 +260,10 @@ void QtConfig::ReadShortcutValues() { void QtConfig::ReadUIValues() { BeginGroup(Settings::TranslateCategory(Settings::Category::Ui)); - UISettings::values.theme = ReadStringSetting( - std::string("theme"), - std::string(UISettings::themes[static_cast(UISettings::default_theme)].second)); + UISettings::values.theme = + QString::fromStdString(ReadStringSetting("theme", std::string(UISettings::default_theme))); + UISettings::values.dark_mode_state = static_cast( + ReadIntegerSetting("dark_mode_state", static_cast(DarkModeState::Auto))); ReadUIGamelistValues(); ReadUILayoutValues(); @@ -468,10 +469,10 @@ void QtConfig::SaveUIValues() { WriteCategory(Settings::Category::Ui); WriteCategory(Settings::Category::UiGeneral); - WriteStringSetting( - std::string("theme"), UISettings::values.theme, - std::make_optional(std::string( - UISettings::themes[static_cast(UISettings::default_theme)].second))); + WriteStringSetting("theme", UISettings::values.theme.toStdString(), + std::make_optional(std::string(UISettings::default_theme))); + WriteIntegerSetting("dark_mode_state", static_cast(UISettings::values.dark_mode_state), + std::make_optional(static_cast(DarkModeState::Auto))); SaveUIGamelistValues(); SaveUILayoutValues(); diff --git a/suyu/src/suyu/debugger/wait_tree.cpp b/suyu/src/suyu/debugger/wait_tree.cpp index b339862ba7..b5ee4bcfdf 100644 --- a/suyu/src/suyu/debugger/wait_tree.cpp +++ b/suyu/src/suyu/debugger/wait_tree.cpp @@ -35,9 +35,8 @@ constexpr std::array, 10> WaitTreeColors{{ }}; bool IsDarkTheme() { - const auto& theme = UISettings::values.theme; - return theme == std::string("qdarkstyle") || theme == std::string("qdarkstyle_midnight_blue") || - theme == std::string("colorful_dark") || theme == std::string("colorful_midnight_blue"); + return UISettings::values.theme.contains(QStringLiteral("dark")) || + UISettings::values.theme.contains(QStringLiteral("midnight")); } } // namespace diff --git a/suyu/src/suyu/main.cpp b/suyu/src/suyu/main.cpp index baa98f2849..42a5a6587c 100644 --- a/suyu/src/suyu/main.cpp +++ b/suyu/src/suyu/main.cpp @@ -8,6 +8,7 @@ #include #include #include + #include "core/hle/service/am/applet_manager.h" #include "core/loader/nca.h" #include "core/loader/nro.h" @@ -18,6 +19,9 @@ #endif #ifdef __unix__ #include +#include +#include +#include #include #include "common/linux/gamemode.h" #endif @@ -281,18 +285,6 @@ static void OverrideWindowsFont() { } #endif -bool GMainWindow::CheckDarkMode() { -#ifdef __unix__ - const QPalette test_palette(qApp->palette()); - const QColor text_color = test_palette.color(QPalette::Active, QPalette::Text); - const QColor window_color = test_palette.color(QPalette::Active, QPalette::Window); - return (text_color.value() > window_color.value()); -#else - // TODO: Windows - return false; -#endif // __unix__ -} - GMainWindow::GMainWindow(std::unique_ptr config_, bool has_broken_vulkan) : ui{std::make_unique()}, system{std::make_unique()}, input_subsystem{std::make_shared()}, config{std::move(config_)}, @@ -313,15 +305,12 @@ GMainWindow::GMainWindow(std::unique_ptr config_, bool has_broken_vulk ui->setupUi(this); statusBar()->hide(); - // Check dark mode before a theme is loaded - os_dark_mode = CheckDarkMode(); startup_icon_theme = QIcon::themeName(); - // fallback can only be set once, colorful theme icons are okay on both light/dark - QIcon::setFallbackThemeName(QStringLiteral("colorful")); + // fallback can only be set once, default theme icons are okay on both light/dark + QIcon::setFallbackThemeName(QStringLiteral("default")); QIcon::setFallbackSearchPaths(QStringList(QStringLiteral(":/icons"))); default_theme_paths = QIcon::themeSearchPaths(); - UpdateUITheme(); SetDiscordEnabled(UISettings::values.enable_discord_presence.GetValue()); discord_rpc->Update(); @@ -339,6 +328,7 @@ GMainWindow::GMainWindow(std::unique_ptr config_, bool has_broken_vulk SetDefaultUIGeometry(); RestoreUIState(); + UpdateUITheme(); ConnectMenuEvents(); ConnectWidgetEvents(); @@ -459,7 +449,10 @@ GMainWindow::GMainWindow(std::unique_ptr config_, bool has_broken_vulk SDL_EnableScreenSaver(); #endif +#ifdef __unix__ SetupPrepareForSleep(); + ListenColorSchemeChange(); +#endif QStringList args = QApplication::arguments(); @@ -1658,8 +1651,8 @@ void GMainWindow::OnDisplayTitleBars(bool show) { } } -void GMainWindow::SetupPrepareForSleep() { #ifdef __unix__ +void GMainWindow::SetupPrepareForSleep() { auto bus = QDBusConnection::systemBus(); if (bus.isConnected()) { const bool success = bus.connect( @@ -1673,8 +1666,8 @@ void GMainWindow::SetupPrepareForSleep() { } else { LOG_WARNING(Frontend, "QDBusConnection system bus is not connected"); } -#endif // __unix__ } +#endif // __unix__ void GMainWindow::OnPrepareForSleep(bool prepare_sleep) { if (emu_thread == nullptr) { @@ -3730,7 +3723,8 @@ void GMainWindow::ResetWindowSize1080() { } void GMainWindow::OnConfigure() { - const auto old_theme = UISettings::values.theme; + const QString old_theme = UISettings::values.theme; + DarkModeState old_dark_mode_state = UISettings::values.dark_mode_state; const bool old_discord_presence = UISettings::values.enable_discord_presence.GetValue(); const auto old_language_index = Settings::values.language_index.GetValue(); #ifdef __unix__ @@ -3789,7 +3783,8 @@ void GMainWindow::OnConfigure() { } InitializeHotkeys(); - if (UISettings::values.theme != old_theme) { + if (UISettings::values.theme != old_theme || + UISettings::values.dark_mode_state != old_dark_mode_state) { UpdateUITheme(); } if (UISettings::values.enable_discord_presence.GetValue() != old_discord_presence) { @@ -3805,8 +3800,6 @@ void GMainWindow::OnConfigure() { multiplayer_state->UpdateCredentials(); } - emit UpdateThemedIcons(); - const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false); if (reload || Settings::values.language_index.GetValue() != old_language_index) { game_list->PopulateAsync(UISettings::values.game_dirs); @@ -5047,9 +5040,105 @@ void GMainWindow::filterBarSetChecked(bool state) { emit(OnToggleFilterBar()); } +void GMainWindow::UpdateUITheme() { + const QString default_theme = QString::fromStdString(UISettings::default_theme.data()); + QString current_theme = UISettings::values.theme; + if (current_theme.isEmpty()) { + current_theme = default_theme; + } + + UpdateIcons(current_theme); + + /* Find the stylesheet to load */ + if (TryLoadStylesheet(current_theme)) { + return; + } + + // Reading new theme failed, loading default stylesheet + LOG_ERROR(Frontend, "Unable to open style \"{}\", fallback to the default theme", + current_theme.toStdString()); + + if (TryLoadStylesheet(QStringLiteral(":/%1").arg(default_theme))) { + return; + } + + // Reading default failed, loading empty stylesheet + LOG_ERROR(Frontend, "Unable to set default style, stylesheet file not found"); + + qApp->setStyleSheet({}); + setStyleSheet({}); +} + +void GMainWindow::UpdateIcons(const QString& theme_path) { + // Get the theme directory from its path + std::size_t last_slash = theme_path.toStdString().find_last_of("/"); + QString theme_dir = QString::fromStdString(theme_path.toStdString().substr(last_slash + 1)); + + // Append _dark to the theme name to use dark variant icons + if (CheckDarkMode()) { + LOG_DEBUG(Frontend, "Using icons from: {}", theme_dir.toStdString() + "_dark"); + QIcon::setThemeName(theme_dir + QStringLiteral("_dark")); + } else { + LOG_DEBUG(Frontend, "Using icons from: {}", theme_dir.toStdString()); + QIcon::setThemeName(theme_dir); + } + + const QString theme_directory{ + QString::fromStdString(Common::FS::GetSuyuPathString(Common::FS::SuyuPath::ThemesDir))}; + + // Set path for default icons + // Use icon resources from application binary and current theme local subdirectory, if it exists + QStringList theme_paths; + theme_paths << QString::fromStdString(":/icons") << QStringLiteral("%1").arg(theme_directory); + QIcon::setThemeSearchPaths(theme_paths); + + // Change current directory, to allow user themes to add their own icons + QDir::setCurrent(QStringLiteral("%1/%2").arg(theme_directory, UISettings::values.theme)); + + emit UpdateThemedIcons(); +} + +bool GMainWindow::TryLoadStylesheet(const QString& theme_uri) { + LOG_DEBUG(Frontend, "TryLoadStylesheet()"); + QString style_path; + + // Use themed stylesheet if it exists + if (CheckDarkMode()) { + style_path = theme_uri + QStringLiteral("/dark.qss"); + } else { + style_path = theme_uri + QStringLiteral("/light.qss"); + } + if (!QFile::exists(style_path)) { + LOG_DEBUG(Frontend, "No themed (light/dark) stylesheet, using default one"); + // Use common stylesheet if themed one does not exist + style_path = theme_uri + QStringLiteral("/style.qss"); + } + + // Loading stylesheet + QFile style_file(style_path); + if (style_file.open(QFile::ReadOnly | QFile::Text)) { + // Update the color palette before applying the stylesheet + UpdateThemePalette(); + + LOG_DEBUG(Frontend, "Loading stylesheet in: {}", theme_uri.toStdString()); + QTextStream ts_theme(&style_file); + qApp->setStyleSheet(ts_theme.readAll()); + setStyleSheet(ts_theme.readAll()); + SetCustomStylesheet(); + + return true; + } + // Opening the file failed + return false; +} + +bool GMainWindow::TryLoadStylesheet(const std::filesystem::path& theme_path) { + return TryLoadStylesheet(QString::fromStdString(theme_path.string() + "/")); +} + static void AdjustLinkColor() { QPalette new_pal(qApp->palette()); - if (UISettings::IsDarkTheme()) { + if (GMainWindow::CheckDarkMode()) { new_pal.setColor(QPalette::Link, QColor(0, 190, 255, 255)); } else { new_pal.setColor(QPalette::Link, QColor(0, 140, 200, 255)); @@ -5059,54 +5148,262 @@ static void AdjustLinkColor() { } } -void GMainWindow::UpdateUITheme() { - const QString default_theme = QString::fromUtf8( - UISettings::themes[static_cast(UISettings::default_theme)].second); - QString current_theme = QString::fromStdString(UISettings::values.theme); - - if (current_theme.isEmpty()) { - current_theme = default_theme; - } - +void GMainWindow::UpdateThemePalette() { + LOG_DEBUG(Frontend, "UpdateThemePalette()"); + QPalette themePalette(qApp->palette()); #ifdef _WIN32 - QIcon::setThemeName(current_theme); - AdjustLinkColor(); -#else - if (current_theme == QStringLiteral("default") || current_theme == QStringLiteral("colorful")) { - QIcon::setThemeName(current_theme == QStringLiteral("colorful") ? current_theme - : startup_icon_theme); - QIcon::setThemeSearchPaths(QStringList(default_theme_paths)); - if (CheckDarkMode()) { - current_theme = QStringLiteral("default_dark"); + QColor dark(25, 25, 25); + QString style_name; + if (CheckDarkMode()) { + // We check that the dark mode state is "On" and force a dark palette + if (UISettings::values.dark_mode_state == DarkModeState::On) { + // Set Default Windows Dark palette on Windows platforms to force Dark mode + themePalette.setColor(QPalette::Window, Qt::black); + themePalette.setColor(QPalette::WindowText, Qt::white); + themePalette.setColor(QPalette::Disabled, QPalette::WindowText, QColor(127, 127, 127)); + themePalette.setColor(QPalette::Base, Qt::black); + themePalette.setColor(QPalette::AlternateBase, dark); + themePalette.setColor(QPalette::ToolTipBase, Qt::white); + themePalette.setColor(QPalette::ToolTipText, Qt::black); + themePalette.setColor(QPalette::Text, Qt::white); + themePalette.setColor(QPalette::Disabled, QPalette::Text, QColor(127, 127, 127)); + themePalette.setColor(QPalette::Dark, QColor(128, 128, 128)); + themePalette.setColor(QPalette::Shadow, Qt::white); + themePalette.setColor(QPalette::Button, Qt::black); + themePalette.setColor(QPalette::ButtonText, Qt::white); + themePalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(127, 127, 127)); + themePalette.setColor(QPalette::BrightText, QColor(192, 192, 192)); + themePalette.setColor(QPalette::Link, QColor(0, 140, 200)); + themePalette.setColor(QPalette::Highlight, QColor(24, 70, 93)); + themePalette.setColor(QPalette::Disabled, QPalette::Highlight, QColor(0, 85, 255)); + themePalette.setColor(QPalette::HighlightedText, QColor(239, 240, 241)); + themePalette.setColor(QPalette::Disabled, QPalette::HighlightedText, + QColor(239, 240, 241)); } + + // AlternateBase is kept at rgb(233, 231, 227) or rgb(245, 245, 245) on Windows dark + // palette, fix this. Sometimes, it even is rgb(0, 0, 0), but uses a very light gray for + // alternate rows, do not know why + if (themePalette.alternateBase().color() == QColor(233, 231, 227) || + themePalette.alternateBase().color() == QColor(245, 245, 245) || + themePalette.alternateBase().color() == QColor(0, 0, 0)) { + themePalette.setColor(QPalette::AlternateBase, dark); + alternate_base_modified = true; + } + // Use fusion theme, since its close to windowsvista, but works well with a dark palette + style_name = QStringLiteral("fusion"); } else { - QIcon::setThemeName(current_theme); - QIcon::setThemeSearchPaths(QStringList(QStringLiteral(":/icons"))); - AdjustLinkColor(); + // Reset AlternateBase if it has been modified + if (alternate_base_modified) { + themePalette.setColor(QPalette::AlternateBase, QColor(245, 245, 245)); + alternate_base_modified = false; + } + // Reset light palette + themePalette = this->style()->standardPalette(); + // Reset Windows theme to the default + style_name = QStringLiteral("windowsvista"); + } + LOG_DEBUG(Frontend, "Using style: {}", style_name.toStdString()); + qApp->setStyle(style_name); +#elif defined(__APPLE__) + // Force the usage of the light palette in light mode + if (CheckDarkMode()) { + // Reset dark palette + themePalette = this->style()->standardPalette(); + } else { + themePalette.setColor(QPalette::Window, QColor(236, 236, 236)); + themePalette.setColor(QPalette::WindowText, Qt::black); + themePalette.setColor(QPalette::Disabled, QPalette::WindowText, Qt::black); + themePalette.setColor(QPalette::Base, Qt::white); + themePalette.setColor(QPalette::AlternateBase, QColor(245, 245, 245)); + themePalette.setColor(QPalette::ToolTipBase, Qt::white); + themePalette.setColor(QPalette::ToolTipText, Qt::black); + themePalette.setColor(QPalette::Text, Qt::black); + themePalette.setColor(QPalette::Disabled, QPalette::Text, Qt::black); + themePalette.setColor(QPalette::Dark, QColor(191, 191, 191)); + themePalette.setColor(QPalette::Shadow, Qt::black); + themePalette.setColor(QPalette::Button, QColor(236, 236, 236)); + themePalette.setColor(QPalette::ButtonText, Qt::black); + themePalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(147, 147, 147)); + themePalette.setColor(QPalette::BrightText, Qt::white); + themePalette.setColor(QPalette::Link, QColor(0, 140, 200)); + themePalette.setColor(QPalette::Highlight, QColor(179, 215, 255)); + themePalette.setColor(QPalette::Disabled, QPalette::Highlight, QColor(220, 220, 220)); + themePalette.setColor(QPalette::HighlightedText, Qt::black); + themePalette.setColor(QPalette::Disabled, QPalette::HighlightedText, Qt::black); + } +#else + if (CheckDarkMode()) { + // Set Dark palette on non Windows platforms (that may not have a dark palette) + themePalette.setColor(QPalette::Window, QColor(53, 53, 53)); + themePalette.setColor(QPalette::WindowText, Qt::white); + themePalette.setColor(QPalette::Disabled, QPalette::WindowText, QColor(127, 127, 127)); + themePalette.setColor(QPalette::Base, QColor(42, 42, 42)); + themePalette.setColor(QPalette::AlternateBase, QColor(66, 66, 66)); + themePalette.setColor(QPalette::ToolTipBase, Qt::white); + themePalette.setColor(QPalette::ToolTipText, QColor(53, 53, 53)); + themePalette.setColor(QPalette::Text, Qt::white); + themePalette.setColor(QPalette::Disabled, QPalette::Text, QColor(127, 127, 127)); + themePalette.setColor(QPalette::Dark, QColor(35, 35, 35)); + themePalette.setColor(QPalette::Shadow, QColor(20, 20, 20)); + themePalette.setColor(QPalette::Button, QColor(53, 53, 53)); + themePalette.setColor(QPalette::ButtonText, Qt::white); + themePalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(127, 127, 127)); + themePalette.setColor(QPalette::BrightText, Qt::red); + themePalette.setColor(QPalette::Link, QColor(42, 130, 218)); + themePalette.setColor(QPalette::Highlight, QColor(42, 130, 218)); + themePalette.setColor(QPalette::Disabled, QPalette::Highlight, QColor(80, 80, 80)); + themePalette.setColor(QPalette::HighlightedText, Qt::white); + themePalette.setColor(QPalette::Disabled, QPalette::HighlightedText, QColor(127, 127, 127)); + } else { + // Reset light palette + themePalette = this->style()->standardPalette(); } #endif - if (current_theme != default_theme) { - QString theme_uri{QStringLiteral(":%1/style.qss").arg(current_theme)}; - QFile f(theme_uri); - if (!f.open(QFile::ReadOnly | QFile::Text)) { - LOG_ERROR(Frontend, "Unable to open style \"{}\", fallback to the default theme", - UISettings::values.theme); - current_theme = default_theme; + qApp->setPalette(themePalette); + AdjustLinkColor(); +} + +void GMainWindow::SetCustomStylesheet() { + setStyleSheet(QStringLiteral("QStatusBar::item { border: none; }")); + + // Set "dark" qss property value, that may be used in stylesheets + bool is_dark_mode = CheckDarkMode(); + if (renderer_status_button) { + renderer_status_button->setProperty("dark", is_dark_mode); + } + if (gpu_accuracy_button) { + gpu_accuracy_button->setProperty("dark", is_dark_mode); + } +#ifdef _WIN32 + // Windows dark mode uses "fusion" style. Make it look like more "windowsvista" light style + if (is_dark_mode) { + /* the groove expands to the size of the slider by default. by giving it a height, it has a + fixed size */ + /* handle is placed by default on the contents rect of the groove. Negative margin expands + it outside the groove */ + setStyleSheet(QStringLiteral("QSlider:horizontal{ height:30px; }\ + QSlider::sub-page:horizontal { background-color: palette(highlight); }\ + QSlider::add-page:horizontal { background-color: palette(midlight);}\ + QSlider::groove:horizontal { border-width: 1px; margin: 1px 0; height: 2px;}\ + QSlider::handle:horizontal { border-width: 1px; border-style: solid; border-color: palette(dark);\ + width: 10px; margin: -10px 0px; }\ + QSlider::handle { background-color: palette(button); }\ + QSlider::handle:hover { background-color: palette(highlight); }")); + } +#endif +} + +#ifdef __unix__ +bool GMainWindow::ListenColorSchemeChange() { + auto bus = QDBusConnection::sessionBus(); + if (bus.isConnected()) { + const QString dbus_service = QStringLiteral("org.freedesktop.portal.Desktop"); + const QString dbus_path = QStringLiteral("/org/freedesktop/portal/desktop"); + const QString dbus_interface = QStringLiteral("org.freedesktop.portal.Settings"); + const QString dbus_method = QStringLiteral("SettingChanged"); + QStringList dbus_arguments; + dbus_arguments << QStringLiteral("org.freedesktop.appearance") + << QStringLiteral("color-scheme"); + const QString dbus_signature = QStringLiteral("ssv"); + + LOG_INFO(Frontend, "Connected to DBus, listening for OS theme changes"); + return bus.connect(dbus_service, dbus_path, dbus_interface, dbus_method, dbus_arguments, + dbus_signature, this, SLOT(UpdateUITheme())); + } + LOG_WARNING(Frontend, "Unable to connect to DBus to listen for OS theme changes"); + return false; +} +#endif + +bool GMainWindow::CheckDarkMode() { + bool is_dark_mode_auto; +#ifdef _WIN32 + // Dark mode cannot be changed after the app started on Windows + is_dark_mode_auto = qgetenv("QT_QPA_PLATFORM").contains("darkmode=2"); +#else + is_dark_mode_auto = UISettings::values.dark_mode_state == DarkModeState::Auto; +#endif + if (!is_dark_mode_auto) { + return UISettings::values.dark_mode_state == DarkModeState::On; + } else { + const QPalette current_palette(qApp->palette()); +#ifdef __unix__ + QProcess process; + + // Using the freedesktop specifications for checking dark mode + LOG_DEBUG(Frontend, "Retrieving theme from freedesktop color-scheme..."); + QStringList gdbus_arguments; + gdbus_arguments << QStringLiteral("--dest=org.freedesktop.portal.Desktop") + << QStringLiteral("--object-path /org/freedesktop/portal/desktop") + << QStringLiteral("--method org.freedesktop.portal.Settings.Read") + << QStringLiteral("org.freedesktop.appearance color-scheme"); + process.start(QStringLiteral("gdbus call --session"), gdbus_arguments); + process.waitForFinished(1000); + QByteArray dbus_output = process.readAllStandardOutput(); + + if (!dbus_output.isEmpty()) { + const int systemColorSchema = QString::fromUtf8(dbus_output).trimmed().right(1).toInt(); + return systemColorSchema == 1; + } + + // Try alternative for Gnome if the previous one failed + QStringList gsettings_arguments; + gsettings_arguments << QStringLiteral("get") + << QStringLiteral("org.gnome.desktop.interface") + << QStringLiteral("color-scheme"); + + LOG_DEBUG(Frontend, "failed, retrieving theme from gsettings color-scheme..."); + process.start(QStringLiteral("gsettings"), gsettings_arguments); + process.waitForFinished(1000); + QByteArray gsettings_output = process.readAllStandardOutput(); + + // Try older gtk-theme method if the previous one failed + if (gsettings_output.isEmpty()) { + LOG_DEBUG(Frontend, "failed, retrieving theme from gtk-theme..."); + gsettings_arguments.takeLast(); + gsettings_arguments << QStringLiteral("gtk-theme"); + + process.start(QStringLiteral("gsettings"), gsettings_arguments); + process.waitForFinished(1000); + gsettings_output = process.readAllStandardOutput(); + } + + // Interpret gsettings value if it succeeded + if (!gsettings_output.isEmpty()) { + QString systeme_theme = QString::fromUtf8(gsettings_output); + LOG_DEBUG(Frontend, "Gsettings output: {}", systeme_theme.toStdString()); + return systeme_theme.contains(QStringLiteral("dark"), Qt::CaseInsensitive); + } + LOG_DEBUG(Frontend, "failed, retrieving theme from palette"); +#endif + // Use default method based on palette swap by OS. It is the only method on Windows with + // Qt 5. Windows needs QT_QPA_PLATFORM env variable set to windows:darkmode=2 to force + // palette change + return (current_palette.color(QPalette::WindowText).lightness() > + current_palette.color(QPalette::Window).lightness()); + } +} + +void GMainWindow::changeEvent(QEvent* event) { + // PaletteChange event appears to only reach so far into the GUI, explicitly asking to + // UpdateUITheme is a decent work around + if (event->type() == QEvent::PaletteChange || + event->type() == QEvent::ApplicationPaletteChange) { + LOG_DEBUG(Frontend, + "Window color palette changed by event: {} (QEvent::PaletteChange is: {})", + event->type(), QEvent::PaletteChange); + const QPalette test_palette(qApp->palette()); + // Keeping eye on QPalette::Window to avoid looping. QPalette::Text might be useful too + const QColor window_color = test_palette.color(QPalette::Active, QPalette::Window); + + if (last_window_color != window_color) { + last_window_color = window_color; + + UpdateUITheme(); } } - - QString theme_uri{QStringLiteral(":%1/style.qss").arg(current_theme)}; - QFile f(theme_uri); - if (f.open(QFile::ReadOnly | QFile::Text)) { - QTextStream ts(&f); - qApp->setStyleSheet(ts.readAll()); - setStyleSheet(ts.readAll()); - } else { - LOG_ERROR(Frontend, "Unable to set style \"{}\", stylesheet file not found", - UISettings::values.theme); - qApp->setStyleSheet({}); - setStyleSheet({}); - } + QWidget::changeEvent(event); } void GMainWindow::LoadTranslation() { @@ -5161,26 +5458,6 @@ void GMainWindow::SetGamemodeEnabled(bool state) { } #endif -void GMainWindow::changeEvent(QEvent* event) { -#ifdef __unix__ - // PaletteChange event appears to only reach so far into the GUI, explicitly asking to - // UpdateUITheme is a decent work around - if (event->type() == QEvent::PaletteChange) { - const QPalette test_palette(qApp->palette()); - const QString current_theme = QString::fromStdString(UISettings::values.theme); - // Keeping eye on QPalette::Window to avoid looping. QPalette::Text might be useful too - static QColor last_window_color; - const QColor window_color = test_palette.color(QPalette::Active, QPalette::Window); - if (last_window_color != window_color && (current_theme == QStringLiteral("default") || - current_theme == QStringLiteral("colorful"))) { - UpdateUITheme(); - } - last_window_color = window_color; - } -#endif // __unix__ - QWidget::changeEvent(event); -} - Service::AM::FrontendAppletParameters GMainWindow::ApplicationAppletParameters() { return Service::AM::FrontendAppletParameters{ .applet_id = Service::AM::AppletId::Application, @@ -5307,6 +5584,31 @@ int main(int argc, char* argv[]) { QCoreApplication::setApplicationName(QStringLiteral("suyu")); #ifdef _WIN32 + QByteArray current_qt_qpa = qgetenv("QT_QPA_PLATFORM"); + // Follow dark mode setting, if the "-platform" launch option is not set. + // Otherwise, just follow dark mode for the window decoration (title bar). + if (!current_qt_qpa.contains(":darkmode=")) { + if (UISettings::values.dark_mode_state == DarkModeState::Auto) { + // When setting is Auto, force adapting window decoration and stylesheet palette to use + // Windows theme. Default is darkmode:0, which always uses light palette + if (current_qt_qpa.isEmpty()) { + // Set the value + qputenv("QT_QPA_PLATFORM", QByteArray("windows:darkmode=2")); + } else { + // Concatenate to the existing value + qputenv("QT_QPA_PLATFORM", current_qt_qpa + ",darkmode=2"); + } + } else { + // When setting is no Auto, adapt window decoration to the palette used + if (current_qt_qpa.isEmpty()) { + // Set the value + qputenv("QT_QPA_PLATFORM", QByteArray("windows:darkmode=1")); + } else { + // Concatenate to the existing value + qputenv("QT_QPA_PLATFORM", current_qt_qpa + ",darkmode=1"); + } + } + } // Increases the maximum open file limit to 8192 _setmaxstdio(8192); #endif diff --git a/suyu/src/suyu/main.h b/suyu/src/suyu/main.h index b2b0f9afc4..e17c8c0607 100644 --- a/suyu/src/suyu/main.h +++ b/suyu/src/suyu/main.h @@ -25,9 +25,8 @@ #include "suyu/util/controller_navigation.h" #ifdef __unix__ +#include #include -#include -#include #endif class QtConfig; @@ -168,7 +167,7 @@ class GMainWindow : public QMainWindow { public: void filterBarSetChecked(bool state); - void UpdateUITheme(); + static bool CheckDarkMode(); explicit GMainWindow(std::unique_ptr config_, bool has_broken_vulkan); ~GMainWindow() override; @@ -260,12 +259,44 @@ private: void SetDefaultUIGeometry(); void RestoreUIState(); + /** + * Load the icons used by the current theme. Use dark icons if the current mode is dark + */ + void UpdateIcons(const QString& theme_used); + /** + * Set the palette used by the stylsheet for the dark/light mode selected, according to the OS + */ + void UpdateThemePalette(); + /** + * Try to load a stylesheet from its URI. + * If the path starts with ":/", its embedded in the app, otherwise its in a local directory + * @returns true if the text file could be opened as read-only + */ + bool TryLoadStylesheet(const QString& theme_uri); + /** + * Try to load a stylesheet from filesystem path + * @returns true if the text file could be opened as read-only + */ + bool TryLoadStylesheet(const std::filesystem::path& theme_path); + /** + * Default customizations to the stylesheets + */ + void SetCustomStylesheet(); +#ifdef __unix__ + /** + * Create a signal to update the UI theme when the OS color scheme is changed + * @returns true if we could connect to dbus + */ + bool ListenColorSchemeChange(); +#endif void ConnectWidgetEvents(); void ConnectMenuEvents(); void UpdateMenuState(); +#ifdef __unix__ void SetupPrepareForSleep(); +#endif void PreventOSSleep(); void AllowOSSleep(); @@ -397,6 +428,7 @@ private slots: void ResetWindowSize720(); void ResetWindowSize900(); void ResetWindowSize1080(); + void UpdateUITheme(); void OnAlbum(); void OnCabinet(Service::NFP::CabinetMode mode); void OnMiiEdit(); @@ -443,7 +475,7 @@ private: void OpenURL(const QUrl& url); void LoadTranslation(); void OpenPerGameConfiguration(u64 title_id, const std::string& file_name); - bool CheckDarkMode(); + bool CheckSystemArchiveDecryption(); bool CheckFirmwarePresence(); void SetFirmwareVersion(); void ConfigureFilesystemProvider(const std::string& filepath); @@ -527,7 +559,8 @@ private: QTimer update_input_timer; QString startup_icon_theme; - bool os_dark_mode = false; + bool alternate_base_modified = false; + QColor last_window_color; // FS std::shared_ptr vfs; diff --git a/suyu/src/suyu/startup_checks.cpp b/suyu/src/suyu/startup_checks.cpp index 292fbcbbaa..07e8bcb5d8 100644 --- a/suyu/src/suyu/startup_checks.cpp +++ b/suyu/src/suyu/startup_checks.cpp @@ -5,6 +5,7 @@ #ifdef _WIN32 #include +#include #include #include #elif defined(SUYU_UNIX) diff --git a/suyu/src/suyu/uisettings.cpp b/suyu/src/suyu/uisettings.cpp index 60d4063c8c..7cf32ddd0e 100644 --- a/suyu/src/suyu/uisettings.cpp +++ b/suyu/src/suyu/uisettings.cpp @@ -22,21 +22,15 @@ namespace FS = Common::FS; namespace UISettings { -const Themes themes{{ - {"Default", "default"}, - {"Default Colorful", "colorful"}, - {"Dark", "qdarkstyle"}, - {"Dark Colorful", "colorful_dark"}, - {"Midnight Blue", "qdarkstyle_midnight_blue"}, - {"Midnight Blue Colorful", "colorful_midnight_blue"}, +const Themes included_themes{{ + {"Default", ":/default"}, + {"Default monochrome", ":/monochrome"}, + {"Mine Shaft", ":/qdarkstyle"}, + {"Mine Shaft monochrome", ":/qdarkstyle_monochrome"}, + {"Midnight Blue", ":/qdarkstyle_midnight_blue"}, + {"Midnight Blue monochrome", ":/qdarkstyle_midnight_blue_monochrome"}, }}; -bool IsDarkTheme() { - const auto& theme = UISettings::values.theme; - return theme == std::string("qdarkstyle") || theme == std::string("qdarkstyle_midnight_blue") || - theme == std::string("colorful_dark") || theme == std::string("colorful_midnight_blue"); -} - Values values = {}; u32 CalculateWidth(u32 height, Settings::AspectRatio ratio) { diff --git a/suyu/src/suyu/uisettings.h b/suyu/src/suyu/uisettings.h index cab889680f..ded6a42244 100644 --- a/suyu/src/suyu/uisettings.h +++ b/suyu/src/suyu/uisettings.h @@ -18,6 +18,7 @@ using Settings::Category; using Settings::ConfirmStop; +using Settings::DarkModeState; using Settings::Setting; using Settings::SwitchableSetting; @@ -35,8 +36,6 @@ extern template class Setting; namespace UISettings { -bool IsDarkTheme(); - struct ContextualShortcut { std::string keyseq; std::string controller_keyseq; @@ -50,25 +49,10 @@ struct Shortcut { ContextualShortcut shortcut; }; -enum class Theme { - Default, - DefaultColorful, - Dark, - DarkColorful, - MidnightBlue, - MidnightBlueColorful, -}; - -static constexpr Theme default_theme{ -#ifdef _WIN32 - Theme::DarkColorful -#else - Theme::DefaultColorful -#endif -}; +static constexpr std::string_view default_theme{":/default"}; using Themes = std::array, 6>; -extern const Themes themes; +extern const Themes included_themes; struct GameDir { std::string path; @@ -160,7 +144,8 @@ struct Values { QStringList recent_files; Setting language{linkage, {}, "language", Category::Paths}; - std::string theme; + QString theme; + DarkModeState dark_mode_state; // Shortcut name std::vector shortcuts; @@ -278,3 +263,4 @@ Q_DECLARE_METATYPE(Settings::RendererBackend); Q_DECLARE_METATYPE(Settings::ShaderBackend); Q_DECLARE_METATYPE(Settings::AstcRecompression); Q_DECLARE_METATYPE(Settings::AstcDecodeMode); +Q_DECLARE_METATYPE(Settings::DarkModeState); diff --git a/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt b/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt index 2e89255668..7295a15c0a 100644 --- a/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt +++ b/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/AppConfig.kt @@ -7,6 +7,7 @@ package com.v2ray.ang object AppConfig { const val ANG_PACKAGE = BuildConfig.APPLICATION_ID const val DIR_ASSETS = "assets" + const val DIR_BACKUPS = "backups" // legacy const val ANG_CONFIG = "ang_config" diff --git a/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/AboutActivity.kt b/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/AboutActivity.kt index 22baf9889d..6c1637ccf1 100644 --- a/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/AboutActivity.kt +++ b/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/AboutActivity.kt @@ -1,15 +1,27 @@ package com.v2ray.ang.ui +import android.Manifest +import android.content.Intent +import android.os.Build import android.os.Bundle +import androidx.activity.result.contract.ActivityResultContracts +import com.tbruyelle.rxpermissions.RxPermissions +import com.tencent.mmkv.MMKV import com.v2ray.ang.AppConfig import com.v2ray.ang.BuildConfig import com.v2ray.ang.R import com.v2ray.ang.databinding.ActivityAboutBinding +import com.v2ray.ang.extension.toast import com.v2ray.ang.util.SpeedtestUtil import com.v2ray.ang.util.Utils +import com.v2ray.ang.util.ZipUtil +import java.io.File +import java.text.SimpleDateFormat +import java.util.Locale class AboutActivity : BaseActivity() { private lateinit var binding: ActivityAboutBinding + private val extDir by lazy { File(Utils.backupPath(this)) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -19,6 +31,31 @@ class AboutActivity : BaseActivity() { title = getString(R.string.title_about) + binding.tvBackupSummary.text = this.getString(R.string.summary_configuration_backup, extDir) + binding.layoutBackup.setOnClickListener { + backupMMKV() + } + + binding.layoutRestore.setOnClickListener { + val permission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + Manifest.permission.READ_MEDIA_IMAGES + } else { + Manifest.permission.READ_EXTERNAL_STORAGE + } + RxPermissions(this) + .request(permission) + .subscribe { + if (it) { + try { + showFileChooser() + } catch (e: Exception) { + e.printStackTrace() + } + } else + toast(R.string.toast_permission_denied) + } + } + binding.layoutSoureCcode.setOnClickListener { Utils.openUri(this, AppConfig.v2rayNGUrl) } @@ -38,9 +75,79 @@ class AboutActivity : BaseActivity() { "v${BuildConfig.VERSION_NAME} (${SpeedtestUtil.getLibVersion()})".also { binding.tvVersion.text = it } - - } + fun backupMMKV() { + val dateFormated = SimpleDateFormat( + "yyyy-MM-dd-HH-mm-ss", + Locale.getDefault() + ).format(System.currentTimeMillis()) + val folderName = "${getString(R.string.app_name)}_${dateFormated}" + val backupDir = this.cacheDir.absolutePath + "/$folderName" + val outputZipFilePath = extDir.absolutePath + "/$folderName.zip" -} + val count = MMKV.backupAllToDirectory(backupDir) + if (count <= 0) { + toast(R.string.toast_failure) + } + + if (ZipUtil.zipFromFolder(backupDir, outputZipFilePath)) { + toast(R.string.toast_success) + } else { + toast(R.string.toast_failure) + } + } + + fun restoreMMKV(zipFile: File) { + val backupDir = this.cacheDir.absolutePath + "/${System.currentTimeMillis()}" + + if (!ZipUtil.unzipToFolder(zipFile, backupDir)) { + toast(R.string.toast_failure) + } + + val count = MMKV.restoreAllFromDirectory(backupDir) + if (count > 0) { + toast(R.string.toast_success) + } else { + toast(R.string.toast_failure) + } + } + + private fun showFileChooser() { + val intent = Intent(Intent.ACTION_GET_CONTENT) + intent.type = "*/*" + intent.addCategory(Intent.CATEGORY_OPENABLE) + + try { + chooseFile.launch(Intent.createChooser(intent, getString(R.string.title_file_chooser))) + } catch (ex: android.content.ActivityNotFoundException) { + toast(R.string.toast_require_file_manager) + } + } + + private val chooseFile = + registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { + val uri = it.data?.data + if (it.resultCode == RESULT_OK && uri != null) { + try { + try { + val targetFile = + File(this.cacheDir.absolutePath, "${System.currentTimeMillis()}.zip") + contentResolver.openInputStream(uri).use { input -> + targetFile.outputStream().use { fileOut -> + input?.copyTo(fileOut) + } + } + + restoreMMKV(targetFile) + } catch (e: Exception) { + e.printStackTrace() + } + + } catch (e: Exception) { + e.printStackTrace() + toast(e.message.toString()) + } + } + } +} \ No newline at end of file diff --git a/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt b/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt index 4715363396..0fdc564f09 100644 --- a/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt +++ b/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt @@ -1,11 +1,8 @@ package com.v2ray.ang.util +import android.content.ClipData import android.content.ClipboardManager import android.content.Context -import android.text.Editable -import android.util.Base64 -import java.util.* -import android.content.ClipData import android.content.Intent import android.content.pm.PackageManager import android.content.res.Configuration.UI_MODE_NIGHT_MASK @@ -14,6 +11,8 @@ import android.net.Uri import android.os.Build import android.os.LocaleList import android.provider.Settings +import android.text.Editable +import android.util.Base64 import android.util.Log import android.util.Patterns import android.webkit.URLUtil @@ -23,9 +22,10 @@ import com.v2ray.ang.AppConfig.ANG_PACKAGE import com.v2ray.ang.BuildConfig import com.v2ray.ang.R import com.v2ray.ang.extension.toast -import java.net.* import com.v2ray.ang.service.V2RayServiceManager import java.io.IOException +import java.net.* +import java.util.* object Utils { @@ -318,6 +318,14 @@ object Utils { return extDir.absolutePath } + fun backupPath(context: Context?): String { + if (context == null) + return "" + val extDir = context.getExternalFilesDir(AppConfig.DIR_BACKUPS) + ?: return context.getDir(AppConfig.DIR_BACKUPS, 0).absolutePath + return extDir.absolutePath + } + fun getDeviceIdForXUDPBaseKey(): String { val androidId = Settings.Secure.ANDROID_ID.toByteArray(charset("UTF-8")) return Base64.encodeToString(androidId.copyOf(32), Base64.NO_PADDING.or(Base64.URL_SAFE)) diff --git a/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/ZipUtil.kt b/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/ZipUtil.kt new file mode 100644 index 0000000000..5343f6d818 --- /dev/null +++ b/v2rayng/V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/ZipUtil.kt @@ -0,0 +1,102 @@ +package com.v2ray.ang.util + +import java.io.BufferedOutputStream +import java.io.File +import java.io.FileInputStream +import java.io.FileOutputStream +import java.io.IOException +import java.io.InputStream +import java.util.zip.ZipEntry +import java.util.zip.ZipFile +import java.util.zip.ZipOutputStream + +object ZipUtil { + private const val BUFFER_SIZE = 4096 + + @Throws(IOException::class) + fun zipFromFolder(folderPath: String, outputZipFilePath: String): Boolean { + val buffer = ByteArray(BUFFER_SIZE) + + try { + if (folderPath.isEmpty() || outputZipFilePath.isEmpty()) { + return false + } + + val filesToCompress = ArrayList() + val directory = File(folderPath) + if (directory.isDirectory) { + directory.listFiles()?.forEach { + if (it.isFile) { + filesToCompress.add(it.absolutePath) + } + } + } + if (filesToCompress.isEmpty()) { + return false + } + + val zos = ZipOutputStream(FileOutputStream(outputZipFilePath)) + + filesToCompress.forEach { file -> + val ze = ZipEntry(File(file).name) + zos.putNextEntry(ze) + val inputStream = FileInputStream(file) + while (true) { + val len = inputStream.read(buffer) + if (len <= 0) break + zos.write(buffer, 0, len) + } + + inputStream.close() + } + + zos.closeEntry() + zos.close() + } catch (e: Exception) { + e.printStackTrace() + return false + } + return true + } + + @Throws(IOException::class) + fun unzipToFolder(zipFile: File, destDirectory: String): Boolean { + File(destDirectory).run { + if (!exists()) { + mkdirs() + } + } + try { + ZipFile(zipFile).use { zip -> + zip.entries().asSequence().forEach { entry -> + zip.getInputStream(entry).use { input -> + val filePath = destDirectory + File.separator + entry.name + if (!entry.isDirectory) { + // if the entry is a file, extracts it + extractFile(input, filePath) + } else { + // if the entry is a directory, make the directory + val dir = File(filePath) + dir.mkdir() + } + } + } + } + } catch (e: Exception) { + e.printStackTrace() + return false + } + return true + } + + @Throws(IOException::class) + private fun extractFile(inputStream: InputStream, destFilePath: String) { + val bos = BufferedOutputStream(FileOutputStream(destFilePath)) + val bytesIn = ByteArray(BUFFER_SIZE) + var read: Int + while (inputStream.read(bytesIn).also { read = it } != -1) { + bos.write(bytesIn, 0, read) + } + bos.close() + } +} \ No newline at end of file diff --git a/v2rayng/V2rayNG/app/src/main/res/drawable-night/ic_backup_24dp.xml b/v2rayng/V2rayNG/app/src/main/res/drawable-night/ic_backup_24dp.xml new file mode 100644 index 0000000000..9f774c85e0 --- /dev/null +++ b/v2rayng/V2rayNG/app/src/main/res/drawable-night/ic_backup_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/v2rayng/V2rayNG/app/src/main/res/drawable-night/ic_restore_24dp.xml b/v2rayng/V2rayNG/app/src/main/res/drawable-night/ic_restore_24dp.xml new file mode 100644 index 0000000000..6b372816d9 --- /dev/null +++ b/v2rayng/V2rayNG/app/src/main/res/drawable-night/ic_restore_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/v2rayng/V2rayNG/app/src/main/res/drawable/ic_backup_24dp.xml b/v2rayng/V2rayNG/app/src/main/res/drawable/ic_backup_24dp.xml new file mode 100644 index 0000000000..0eca240204 --- /dev/null +++ b/v2rayng/V2rayNG/app/src/main/res/drawable/ic_backup_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/v2rayng/V2rayNG/app/src/main/res/drawable/ic_restore_24dp.xml b/v2rayng/V2rayNG/app/src/main/res/drawable/ic_restore_24dp.xml new file mode 100644 index 0000000000..12d78b2c1f --- /dev/null +++ b/v2rayng/V2rayNG/app/src/main/res/drawable/ic_restore_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/v2rayng/V2rayNG/app/src/main/res/layout/activity_about.xml b/v2rayng/V2rayNG/app/src/main/res/layout/activity_about.xml index d139ea8d59..24f8279af2 100644 --- a/v2rayng/V2rayNG/app/src/main/res/layout/activity_about.xml +++ b/v2rayng/V2rayNG/app/src/main/res/layout/activity_about.xml @@ -7,10 +7,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + android:textAppearance="@style/TextAppearance.AppCompat.Tooltip" /> + android:textAppearance="@style/TextAppearance.AppCompat.Tooltip" /> @@ -89,8 +163,7 @@ android:layout_height="wrap_content" android:paddingStart="16dp" android:text="@string/title_tg_channel" - android:textAppearance="@style/TextAppearance.AppCompat.Tooltip" - android:textColor="@color/color_secondary" /> + android:textAppearance="@style/TextAppearance.AppCompat.Tooltip" /> + android:textAppearance="@style/TextAppearance.AppCompat.Tooltip" /> + android:textAppearance="@style/TextAppearance.AppCompat.Tooltip" /> diff --git a/v2rayng/V2rayNG/app/src/main/res/values-ar/strings.xml b/v2rayng/V2rayNG/app/src/main/res/values-ar/strings.xml index 9386cee114..d317d913ba 100644 --- a/v2rayng/V2rayNG/app/src/main/res/values-ar/strings.xml +++ b/v2rayng/V2rayNG/app/src/main/res/values-ar/strings.xml @@ -149,6 +149,9 @@ About Source code Telegram channel + Backup configuration + Backup storage location: [%s], It will be cleared when the app is uninstalled + Restore configuration ŲŖŲ±Ł‚ŁŠŲ© ŲŖŲ±Ł‚ŁŠŲ©ŲŒ انقر Ł„Ł„Ų­ŲµŁˆŁ„ على Ų§Ł„ŲŖŁŲ§ŲµŁŠŁ„ (ŁŠŁ…ŁƒŁ† ؄زالة التبرع) اؓتراكات Ų§Ł„ŲŖŲ­ŲÆŁŠŲ« Ų§Ł„ŲŖŁ„Ł‚Ų§Ų¦ŁŠ diff --git a/v2rayng/V2rayNG/app/src/main/res/values-fa/strings.xml b/v2rayng/V2rayNG/app/src/main/res/values-fa/strings.xml index cd8937068a..bd2d63a1ff 100644 --- a/v2rayng/V2rayNG/app/src/main/res/values-fa/strings.xml +++ b/v2rayng/V2rayNG/app/src/main/res/values-fa/strings.xml @@ -173,6 +173,9 @@ About Source code Telegram channel + Backup configuration + Backup storage location: [%s], It will be cleared when the app is uninstalled + Restore configuration ŲŖŲØŁ„ŪŒŲŗŲ§ŲŖ ŲŖŲØŁ„ŪŒŲŗŲ§ŲŖŲŒ برای جزئیات بیؓتر Ś©Ł„ŪŒŚ© Ś©Ł†ŪŒŲÆ (کمک Ł…Ų§Ł„ŪŒ Ś©Ł†ŪŒŲÆ ŲŖŲ§ حذف ؓود) diff --git a/v2rayng/V2rayNG/app/src/main/res/values-ru/strings.xml b/v2rayng/V2rayNG/app/src/main/res/values-ru/strings.xml index ad6095a915..482e258ff6 100644 --- a/v2rayng/V2rayNG/app/src/main/res/values-ru/strings.xml +++ b/v2rayng/V2rayNG/app/src/main/res/values-ru/strings.xml @@ -175,6 +175,9 @@ Šž приложении Š˜ŃŃ…оГный коГ Telegram-канал + Backup configuration + Backup storage location: [%s], It will be cleared when the app is uninstalled + Restore configuration ДоГействие ДоГействие, нажмите Š“Š»Ń ŠæŠ¾Š»ŃƒŃ‡ŠµŠ½ŠøŃ поГробной информации (пожертвование может Š±Ń‹Ń‚ŃŒ уГалено) diff --git a/v2rayng/V2rayNG/app/src/main/res/values-vi/strings.xml b/v2rayng/V2rayNG/app/src/main/res/values-vi/strings.xml index 7b890f5e3e..53b9d80080 100644 --- a/v2rayng/V2rayNG/app/src/main/res/values-vi/strings.xml +++ b/v2rayng/V2rayNG/app/src/main/res/values-vi/strings.xml @@ -175,6 +175,9 @@ About Source code Telegram channel + Backup configuration + Backup storage location: [%s], It will be cleared when the app is uninstalled + Restore configuration Quįŗ£ng bĆ” server Quįŗ£ng cĆ”o, nhįŗ„n Ä‘į»ƒ biįŗæt thĆŖm (Ủng hį»™ có thể được gį»” bį») diff --git a/v2rayng/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml b/v2rayng/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml index 09dddc4f3d..93e085d943 100644 --- a/v2rayng/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml +++ b/v2rayng/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml @@ -173,6 +173,9 @@ å…³äŗŽ 源代码 Telegram 频道 + å¤‡ä»½é…ē½® + å¤‡ä»½å­˜å‚Øä½ē½®: [%s], åøč½½AppåŽä¼šå¤‡ä»½å°†č¢«ęø…é™¤ + čæ˜åŽŸé…ē½® ęŽØå¹æ äø€äŗ›ęŽØå¹æ,ē‚¹å‡»ęŸ„ēœ‹čÆ¦ęƒ…(ęčµ åÆåŽ»é™¤) diff --git a/v2rayng/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml b/v2rayng/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml index 6161a75db7..56df96a030 100644 --- a/v2rayng/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml +++ b/v2rayng/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml @@ -173,6 +173,9 @@ é—œę–¼ åŽŸå§‹ē¢¼ Telegram 頻道 + å‚™ä»½é…ē½® + å‚™ä»½å„²å­˜ä½ē½®: [%s], åøč¼‰Appå¾Œå‚™ä»½å°‡ęœƒęø…é™¤ + é‚„åŽŸé…ē½® ęŽØå»£ äø€äŗ›ęŽØå»£ļ¼Œč¼•č§øä»„ęŖ¢č¦– (ęč“ˆåÆåŽ»é™¤) diff --git a/v2rayng/V2rayNG/app/src/main/res/values/strings.xml b/v2rayng/V2rayNG/app/src/main/res/values/strings.xml index 6b07cb9e48..478a4474a8 100644 --- a/v2rayng/V2rayNG/app/src/main/res/values/strings.xml +++ b/v2rayng/V2rayNG/app/src/main/res/values/strings.xml @@ -186,6 +186,9 @@ About Source code Telegram channel + Backup configuration + Backup storage location: [%s], It will be cleared when the app is uninstalled + Restore configuration Promotion Promotion,click for details(Donation can be removed) diff --git a/yass/CMakeLists.txt b/yass/CMakeLists.txt index 69b5c428dd..d2c3f3047d 100644 --- a/yass/CMakeLists.txt +++ b/yass/CMakeLists.txt @@ -3616,6 +3616,7 @@ add_library(yass_core STATIC src/config/config_network.cpp src/config/config_tls.cpp src/config/config_impl.cpp + src/config/config_version.cpp src/config/config.hpp src/config/config_impl.hpp src/config/config_impl_local.hpp diff --git a/yass/README.md b/yass/README.md index a9f219b5cc..83adf8c2e4 100644 --- a/yass/README.md +++ b/yass/README.md @@ -24,7 +24,7 @@ More Information refers to [wiki](https://github.com/Chilledheart/yass/wiki) and ### Prebuilt binaries - Android [download apk](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-android-release-arm64-1.8.3.apk) or [download 32-bit apk](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-android-release-arm-1.8.3.apk) - iOS [join via TestFlight](https://testflight.apple.com/join/6AkiEq09) or [download ipa](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-ios-release-arm64-1.8.3.ipa) -- Windows [download installer](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-mingw-winxp-release-x86_64-1.8.3-system-installer.exe) or [download 32-bit installer (require runtime)](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-mingw-winxp-release-i686-1.8.3-system-installer.exe) or [download woa arm64 installer](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-mingw-release-aarch64-1.8.3-system-installer.exe) +- Windows [download installer](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-mingw-winxp-release-x86_64-1.8.3-system-installer.exe) or [download 32-bit installer](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-mingw-winxp-release-i686-1.8.3-system-installer.exe) [(require vc 2010 runtime)][vs2010_x86] or [download woa arm64 installer](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-mingw-release-aarch64-1.8.3-system-installer.exe) - macOS [download intel dmg](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-macos-release-x64-1.8.3.dmg) or [download apple silicon dmg](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-macos-release-arm64-1.8.3.dmg) - Linux [download rpm](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass.el7.x86_64.1.8.3-0.rpm) or [download deb](https://github.com/Chilledheart/yass/releases/download/1.8.3/yass-client-ubuntu-16.04-xenial_amd64.1.8.3.deb) diff --git a/yass/src/android/yass.cpp b/yass/src/android/yass.cpp index ff7c1d1d5a..da0eddf789 100644 --- a/yass/src/android/yass.cpp +++ b/yass/src/android/yass.cpp @@ -55,8 +55,7 @@ void Init(JNIEnv* env, jobject activity_obj) { CRYPTO_library_init(); - config::ReadConfigFileOption(0, nullptr); - config::ReadConfig(); + config::ReadConfigFileAndArguments(0, nullptr); // Create Main Worker after ReadConfig g_worker = std::make_unique(); diff --git a/yass/src/cli/cli.cpp b/yass/src/cli/cli.cpp index 2543305ab4..7d2e20176f 100644 --- a/yass/src/cli/cli.cpp +++ b/yass/src/cli/cli.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -80,9 +79,7 @@ int main(int argc, const char* argv[]) { absl::InstallFailureSignalHandler(failure_handle_options); config::SetClientUsageMessage(exec_path); - config::ReadConfigFileOption(argc, argv); - config::ReadConfig(); - absl::ParseCommandLine(argc, const_cast(argv)); + config::ReadConfigFileAndArguments(argc, argv); #ifdef HAVE_ICU if (!InitializeICU()) { diff --git a/yass/src/config/config.cpp b/yass/src/config/config.cpp index 3fadc9c4a1..25139d34b6 100644 --- a/yass/src/config/config.cpp +++ b/yass/src/config/config.cpp @@ -8,13 +8,11 @@ #include #include #include +#include #include -#include "core/logging.hpp" #include "core/utils.hpp" -#include "feature.h" #include "url/gurl.h" -#include "version.h" #ifndef _POSIX_HOST_NAME_MAX #define _POSIX_HOST_NAME_MAX 255 @@ -64,7 +62,7 @@ bool AbslParseFlag(absl::string_view text, CipherMethodFlag* flag, std::string* // Similarly, for unparsing, we can simply invoke `absl::UnparseFlag()` on // the constituent types. std::string AbslUnparseFlag(const CipherMethodFlag& flag) { - DCHECK(is_valid_cipher_method(flag.method)); + assert(is_valid_cipher_method(flag.method) && "Invalid cipher_method"); return to_cipher_method_str(flag.method); } @@ -186,138 +184,6 @@ ABSL_FLAG(RateFlag, limit_rate, RateFlag(0), "Limit transfer speed to RATE"); namespace config { -void ReadConfigFileOption(int argc, const char** argv) { - int pos = 1; - while (pos < argc) { - std::string arg = argv[pos]; - if (pos + 1 < argc && (arg == "-v" || arg == "--v")) { - auto v_opt = StringToIntegerU(argv[pos + 1]); - if (!v_opt.has_value()) { - fprintf(stderr, "Invalid Option: %s %s\n", argv[pos], argv[pos + 1]); - fflush(stderr); - exit(-1); - continue; - } - absl::SetFlag(&FLAGS_v, v_opt.value()); - argv[pos] = ""; - argv[pos + 1] = ""; - pos += 2; - continue; - } else if (pos + 1 < argc && (arg == "-vmodule" || arg == "--vmodule")) { - absl::SetFlag(&FLAGS_vmodule, argv[pos + 1]); - argv[pos] = ""; - argv[pos + 1] = ""; - pos += 2; - continue; - } else if (pos + 1 < argc && (arg == "-log_dir" || arg == "--log_dir")) { - absl::SetFlag(&FLAGS_log_dir, argv[pos + 1]); - argv[pos] = ""; - argv[pos + 1] = ""; - pos += 2; - continue; - } else if (strncmp(argv[pos], "-log_dir=", sizeof("-log_dir=") - 1) == 0) { - absl::SetFlag(&FLAGS_log_dir, argv[pos] + sizeof("-log_dir=") - 1); - argv[pos] = ""; - pos += 1; - continue; - } else if (strncmp(argv[pos], "--log_dir=", sizeof("--log_dir=") - 1) == 0) { - absl::SetFlag(&FLAGS_log_dir, argv[pos] + sizeof("--log_dir=") - 1); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "--ipv4") { - absl::SetFlag(&FLAGS_ipv6_mode, false); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "--ipv6") { - absl::SetFlag(&FLAGS_ipv6_mode, true); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "-logtostderr" || arg == "-logtostderr=true" || arg == "--logtostderr" || - arg == "--logtostderr=true") { - absl::SetFlag(&FLAGS_logtostderr, true); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "-nologtostderr" || arg == "-logtostderr=false" || arg == "--nologtostderr" || - arg == "--logtostderr=false") { - absl::SetFlag(&FLAGS_logtostderr, false); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "-alsologtostderr" || arg == "-alsologtostderr=true" || arg == "--alsologtostderr" || - arg == "--alsologtostderr=true") { - absl::SetFlag(&FLAGS_alsologtostderr, true); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "-noalsologtostderr" || arg == "-alsologtostderr=false" || arg == "--noalsologtostderr" || - arg == "--alsologtostderr=false") { - absl::SetFlag(&FLAGS_alsologtostderr, false); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "-colorlogtostderr" || arg == "-colorlogtostderr=true" || arg == "--colorlogtostderr" || - arg == "--colorlogtostderr=true") { - absl::SetFlag(&FLAGS_colorlogtostderr, true); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "-nocolorlogtostderr" || arg == "-colorlogtostderr=false" || arg == "--nocolorlogtostderr" || - arg == "--colorlogtostderr=false") { - absl::SetFlag(&FLAGS_colorlogtostderr, false); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "-k" || arg == "--k" || arg == "-insecure_mode" || arg == "--insecure_mode") { - absl::SetFlag(&FLAGS_insecure_mode, true); - argv[pos] = ""; - pos += 1; - continue; - } else if (arg == "-noinsecure_mode" || arg == "-insecure_mode=false" || arg == "--noinsecure_mode" || - arg == "--insecure_mode=false") { - absl::SetFlag(&FLAGS_insecure_mode, false); - argv[pos] = ""; - pos += 1; - continue; - } else if (pos + 1 < argc && (arg == "-c" || arg == "--configfile")) { - /* deprecated */ - g_configfile = argv[pos + 1]; - argv[pos] = ""; - argv[pos + 1] = ""; - pos += 2; - continue; - } else if (pos + 1 < argc && (arg == "-K" || arg == "--config")) { - g_configfile = argv[pos + 1]; - argv[pos] = ""; - argv[pos + 1] = ""; - pos += 2; - continue; - } else if (arg == "-version" || arg == "--version") { - fprintf(stdout, "%s %s\n", absl::flags_internal::ShortProgramInvocationName().c_str(), YASS_APP_TAG); - fprintf(stdout, "Last Change: %s\n", YASS_APP_LAST_CHANGE); - fprintf(stdout, "Features: %s\n", YASS_APP_FEATURES); -#ifndef NDEBUG - fprintf(stdout, "Debug build (NDEBUG not #defined)\n"); -#endif - fflush(stdout); - argv[pos] = ""; - pos += 1; - exit(0); - } - ++pos; - } - - LOG(WARNING) << "Application starting: " << YASS_APP_TAG; - LOG(WARNING) << "Last Change: " << YASS_APP_LAST_CHANGE; - LOG(WARNING) << "Features: " << YASS_APP_FEATURES; -#ifndef NDEBUG - LOG(WARNING) << "Debug build (NDEBUG not #defined)\n"; -#endif -} - bool ReadConfig() { auto config_impl = config::ConfigImpl::Create(); bool required_fields_loaded = true; diff --git a/yass/src/config/config.hpp b/yass/src/config/config.hpp index 54a5cf9093..c932cf92cf 100644 --- a/yass/src/config/config.hpp +++ b/yass/src/config/config.hpp @@ -42,10 +42,11 @@ struct RateFlag { ABSL_DECLARE_FLAG(RateFlag, limit_rate); // bytes per second namespace config { -void ReadConfigFileOption(int argc, const char** argv); bool ReadConfig(); bool SaveConfig(); +void ReadConfigFileAndArguments(int argc, const char** argv); + std::string ReadConfigFromArgument(const std::string& server_host, const std::string& server_sni, const std::string& server_port, diff --git a/yass/src/config/config_impl.cpp b/yass/src/config/config_impl.cpp index 7c9c2228dc..0cce49f15f 100644 --- a/yass/src/config/config_impl.cpp +++ b/yass/src/config/config_impl.cpp @@ -5,11 +5,12 @@ #include #include #include +#include +#include #include "config/config_impl_apple.hpp" #include "config/config_impl_local.hpp" #include "config/config_impl_windows.hpp" -#include "core/logging.hpp" #include "crypto/crypter_export.hpp" struct PortFlag { @@ -31,34 +32,28 @@ ConfigImpl::~ConfigImpl() = default; std::unique_ptr ConfigImpl::Create() { if (!g_configfile.empty()) { - fprintf(stderr, "using option from file: %s\n", g_configfile.c_str()); - fflush(stderr); + std::cerr << "using option from file: " << std::endl; auto config = std::make_unique(g_configfile); config->SetEnforceRead(); return config; } #ifdef _WIN32 - fprintf(stderr, "using option from registry\n"); - fflush(stderr); + std::cerr << "using option from registry" << std::endl; return std::make_unique(); #elif defined(__APPLE__) - fprintf(stderr, "using option from defaults database\n"); - fflush(stderr); + std::cerr << "using option from defaults database" << std::endl; return std::make_unique(); #elif defined(__ANDROID__) std::string configfile = absl::StrCat(a_data_dir, "/", "config.json"); - fprintf(stderr, "using option from file: %s\n", configfile.c_str()); - fflush(stderr); + std::cerr << "using option from file: " << configfile << std::endl; return std::make_unique(configfile); #elif defined(__OHOS__) std::string configfile = absl::StrCat(h_data_dir, "/", "config.json"); - fprintf(stderr, "using option from file: %s\n", configfile.c_str()); - fflush(stderr); + std::cerr << "using option from file: " << configfile << std::endl; return std::make_unique(configfile); #else - const char* configfile = "~/.yass/config.json"; - fprintf(stderr, "using option from file: %s\n", configfile); - fflush(stderr); + const char* const configfile = "~/.yass/config.json"; + std::cerr << "using option from file: " << configfile << std::endl; return std::make_unique(configfile); #endif } @@ -66,9 +61,9 @@ std::unique_ptr ConfigImpl::Create() { bool ConfigImpl::Open(bool dontread) { bool ret = OpenImpl(dontread); if (!ret) { - LOG(ERROR) << "failed to open config"; + std::cerr << "failed to open config" << std::endl; } else { - VLOG(2) << "opened config"; + std::cerr << "opened config" << std::endl; } return ret; } @@ -76,9 +71,9 @@ bool ConfigImpl::Open(bool dontread) { bool ConfigImpl::Close() { bool ret = CloseImpl(); if (!ret) { - LOG(ERROR) << "failed to close/sync config"; + std::cerr << "failed to close/sync config" << std::endl; } else { - VLOG(2) << "closed config"; + std::cerr << "closed config" << std::endl; } return ret; } @@ -90,11 +85,11 @@ bool ConfigImpl::Read(const std::string& key, absl::Flag* value) { alignas(T) alignas(8) T real_value; if (!ReadImpl(key, &real_value)) { - LOG(WARNING) << "failed to load option " << key; + std::cerr << "failed to load option " << key << std::endl; return false; } absl::SetFlag(value, real_value); - VLOG(1) << "loaded option " << key << ": " << real_value; + std::cerr << "loaded option " << key << ": " << real_value << std::endl; return true; } @@ -104,16 +99,16 @@ template <> bool ConfigImpl::Read(const std::string& key, absl::Flag* value) { alignas(std::string) alignas(8) int32_t real_value; if (!ReadImpl(key, &real_value)) { - LOG(WARNING) << "failed to load option " << key; + std::cerr << "failed to load option " << key << std::endl; return false; } if (real_value < 0 || real_value > UINT16_MAX) { - LOG(WARNING) << "invalid value for key: " << key << " value: " << real_value; + std::cerr << "invalid value for key: " << key << " value: " << real_value << std::endl; return false; } PortFlag p(static_cast(real_value)); absl::SetFlag(value, p); - VLOG(1) << "loaded option " << key << ": " << real_value; + std::cerr << "loaded option " << key << ": " << real_value << std::endl; return true; } @@ -121,17 +116,17 @@ template <> bool ConfigImpl::Read(const std::string& key, absl::Flag* value) { alignas(std::string) alignas(8) std::string real_value; if (!ReadImpl(key, &real_value)) { - LOG(WARNING) << "failed to load option " << key; + std::cerr << "failed to load option " << key << std::endl; return false; } auto cipher_method = to_cipher_method(real_value); if (cipher_method == CRYPTO_INVALID) { - LOG(WARNING) << "invalid value for key: " << key << " value: " << real_value; + std::cerr << "invalid value for key: " << key << " value: " << real_value << std::endl; return false; } CipherMethodFlag method(cipher_method); absl::SetFlag(value, method); - VLOG(1) << "loaded option " << key << ": " << real_value; + std::cerr << "loaded option " << key << ": " << real_value << std::endl; return true; } @@ -142,11 +137,11 @@ bool ConfigImpl::Read(const std::string& key, absl::Flag* value) { alignas(bool) alignas(8) bool real_value; if (!ReadImpl(key, &real_value)) { - LOG(WARNING) << "failed to load option " << key; + std::cerr << "failed to load option " << key << std::endl; return false; } absl::SetFlag(value, real_value); - VLOG(1) << "loaded option " << key << ": " << std::boolalpha << real_value; + std::cerr << "loaded option " << key << ": " << std::boolalpha << real_value << std::noboolalpha << std::endl; return true; } @@ -162,10 +157,10 @@ template bool ConfigImpl::Write(const std::string& key, const absl::Flag& value) { alignas(T) alignas(8) T real_value = absl::GetFlag(value); if (!WriteImpl(key, real_value)) { - LOG(WARNING) << "failed to saved option " << key << ": " << real_value; + std::cerr << "failed to saved option " << key << ": " << real_value << std::endl; return false; } - VLOG(1) << "saved option " << key << ": " << real_value; + std::cerr << "saved option " << key << ": " << real_value << std::endl; return true; } @@ -175,23 +170,23 @@ template <> bool ConfigImpl::Write(const std::string& key, const absl::Flag& value) { int32_t real_value = absl::GetFlag(value); if (!WriteImpl(key, real_value)) { - LOG(WARNING) << "failed to saved option " << key << ": " << real_value; + std::cerr << "failed to saved option " << key << ": " << real_value << std::endl; return false; } - VLOG(1) << "saved option " << key << ": " << real_value; + std::cerr << "saved option " << key << ": " << real_value << std::endl; return true; } template <> bool ConfigImpl::Write(const std::string& key, const absl::Flag& value) { auto cipher_method = absl::GetFlag(value).method; - DCHECK(is_valid_cipher_method(cipher_method)); + assert(is_valid_cipher_method(cipher_method) && "Invalid cipher_method"); auto real_value = to_cipher_method_str(cipher_method); if (!WriteImpl(key, real_value)) { - LOG(WARNING) << "failed to saved option " << key << ": " << real_value; + std::cerr << "failed to saved option " << key << ": " << real_value << std::endl; return false; } - VLOG(1) << "saved option " << key << ": " << real_value; + std::cerr << "saved option " << key << ": " << real_value << std::endl; return true; } @@ -199,10 +194,11 @@ template <> bool ConfigImpl::Write(const std::string& key, const absl::Flag& value) { alignas(bool) alignas(8) bool real_value = absl::GetFlag(value); if (!WriteImpl(key, real_value)) { - LOG(WARNING) << "failed to saved option " << key << ": " << std::boolalpha << real_value; + std::cerr << "failed to saved option " << key << ": " << std::boolalpha << real_value << std::noboolalpha + << std::endl; return false; } - VLOG(1) << "saved option " << key << ": " << std::boolalpha << real_value; + std::cerr << "saved option " << key << ": " << std::boolalpha << real_value << std::noboolalpha << std::endl; return true; } @@ -216,7 +212,7 @@ template bool ConfigImpl::Write(const std::string& key, const absl::Flag #include +#include #include -#include "core/logging.hpp" #include "core/utils.hpp" #include @@ -76,7 +76,7 @@ bool ConfigImplApple::ReadImpl(const std::string& key, std::string* value) { *value = SysCFStringRefToUTF8(obj); return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -87,7 +87,7 @@ bool ConfigImplApple::ReadImpl(const std::string& key, bool* value) { *value = CFBooleanGetValue(obj); return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -97,7 +97,7 @@ bool ConfigImplApple::ReadImpl(const std::string& key, uint32_t* value) { CFGetTypeID(obj) == CFNumberGetTypeID() && CFNumberGetValue(obj, kCFNumberSInt32Type, value)) { return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -107,7 +107,7 @@ bool ConfigImplApple::ReadImpl(const std::string& key, int32_t* value) { CFGetTypeID(obj) == CFNumberGetTypeID() && CFNumberGetValue(obj, kCFNumberSInt32Type, value)) { return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -117,7 +117,7 @@ bool ConfigImplApple::ReadImpl(const std::string& key, uint64_t* value) { CFGetTypeID(obj) == CFNumberGetTypeID() && CFNumberGetValue(obj, kCFNumberSInt64Type, value)) { return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -127,7 +127,7 @@ bool ConfigImplApple::ReadImpl(const std::string& key, int64_t* value) { CFGetTypeID(obj) == CFNumberGetTypeID() && CFNumberGetValue(obj, kCFNumberSInt64Type, value)) { return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } diff --git a/yass/src/config/config_impl_local.hpp b/yass/src/config/config_impl_local.hpp index 110a1a5503..adf12b6835 100644 --- a/yass/src/config/config_impl_local.hpp +++ b/yass/src/config/config_impl_local.hpp @@ -16,11 +16,12 @@ #endif #include +#include +#include #include #include #include -#include "core/logging.hpp" #include "core/utils.hpp" #include "core/utils_fs.hpp" @@ -36,21 +37,21 @@ class ConfigImplLocal : public ConfigImpl { protected: bool OpenImpl(bool dontread) override { - DCHECK(!path_.empty()); + assert(!path_.empty() && "Opened with empty path"); dontread_ = dontread; do { ssize_t size = ReadFileToBuffer(path_, read_buffer_, sizeof(read_buffer_)); if (size < 0) { - PLOG(WARNING) << "configure file failed to read: " << path_; + std::cerr << "configure file failed to read: " << path_ << std::endl; break; } root_ = json::parse(read_buffer_, nullptr, false); if (root_.is_discarded() || !root_.is_object()) { - LOG(WARNING) << "bad config file: " << path_ << " content: \"" << read_buffer_ << "\""; + std::cerr << "bad config file: " << path_ << " content: \"" << read_buffer_ << "\"" << std::endl; break; } - VLOG(2) << "loaded from config file: " << path_; + std::cerr << "loaded from config file: " << path_ << std::endl; return true; } while (false); @@ -71,17 +72,17 @@ class ConfigImplLocal : public ConfigImpl { auto dir_ref = Dirname(path_); std::string dir(dir_ref.data(), dir_ref.size()); if (!CreateDirectories(dir)) { - PLOG(WARNING) << "configure dir could not create: " << dir; + std::cerr << "configure dir could not create: " << dir << std::endl; return false; } std::string json_content = root_.dump(4); if (static_cast(json_content.size()) != WriteFileWithBuffer(path_, json_content)) { - PLOG(WARNING) << "failed to write to path: \"" << path_ << " with content \"" << json_content; + std::cerr << "failed to write to path: \"" << path_ << " with content \"" << json_content << "\"" << std::endl; return false; } - LOG(INFO) << "written config file at " << path_; + std::cerr << "written config file at " << path_ << std::endl; path_.clear(); return true; @@ -92,7 +93,7 @@ class ConfigImplLocal : public ConfigImpl { *value = root_[key].get(); return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -101,7 +102,7 @@ class ConfigImplLocal : public ConfigImpl { *value = root_[key].get(); return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -110,7 +111,7 @@ class ConfigImplLocal : public ConfigImpl { *value = root_[key].get(); return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -119,7 +120,7 @@ class ConfigImplLocal : public ConfigImpl { *value = root_[key].get(); return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -128,7 +129,7 @@ class ConfigImplLocal : public ConfigImpl { *value = root_[key].get(); return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -137,7 +138,7 @@ class ConfigImplLocal : public ConfigImpl { *value = root_[key].get(); return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } diff --git a/yass/src/config/config_impl_windows.hpp b/yass/src/config/config_impl_windows.hpp index 7f4b3341a4..79e1a91caa 100644 --- a/yass/src/config/config_impl_windows.hpp +++ b/yass/src/config/config_impl_windows.hpp @@ -10,10 +10,10 @@ #include #include +#include #include #include -#include "core/logging.hpp" #include "core/utils.hpp" #define DEFAULT_CONFIG_KEY L"SOFTWARE\\YetAnotherShadowSocket" @@ -105,11 +105,11 @@ class ConfigImplWindows : public ConfigImpl { nullptr /*lpSecurityAttributes*/, &hkey_ /* phkResult */, &disposition /* lpdwDisposition*/) == ERROR_SUCCESS) { if (disposition == REG_CREATED_NEW_KEY) { - VLOG(2) << "The key did not exist and was created: HKEY_CURRENT_USER/" << SysWideToUTF8(subkey); + std::cerr << "The key did not exist and was created: HKEY_CURRENT_USER/" << SysWideToUTF8(subkey) << std::endl; } else if (disposition == REG_OPENED_EXISTING_KEY) { - VLOG(2) << "The key existed and was simply opened without being " - "changed: HKEY_CURRENT_USER/" - << SysWideToUTF8(subkey); + std::cerr << "The key existed and was simply opened without being " + "changed: HKEY_CURRENT_USER/" + << SysWideToUTF8(subkey) << std::endl; } return true; } @@ -148,7 +148,7 @@ class ConfigImplWindows : public ConfigImpl { /* fall through */ } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -169,7 +169,7 @@ class ConfigImplWindows : public ConfigImpl { return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -187,7 +187,7 @@ class ConfigImplWindows : public ConfigImpl { return true; } - LOG(WARNING) << "bad field: " << key; + std::cerr << "bad field: " << key << std::endl; return false; } @@ -204,7 +204,7 @@ class ConfigImplWindows : public ConfigImpl { (wvalue.size() + 1) * sizeof(wchar_t) /*cbData*/) == ERROR_SUCCESS) { return true; } - LOG(WARNING) << "failed to write field: " << key << " with content " << value; + std::cerr << "failed to write field: " << key << " with content " << value << std::endl; return false; } @@ -219,7 +219,7 @@ class ConfigImplWindows : public ConfigImpl { reinterpret_cast(&value) /*lpData*/, sizeof(value) /*cbData*/) == ERROR_SUCCESS) { return true; } - LOG(WARNING) << "failed to write field: " << key << " with content " << value; + std::cerr << "failed to write field: " << key << " with content " << value << std::endl; return false; } diff --git a/yass/src/config/config_version.cpp b/yass/src/config/config_version.cpp new file mode 100644 index 0000000000..a47da0a8bd --- /dev/null +++ b/yass/src/config/config_version.cpp @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2024 Chilledheart */ + +#include "config/config.hpp" +#include "config/config_impl.hpp" + +#include +#include +#include +#include +#include "core/logging.hpp" +#include "feature.h" +#include "version.h" + +namespace config { + +static void ParseConfigFileOption(int argc, const char** argv) { + int pos = 1; + while (pos < argc) { + std::string arg = argv[pos]; + if (arg == "--ipv4") { + absl::SetFlag(&FLAGS_ipv6_mode, false); + argv[pos] = ""; + pos += 1; + continue; + } else if (arg == "--ipv6") { + absl::SetFlag(&FLAGS_ipv6_mode, true); + argv[pos] = ""; + pos += 1; + continue; + } else if (arg == "-k" || arg == "--k" || arg == "-insecure_mode" || arg == "--insecure_mode") { + absl::SetFlag(&FLAGS_insecure_mode, true); + argv[pos] = ""; + pos += 1; + continue; + } else if (arg == "-noinsecure_mode" || arg == "-insecure_mode=false" || arg == "--noinsecure_mode" || + arg == "--insecure_mode=false") { + absl::SetFlag(&FLAGS_insecure_mode, false); + argv[pos] = ""; + pos += 1; + continue; + } else if (pos + 1 < argc && (arg == "-c" || arg == "--configfile")) { + /* deprecated */ + g_configfile = argv[pos + 1]; + argv[pos] = ""; + argv[pos + 1] = ""; + pos += 2; + continue; + } else if (pos + 1 < argc && (arg == "-K" || arg == "--config")) { + g_configfile = argv[pos + 1]; + argv[pos] = ""; + argv[pos + 1] = ""; + pos += 2; + continue; + } else if (arg == "-version" || arg == "--version") { + std::cout << absl::flags_internal::ShortProgramInvocationName() << " " << YASS_APP_TAG << std::endl; + std::cout << "Last Change: " << YASS_APP_LAST_CHANGE << std::endl; + std::cout << "Features: " << YASS_APP_FEATURES << std::endl; +#ifndef NDEBUG + std::cout << "Debug build (NDEBUG not #defined)" << std::endl; +#endif + argv[pos] = ""; + pos += 1; + exit(0); + } + ++pos; + } + + std::cerr << "Application starting: " << YASS_APP_TAG << std::endl; + std::cerr << "Last Change: " << YASS_APP_LAST_CHANGE << std::endl; + std::cerr << "Features: " << YASS_APP_FEATURES << std::endl; +#ifndef NDEBUG + std::cerr << "Debug build (NDEBUG not #defined)\n" << std::endl; +#endif +} + +void ReadConfigFileAndArguments(int argc, const char** argv) { + ParseConfigFileOption(argc, argv); + config::ReadConfig(); + if (argc) { + absl::ParseCommandLine(argc, const_cast(argv)); + } + + // first line of logging + LOG(WARNING) << "Application starting: " << YASS_APP_TAG; + LOG(WARNING) << "Last Change: " << YASS_APP_LAST_CHANGE; + LOG(WARNING) << "Features: " << YASS_APP_FEATURES; +#ifndef NDEBUG + LOG(WARNING) << "Debug build (NDEBUG not #defined)\n"; +#endif +} + +} // namespace config diff --git a/yass/src/gtk/yass.cpp b/yass/src/gtk/yass.cpp index f0200ac77c..f30c30dc87 100644 --- a/yass/src/gtk/yass.cpp +++ b/yass/src/gtk/yass.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -60,9 +59,7 @@ int main(int argc, const char** argv) { #endif config::SetClientUsageMessage(exec_path); - config::ReadConfigFileOption(argc, argv); - config::ReadConfig(); - absl::ParseCommandLine(argc, const_cast(argv)); + config::ReadConfigFileAndArguments(argc, argv); #ifdef HAVE_ICU if (!InitializeICU()) { diff --git a/yass/src/gtk4/yass.cpp b/yass/src/gtk4/yass.cpp index ed29e10428..22eeeaa659 100644 --- a/yass/src/gtk4/yass.cpp +++ b/yass/src/gtk4/yass.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -111,9 +110,7 @@ int main(int argc, const char** argv) { #endif config::SetClientUsageMessage(exec_path); - config::ReadConfigFileOption(argc, argv); - config::ReadConfig(); - absl::ParseCommandLine(argc, const_cast(argv)); + config::ReadConfigFileAndArguments(argc, argv); #ifdef HAVE_ICU if (!InitializeICU()) { diff --git a/yass/src/harmony/yass.cpp b/yass/src/harmony/yass.cpp index 23f6fc6e5c..1e794fd999 100644 --- a/yass/src/harmony/yass.cpp +++ b/yass/src/harmony/yass.cpp @@ -1102,8 +1102,7 @@ static napi_value initRoutine(napi_env env, napi_callback_info info) { CRYPTO_library_init(); - config::ReadConfigFileOption(0, nullptr); - config::ReadConfig(); + config::ReadConfigFileAndArguments(0, nullptr); g_worker = std::make_unique(); diff --git a/yass/src/ios/main.mm b/yass/src/ios/main.mm index 39e0f5cf01..e985cc63eb 100644 --- a/yass/src/ios/main.mm +++ b/yass/src/ios/main.mm @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "config/config.hpp" @@ -43,9 +42,7 @@ int main(int argc, const char** argv) { #endif config::SetClientUsageMessage(exec_path); - config::ReadConfigFileOption(argc, argv); - config::ReadConfig(); - absl::ParseCommandLine(argc, const_cast(argv)); + config::ReadConfigFileAndArguments(argc, argv); absl::SetFlag(&FLAGS_v, 0); absl::SetFlag(&FLAGS_log_thread_id, 1); diff --git a/yass/src/mac/main.mm b/yass/src/mac/main.mm index 7461c4c21a..41ab2a21e3 100644 --- a/yass/src/mac/main.mm +++ b/yass/src/mac/main.mm @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "third_party/boringssl/src/include/openssl/crypto.h" @@ -58,9 +57,7 @@ int main(int argc, const char** argv) { #endif config::SetClientUsageMessage(exec_path); - config::ReadConfigFileOption(argc, argv); - config::ReadConfig(); - absl::ParseCommandLine(argc, const_cast(argv)); + config::ReadConfigFileAndArguments(argc, argv); #ifdef HAVE_ICU if (!InitializeICU()) { diff --git a/yass/src/server/server.cpp b/yass/src/server/server.cpp index a821459dc5..2eaf8b44d9 100644 --- a/yass/src/server/server.cpp +++ b/yass/src/server/server.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include "third_party/boringssl/src/include/openssl/crypto.h" @@ -58,9 +57,7 @@ int main(int argc, const char* argv[]) { absl::InstallFailureSignalHandler(failure_handle_options); config::SetServerUsageMessage(exec_path); - config::ReadConfigFileOption(argc, argv); - config::ReadConfig(); - absl::ParseCommandLine(argc, const_cast(argv)); + config::ReadConfigFileAndArguments(argc, argv); #ifdef HAVE_ICU if (!InitializeICU()) { diff --git a/yass/src/win32/yass.cpp b/yass/src/win32/yass.cpp index c23bab1cc0..abc3256922 100644 --- a/yass/src/win32/yass.cpp +++ b/yass/src/win32/yass.cpp @@ -10,9 +10,9 @@ #include #include #include -#include #include #include +#include #include "third_party/boringssl/src/include/openssl/crypto.h" #include "core/debug.hpp" @@ -99,9 +99,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, argv[0] = exec_path.data(); config::SetClientUsageMessage(exec_path); - config::ReadConfigFileOption(argc, &argv[0]); - config::ReadConfig(); - absl::ParseCommandLine(argv.size(), const_cast(&argv[0])); + config::ReadConfigFileAndArguments(argc, &argv[0]); #ifdef HAVE_ICU if (!InitializeICU()) { diff --git a/yass/third_party/googletest/.github/workflows/gtest-ci.yml b/yass/third_party/googletest/.github/workflows/gtest-ci.yml deleted file mode 100644 index 03a8cc5e28..0000000000 --- a/yass/third_party/googletest/.github/workflows/gtest-ci.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: ci - -on: - push: - pull_request: - -env: - BAZEL_CXXOPTS: -std=c++14 - -jobs: - Linux: - runs-on: ubuntu-latest - steps: - - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Tests - run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... - - macOS: - runs-on: macos-latest - steps: - - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Tests - run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... - - - Windows: - runs-on: windows-latest - steps: - - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Tests - run: bazel test --cxxopt=/std:c++14 --features=external_include_paths --test_output=errors ... diff --git a/yass/third_party/googletest/.gitignore b/yass/third_party/googletest/.gitignore index fede02f650..f0df39db1d 100644 --- a/yass/third_party/googletest/.gitignore +++ b/yass/third_party/googletest/.gitignore @@ -8,6 +8,7 @@ bazel-genfiles bazel-googletest bazel-out bazel-testlogs +MODULE.bazel.lock # python *.pyc diff --git a/yass/third_party/googletest/BUILD.bazel b/yass/third_party/googletest/BUILD.bazel index b1e3b7fba8..e407ae29f4 100644 --- a/yass/third_party/googletest/BUILD.bazel +++ b/yass/third_party/googletest/BUILD.bazel @@ -56,6 +56,12 @@ config_setting( constraint_values = ["@platforms//os:openbsd"], ) +# NOTE: Fuchsia is not an officially supported platform. +config_setting( + name = "fuchsia", + constraint_values = ["@platforms//os:fuchsia"], +) + config_setting( name = "msvc_compiler", flag_values = { @@ -147,6 +153,17 @@ cc_library( "@com_googlesource_code_re2//:re2", ], "//conditions:default": [], + }) + select({ + # `gtest-death-test.cc` has `EXPECT_DEATH` that spawns a process, + # expects it to crash and inspects its logs with the given matcher, + # so that's why these libraries are needed. + # Otherwise, builds targeting Fuchsia would fail to compile. + ":fuchsia": [ + "@fuchsia_sdk//pkg/fdio", + "@fuchsia_sdk//pkg/syslog", + "@fuchsia_sdk//pkg/zx", + ], + "//conditions:default": [], }), ) diff --git a/yass/third_party/googletest/CMakeLists.txt b/yass/third_party/googletest/CMakeLists.txt index 24d41c29c0..9e6d6440da 100644 --- a/yass/third_party/googletest/CMakeLists.txt +++ b/yass/third_party/googletest/CMakeLists.txt @@ -20,6 +20,15 @@ option(BUILD_GMOCK "Builds the googlemock subproject" ON) option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF) +if(GTEST_HAS_ABSL) + if(NOT TARGET absl::base) + find_package(absl REQUIRED) + endif() + if(NOT TARGET re2::re2) + find_package(re2 REQUIRED) + endif() +endif() + if(BUILD_GMOCK) add_subdirectory( googlemock ) else() diff --git a/yass/third_party/googletest/CONTRIBUTORS b/yass/third_party/googletest/CONTRIBUTORS index 77397a5b53..ccea41ea81 100644 --- a/yass/third_party/googletest/CONTRIBUTORS +++ b/yass/third_party/googletest/CONTRIBUTORS @@ -55,6 +55,7 @@ Russ Cox Russ Rufer Sean Mcafee Sigurưur Ɓsgeirsson +Soyeon Kim Sverre Sundsdal Szymon Sobik Takeshi Yoshino diff --git a/yass/third_party/googletest/MODULE.bazel b/yass/third_party/googletest/MODULE.bazel new file mode 100644 index 0000000000..b81ebf043b --- /dev/null +++ b/yass/third_party/googletest/MODULE.bazel @@ -0,0 +1,61 @@ +# Copyright 2024 Google Inc. +# All Rights Reserved. +# +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# https://bazel.build/external/overview#bzlmod + +module( + name = "googletest", + version = "head", + compatibility_level = 1, +) + +# Only direct dependencies need to be listed below. +# Please keep the versions in sync with the versions in the WORKSPACE file. + +bazel_dep(name = "abseil-cpp", + version = "20240116.0", + repo_name = "com_google_absl") + +bazel_dep(name = "platforms", + version = "0.0.8") + +bazel_dep(name = "re2", + repo_name = "com_googlesource_code_re2", + version = "2023-11-01") + +bazel_dep(name = "rules_python", + version = "0.29.0") + + +fake_fuchsia_sdk = use_repo_rule("//:fake_fuchsia_sdk.bzl", "fake_fuchsia_sdk") +fake_fuchsia_sdk(name = "fuchsia_sdk") + +# https://github.com/bazelbuild/rules_python/blob/main/BZLMOD_SUPPORT.md#default-toolchain-is-not-the-local-system-python +register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain") diff --git a/yass/third_party/googletest/WORKSPACE b/yass/third_party/googletest/WORKSPACE index f819ffe61b..92cfd259a8 100644 --- a/yass/third_party/googletest/WORKSPACE +++ b/yass/third_party/googletest/WORKSPACE @@ -6,22 +6,24 @@ googletest_deps() load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( - name = "rules_python", # 2023-07-31T20:39:27Z - sha256 = "1250b59a33c591a1c4ba68c62e95fc88a84c334ec35a2e23f46cbc1b9a5a8b55", - strip_prefix = "rules_python-e355becc30275939d87116a4ec83dad4bb50d9e1", - urls = ["https://github.com/bazelbuild/rules_python/archive/e355becc30275939d87116a4ec83dad4bb50d9e1.zip"], + name = "rules_python", + sha256 = "d71d2c67e0bce986e1c5a7731b4693226867c45bfe0b7c5e0067228a536fc580", + strip_prefix = "rules_python-0.29.0", + urls = ["https://github.com/bazelbuild/rules_python/releases/download/0.29.0/rules_python-0.29.0.tar.gz"], +) + +# https://github.com/bazelbuild/rules_python/releases/tag/0.29.0 +load("@rules_python//python:repositories.bzl", "py_repositories") +py_repositories() + +http_archive( + name = "bazel_skylib", + sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94", + urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"], ) http_archive( - name = "bazel_skylib", # 2023-05-31T19:24:07Z - sha256 = "08c0386f45821ce246bbbf77503c973246ed6ee5c3463e41efc197fa9bc3a7f4", - strip_prefix = "bazel-skylib-288731ef9f7f688932bd50e704a91a45ec185f9b", - urls = ["https://github.com/bazelbuild/bazel-skylib/archive/288731ef9f7f688932bd50e704a91a45ec185f9b.zip"], -) - -http_archive( - name = "platforms", # 2023-07-28T19:44:27Z - sha256 = "40eb313613ff00a5c03eed20aba58890046f4d38dec7344f00bb9a8867853526", - strip_prefix = "platforms-4ad40ef271da8176d4fc0194d2089b8a76e19d7b", - urls = ["https://github.com/bazelbuild/platforms/archive/4ad40ef271da8176d4fc0194d2089b8a76e19d7b.zip"], + name = "platforms", + sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74", + urls = ["https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz"], ) diff --git a/yass/third_party/googletest/WORKSPACE.bzlmod b/yass/third_party/googletest/WORKSPACE.bzlmod new file mode 100644 index 0000000000..381432c5d0 --- /dev/null +++ b/yass/third_party/googletest/WORKSPACE.bzlmod @@ -0,0 +1,35 @@ +# Copyright 2024 Google Inc. +# All Rights Reserved. +# +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# https://bazel.build/external/migration#workspace.bzlmod +# +# This file is intentionally empty. When bzlmod is enabled and this +# file exists, the content of WORKSPACE is ignored. This prevents +# bzlmod builds from unintentionally depending on the WORKSPACE file. diff --git a/yass/third_party/googletest/ci/linux-presubmit.sh b/yass/third_party/googletest/ci/linux-presubmit.sh index a1caa2720a..35e1670724 100644 --- a/yass/third_party/googletest/ci/linux-presubmit.sh +++ b/yass/third_party/googletest/ci/linux-presubmit.sh @@ -31,7 +31,7 @@ set -euox pipefail -readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20230816" +readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20231218" readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20230120" if [[ -z ${GTEST_ROOT:-} ]]; then @@ -67,6 +67,9 @@ for cc in /usr/local/bin/gcc /opt/llvm/clang/bin/clang; do done # Do one test with an older version of GCC +# TODO(googletest-team): This currently uses Bazel 5. When upgrading to a +# version of Bazel that supports Bzlmod, add --enable_bzlmod=false to keep test +# coverage for the old WORKSPACE dependency management. time docker run \ --volume="${GTEST_ROOT}:/src:ro" \ --workdir="/src" \ @@ -80,7 +83,6 @@ time docker run \ --copt="-Wuninitialized" \ --copt="-Wundef" \ --copt="-Wno-error=pragmas" \ - --distdir="/bazel-distdir" \ --features=external_include_paths \ --keep_going \ --show_timestamps \ @@ -102,7 +104,7 @@ for std in ${STD}; do --copt="-Wuninitialized" \ --copt="-Wundef" \ --define="absl=${absl}" \ - --distdir="/bazel-distdir" \ + --enable_bzlmod=true \ --features=external_include_paths \ --keep_going \ --show_timestamps \ @@ -127,7 +129,7 @@ for std in ${STD}; do --copt="-Wuninitialized" \ --copt="-Wundef" \ --define="absl=${absl}" \ - --distdir="/bazel-distdir" \ + --enable_bzlmod=true \ --features=external_include_paths \ --keep_going \ --linkopt="--gcc-toolchain=/usr/local" \ diff --git a/yass/third_party/googletest/ci/macos-presubmit.sh b/yass/third_party/googletest/ci/macos-presubmit.sh index 681ebc2a91..70eaa74fb4 100644 --- a/yass/third_party/googletest/ci/macos-presubmit.sh +++ b/yass/third_party/googletest/ci/macos-presubmit.sh @@ -53,7 +53,7 @@ done # Test the Bazel build # If we are running on Kokoro, check for a versioned Bazel binary. -KOKORO_GFILE_BAZEL_BIN="bazel-5.1.1-darwin-x86_64" +KOKORO_GFILE_BAZEL_BIN="bazel-7.0.0-darwin-x86_64" if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]]; then BAZEL_BIN="${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN}" chmod +x ${BAZEL_BIN} @@ -69,6 +69,7 @@ for absl in 0 1; do --copt="-Wundef" \ --cxxopt="-std=c++14" \ --define="absl=${absl}" \ + --enable_bzlmod=true \ --features=external_include_paths \ --keep_going \ --show_timestamps \ diff --git a/yass/third_party/googletest/ci/windows-presubmit.bat b/yass/third_party/googletest/ci/windows-presubmit.bat index 48962eb9e0..9753f9c0c5 100644 --- a/yass/third_party/googletest/ci/windows-presubmit.bat +++ b/yass/third_party/googletest/ci/windows-presubmit.bat @@ -1,6 +1,6 @@ SETLOCAL ENABLEDELAYEDEXPANSION -SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-5.1.1-windows-x86_64.exe +SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-7.0.0-windows-x86_64.exe SET PATH=C:\Python34;%PATH% SET BAZEL_PYTHON=C:\python34\python.exe @@ -51,7 +51,7 @@ SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community --compilation_mode=dbg ^ --copt=/std:c++14 ^ --copt=/WX ^ - --features=external_include_paths ^ + --enable_bzlmod=true ^ --keep_going ^ --test_output=errors ^ --test_tag_filters=-no_test_msvc2017 diff --git a/yass/third_party/googletest/docs/advanced.md b/yass/third_party/googletest/docs/advanced.md index 0e1f812b9e..2ecce63f56 100644 --- a/yass/third_party/googletest/docs/advanced.md +++ b/yass/third_party/googletest/docs/advanced.md @@ -1004,11 +1004,21 @@ calling the `::testing::AddGlobalTestEnvironment()` function: Environment* AddGlobalTestEnvironment(Environment* env); ``` -Now, when `RUN_ALL_TESTS()` is called, it first calls the `SetUp()` method of -each environment object, then runs the tests if none of the environments -reported fatal failures and `GTEST_SKIP()` was not called. `RUN_ALL_TESTS()` -always calls `TearDown()` with each environment object, regardless of whether or -not the tests were run. +Now, when `RUN_ALL_TESTS()` is invoked, it first calls the `SetUp()` method. The +tests are then executed, provided that none of the environments have reported +fatal failures and `GTEST_SKIP()` has not been invoked. Finally, `TearDown()` is +called. + +Note that `SetUp()` and `TearDown()` are only invoked if there is at least one +test to be performed. Importantly, `TearDown()` is executed even if the test is +not run due to a fatal failure or `GTEST_SKIP()`. + +Calling `SetUp()` and `TearDown()` for each iteration depends on the flag +`gtest_recreate_environments_when_repeating`. `SetUp()` and `TearDown()` are +called for each environment object when the object is recreated for each +iteration. However, if test environments are not recreated for each iteration, +`SetUp()` is called only on the first iteration, and `TearDown()` is called only +on the last iteration. It's OK to register multiple environment objects. In this suite, their `SetUp()` will be called in the order they are registered, and their `TearDown()` will be diff --git a/yass/third_party/googletest/docs/gmock_for_dummies.md b/yass/third_party/googletest/docs/gmock_for_dummies.md index 9f24dcae54..ed2297c2f7 100644 --- a/yass/third_party/googletest/docs/gmock_for_dummies.md +++ b/yass/third_party/googletest/docs/gmock_for_dummies.md @@ -261,6 +261,8 @@ happen. Therefore it's a good idea to turn on the heap checker in your tests when you allocate mocks on the heap. You get that automatically if you use the `gtest_main` library already. +###### Expectation Ordering + **Important note:** gMock requires expectations to be set **before** the mock functions are called, otherwise the behavior is **undefined**. Do not alternate between calls to `EXPECT_CALL()` and calls to the mock functions, and do not set diff --git a/yass/third_party/googletest/docs/primer.md b/yass/third_party/googletest/docs/primer.md index 8b98da2a61..61806be6ef 100644 --- a/yass/third_party/googletest/docs/primer.md +++ b/yass/third_party/googletest/docs/primer.md @@ -73,8 +73,8 @@ Meaning Exercise a particular program path with specific input values and verify the results | [TEST()](#simple-tests) | [Test Case][istqb test case] -[istqb test case]: https://glossary.istqb.org/en/search/test%20case -[istqb test suite]: https://glossary.istqb.org/en/search/test%20suite +[istqb test case]: https://glossary.istqb.org/en_US/term/test-case-2 +[istqb test suite]: https://glossary.istqb.org/en_US/term/test-suite-1-3 ## Basic Concepts @@ -273,14 +273,14 @@ First, define a fixture class. By convention, you should give it the name ```c++ class QueueTest : public testing::Test { protected: - void SetUp() override { + QueueTest() { // q0_ remains empty q1_.Enqueue(1); q2_.Enqueue(2); q2_.Enqueue(3); } - // void TearDown() override {} + // ~QueueTest() override = default; Queue q0_; Queue q1_; @@ -288,8 +288,9 @@ class QueueTest : public testing::Test { }; ``` -In this case, `TearDown()` is not needed since we don't have to clean up after -each test, other than what's already done by the destructor. +In this case, we don't need to define a destructor or a `TearDown()` method, +because the implicit destructor generated by the compiler will perform all of +the necessary cleanup. Now we'll write tests using `TEST_F()` and this fixture. @@ -326,11 +327,9 @@ would lead to a segfault when `n` is `NULL`. When these tests run, the following happens: 1. GoogleTest constructs a `QueueTest` object (let's call it `t1`). -2. `t1.SetUp()` initializes `t1`. -3. The first test (`IsEmptyInitially`) runs on `t1`. -4. `t1.TearDown()` cleans up after the test finishes. -5. `t1` is destructed. -6. The above steps are repeated on another `QueueTest` object, this time +2. The first test (`IsEmptyInitially`) runs on `t1`. +3. `t1` is destructed. +4. The above steps are repeated on another `QueueTest` object, this time running the `DequeueWorks` test. **Availability**: Linux, Windows, Mac. diff --git a/yass/third_party/googletest/docs/reference/testing.md b/yass/third_party/googletest/docs/reference/testing.md index ead66b3626..c93556e662 100644 --- a/yass/third_party/googletest/docs/reference/testing.md +++ b/yass/third_party/googletest/docs/reference/testing.md @@ -94,7 +94,8 @@ Instantiates the value-parameterized test suite *`TestSuiteName`* (defined with The argument *`InstantiationName`* is a unique name for the instantiation of the test suite, to distinguish between multiple instantiations. In test output, the instantiation name is added as a prefix to the test suite name -*`TestSuiteName`*. +*`TestSuiteName`*. If *`InstantiationName`* is empty +(`INSTANTIATE_TEST_SUITE_P(, ...)`), no prefix is added. The argument *`param_generator`* is one of the following GoogleTest-provided functions that generate the test parameters, all defined in the `::testing` @@ -277,7 +278,8 @@ must be registered with The argument *`InstantiationName`* is a unique name for the instantiation of the test suite, to distinguish between multiple instantiations. In test output, the instantiation name is added as a prefix to the test suite name -*`TestSuiteName`*. +*`TestSuiteName`*. If *`InstantiationName`* is empty +(`INSTANTIATE_TYPED_TEST_SUITE_P(, ...)`), no prefix is added. The argument *`Types`* is a [`Types`](#Types) object representing the list of types to run the tests on, for example: @@ -1317,7 +1319,9 @@ tests. Initializes GoogleTest. This must be called before calling [`RUN_ALL_TESTS()`](#RUN_ALL_TESTS). In particular, it parses the command line for the flags that GoogleTest recognizes. Whenever a GoogleTest flag is seen, it -is removed from `argv`, and `*argc` is decremented. +is removed from `argv`, and `*argc` is decremented. Keep in mind that `argv` +must terminate with a `NULL` pointer (i.e. `argv[argc]` is `NULL`), which is +already the case with the default `argv` passed to `main`. No value is returned. Instead, the GoogleTest flag variables are updated. diff --git a/yass/third_party/googletest/fake_fuchsia_sdk.bzl b/yass/third_party/googletest/fake_fuchsia_sdk.bzl new file mode 100644 index 0000000000..2024dc6c4d --- /dev/null +++ b/yass/third_party/googletest/fake_fuchsia_sdk.bzl @@ -0,0 +1,33 @@ +"""Provides a fake @fuchsia_sdk implementation that's used when the real one isn't available. + +This is needed since bazel queries on targets that depend on //:gtest (eg: +`bazel query "deps(set(//googletest/test:gtest_all_test))"`) will fail if @fuchsia_sdk is not +defined when bazel is evaluating the transitive closure of the query target. + +See https://github.com/google/googletest/issues/4472. +""" + +def _fake_fuchsia_sdk_impl(repo_ctx): + for stub_target in repo_ctx.attr._stub_build_targets: + stub_package = stub_target + stub_target_name = stub_target.split("/")[-1] + repo_ctx.file("%s/BUILD.bazel" % stub_package, """ +filegroup( + name = "%s", +) +""" % stub_target_name) + +fake_fuchsia_sdk = repository_rule( + doc = "Used to create a fake @fuchsia_sdk repository with stub build targets.", + implementation = _fake_fuchsia_sdk_impl, + attrs = { + "_stub_build_targets": attr.string_list( + doc = "The stub build targets to initialize.", + default = [ + "pkg/fdio", + "pkg/syslog", + "pkg/zx", + ], + ), + }, +) diff --git a/yass/third_party/googletest/googlemock/CMakeLists.txt b/yass/third_party/googletest/googlemock/CMakeLists.txt index 428bd9f8ea..99b2411f36 100644 --- a/yass/third_party/googletest/googlemock/CMakeLists.txt +++ b/yass/third_party/googletest/googlemock/CMakeLists.txt @@ -65,12 +65,13 @@ endif() config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake # Adds Google Mock's and Google Test's header directories to the search path. +# Get Google Test's include dirs from the target, gtest_SOURCE_DIR is broken +# when using fetch-content with the name "GTest". +get_target_property(gtest_include_dirs gtest INCLUDE_DIRECTORIES) set(gmock_build_include_dirs "${gmock_SOURCE_DIR}/include" "${gmock_SOURCE_DIR}" - "${gtest_SOURCE_DIR}/include" - # This directory is needed to build directly from Google Test sources. - "${gtest_SOURCE_DIR}") + "${gtest_include_dirs}") include_directories(${gmock_build_include_dirs}) ######################################################################## diff --git a/yass/third_party/googletest/googlemock/include/gmock/gmock-actions.h b/yass/third_party/googletest/googlemock/include/gmock/gmock-actions.h index fab9993384..7e17b305e9 100644 --- a/yass/third_party/googletest/googlemock/include/gmock/gmock-actions.h +++ b/yass/third_party/googletest/googlemock/include/gmock/gmock-actions.h @@ -2135,13 +2135,13 @@ struct ActionImpl : ImplBase::type { R operator()(Args&&... arg) const { static constexpr size_t kMaxArgs = sizeof...(Args) <= 10 ? sizeof...(Args) : 10; - return Apply(MakeIndexSequence{}, - MakeIndexSequence<10 - kMaxArgs>{}, + return Apply(std::make_index_sequence{}, + std::make_index_sequence<10 - kMaxArgs>{}, args_type{std::forward(arg)...}); } template - R Apply(IndexSequence, IndexSequence, + R Apply(std::index_sequence, std::index_sequence, const args_type& args) const { // Impl need not be specific to the signature of action being implemented; // only the implementing function body needs to have all of the specific diff --git a/yass/third_party/googletest/googlemock/include/gmock/gmock-matchers.h b/yass/third_party/googletest/googlemock/include/gmock/gmock-matchers.h index 8052c74a1d..6b6b4371bb 100644 --- a/yass/third_party/googletest/googlemock/include/gmock/gmock-matchers.h +++ b/yass/third_party/googletest/googlemock/include/gmock/gmock-matchers.h @@ -490,12 +490,12 @@ class MatcherBaseImpl> { template operator ::testing::Matcher() const { // NOLINT(runtime/explicit) - return Apply(MakeIndexSequence{}); + return Apply(std::make_index_sequence{}); } private: template - ::testing::Matcher Apply(IndexSequence) const { + ::testing::Matcher Apply(std::index_sequence) const { return ::testing::Matcher( new typename Derived::template gmock_Impl( std::get(params_)...)); @@ -2920,26 +2920,27 @@ class EachMatcher { const M inner_matcher_; }; -struct Rank1 {}; -struct Rank0 : Rank1 {}; +// Use go/ranked-overloads for dispatching. +struct Rank0 {}; +struct Rank1 : Rank0 {}; namespace pair_getters { using std::get; template -auto First(T& x, Rank1) -> decltype(get<0>(x)) { // NOLINT +auto First(T& x, Rank0) -> decltype(get<0>(x)) { // NOLINT return get<0>(x); } template -auto First(T& x, Rank0) -> decltype((x.first)) { // NOLINT +auto First(T& x, Rank1) -> decltype((x.first)) { // NOLINT return x.first; } template -auto Second(T& x, Rank1) -> decltype(get<1>(x)) { // NOLINT +auto Second(T& x, Rank0) -> decltype(get<1>(x)) { // NOLINT return get<1>(x); } template -auto Second(T& x, Rank0) -> decltype((x.second)) { // NOLINT +auto Second(T& x, Rank1) -> decltype((x.second)) { // NOLINT return x.second; } } // namespace pair_getters @@ -2965,7 +2966,7 @@ class KeyMatcherImpl : public MatcherInterface { MatchResultListener* listener) const override { StringMatchResultListener inner_listener; const bool match = inner_matcher_.MatchAndExplain( - pair_getters::First(key_value, Rank0()), &inner_listener); + pair_getters::First(key_value, Rank1()), &inner_listener); const std::string explanation = inner_listener.str(); if (!explanation.empty()) { *listener << "whose first field is a value " << explanation; @@ -3087,18 +3088,18 @@ class PairMatcherImpl : public MatcherInterface { if (!listener->IsInterested()) { // If the listener is not interested, we don't need to construct the // explanation. - return first_matcher_.Matches(pair_getters::First(a_pair, Rank0())) && - second_matcher_.Matches(pair_getters::Second(a_pair, Rank0())); + return first_matcher_.Matches(pair_getters::First(a_pair, Rank1())) && + second_matcher_.Matches(pair_getters::Second(a_pair, Rank1())); } StringMatchResultListener first_inner_listener; - if (!first_matcher_.MatchAndExplain(pair_getters::First(a_pair, Rank0()), + if (!first_matcher_.MatchAndExplain(pair_getters::First(a_pair, Rank1()), &first_inner_listener)) { *listener << "whose first field does not match"; PrintIfNotEmpty(first_inner_listener.str(), listener->stream()); return false; } StringMatchResultListener second_inner_listener; - if (!second_matcher_.MatchAndExplain(pair_getters::Second(a_pair, Rank0()), + if (!second_matcher_.MatchAndExplain(pair_getters::Second(a_pair, Rank1()), &second_inner_listener)) { *listener << "whose second field does not match"; PrintIfNotEmpty(second_inner_listener.str(), listener->stream()); @@ -3151,8 +3152,8 @@ class PairMatcher { }; template -auto UnpackStructImpl(const T& t, IndexSequence, int) - -> decltype(std::tie(get(t)...)) { +auto UnpackStructImpl(const T& t, std::index_sequence, + int) -> decltype(std::tie(get(t)...)) { static_assert(std::tuple_size::value == sizeof...(I), "Number of arguments doesn't match the number of fields."); return std::tie(get(t)...); @@ -3160,97 +3161,97 @@ auto UnpackStructImpl(const T& t, IndexSequence, int) #if defined(__cpp_structured_bindings) && __cpp_structured_bindings >= 201606 template -auto UnpackStructImpl(const T& t, MakeIndexSequence<1>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<1>, char) { const auto& [a] = t; return std::tie(a); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<2>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<2>, char) { const auto& [a, b] = t; return std::tie(a, b); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<3>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<3>, char) { const auto& [a, b, c] = t; return std::tie(a, b, c); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<4>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<4>, char) { const auto& [a, b, c, d] = t; return std::tie(a, b, c, d); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<5>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<5>, char) { const auto& [a, b, c, d, e] = t; return std::tie(a, b, c, d, e); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<6>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<6>, char) { const auto& [a, b, c, d, e, f] = t; return std::tie(a, b, c, d, e, f); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<7>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<7>, char) { const auto& [a, b, c, d, e, f, g] = t; return std::tie(a, b, c, d, e, f, g); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<8>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<8>, char) { const auto& [a, b, c, d, e, f, g, h] = t; return std::tie(a, b, c, d, e, f, g, h); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<9>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<9>, char) { const auto& [a, b, c, d, e, f, g, h, i] = t; return std::tie(a, b, c, d, e, f, g, h, i); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<10>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<10>, char) { const auto& [a, b, c, d, e, f, g, h, i, j] = t; return std::tie(a, b, c, d, e, f, g, h, i, j); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<11>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<11>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<12>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<12>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<13>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<13>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<14>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<14>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<15>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<15>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<16>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<16>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<17>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<17>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<18>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<18>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r); } template -auto UnpackStructImpl(const T& t, MakeIndexSequence<19>, char) { +auto UnpackStructImpl(const T& t, std::make_index_sequence<19>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s); } @@ -3258,8 +3259,8 @@ auto UnpackStructImpl(const T& t, MakeIndexSequence<19>, char) { template auto UnpackStruct(const T& t) - -> decltype((UnpackStructImpl)(t, MakeIndexSequence{}, 0)) { - return (UnpackStructImpl)(t, MakeIndexSequence{}, 0); + -> decltype((UnpackStructImpl)(t, std::make_index_sequence{}, 0)) { + return (UnpackStructImpl)(t, std::make_index_sequence{}, 0); } // Helper function to do comma folding in C++11. @@ -3272,7 +3273,7 @@ template class FieldsAreMatcherImpl; template -class FieldsAreMatcherImpl> +class FieldsAreMatcherImpl> : public MatcherInterface { using UnpackedType = decltype(UnpackStruct(std::declval())); @@ -3354,8 +3355,8 @@ class FieldsAreMatcher { template operator Matcher() const { // NOLINT return Matcher( - new FieldsAreMatcherImpl>( - matchers_)); + new FieldsAreMatcherImpl>(matchers_)); } private: diff --git a/yass/third_party/googletest/googlemock/include/gmock/gmock-more-actions.h b/yass/third_party/googletest/googlemock/include/gmock/gmock-more-actions.h index 40300766f0..e341d47fca 100644 --- a/yass/third_party/googletest/googlemock/include/gmock/gmock-more-actions.h +++ b/yass/third_party/googletest/googlemock/include/gmock/gmock-more-actions.h @@ -592,8 +592,9 @@ namespace internal { // Overloads for other custom-callables are provided in the // internal/custom/gmock-generated-actions.h header. template -auto InvokeArgument(F f, Args... args) -> decltype(f(args...)) { - return f(args...); +auto InvokeArgument(F &&f, + Args... args) -> decltype(std::forward(f)(args...)) { + return std::forward(f)(args...); } template @@ -606,7 +607,7 @@ struct InvokeArgumentAction { internal::FlatTuple args_tuple(FlatTupleConstructTag{}, std::forward(args)...); return params.Apply([&](const Params &...unpacked_params) { - auto &&callable = args_tuple.template Get(); + auto &&callable = std::move(args_tuple.template Get()); return internal::InvokeArgument( std::forward(callable), unpacked_params...); }); diff --git a/yass/third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h b/yass/third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h index ead6d7c805..b7685f5730 100644 --- a/yass/third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/yass/third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -44,6 +44,7 @@ #include // NOLINT #include #include +#include #include #include "gmock/internal/gmock-port.h" @@ -420,7 +421,7 @@ struct RemoveConstFromKey > { GTEST_API_ void IllegalDoDefault(const char* file, int line); template -auto ApplyImpl(F&& f, Tuple&& args, IndexSequence) +auto ApplyImpl(F&& f, Tuple&& args, std::index_sequence) -> decltype(std::forward(f)( std::get(std::forward(args))...)) { return std::forward(f)(std::get(std::forward(args))...); @@ -428,12 +429,13 @@ auto ApplyImpl(F&& f, Tuple&& args, IndexSequence) // Apply the function to a tuple of arguments. template -auto Apply(F&& f, Tuple&& args) -> decltype(ApplyImpl( - std::forward(f), std::forward(args), - MakeIndexSequence::type>::value>())) { +auto Apply(F&& f, Tuple&& args) + -> decltype(ApplyImpl( + std::forward(f), std::forward(args), + std::make_index_sequence::type>::value>())) { return ApplyImpl(std::forward(f), std::forward(args), - MakeIndexSequence::type>::value>()); } diff --git a/yass/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h b/yass/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h index 55ddfb6c6a..e9d9e32a7a 100644 --- a/yass/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h +++ b/yass/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h @@ -56,7 +56,7 @@ #include "gmock/internal/custom/gmock-port.h" #include "gtest/internal/gtest-port.h" -#ifdef GTEST_HAS_ABSL +#if defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS) #include "absl/flags/declare.h" #include "absl/flags/flag.h" #endif @@ -73,7 +73,7 @@ #define GMOCK_FLAG(name) FLAGS_gmock_##name // Pick a command line flags implementation. -#ifdef GTEST_HAS_ABSL +#if defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS) // Macros for defining flags. #define GMOCK_DEFINE_bool_(name, default_val, doc) \ @@ -95,7 +95,7 @@ #define GMOCK_FLAG_SET(name, value) \ (void)(::absl::SetFlag(&GMOCK_FLAG(name), value)) -#else // GTEST_HAS_ABSL +#else // defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS) // Macros for defining flags. #define GMOCK_DEFINE_bool_(name, default_val, doc) \ @@ -134,6 +134,6 @@ #define GMOCK_FLAG_GET(name) ::testing::GMOCK_FLAG(name) #define GMOCK_FLAG_SET(name, value) (void)(::testing::GMOCK_FLAG(name) = value) -#endif // GTEST_HAS_ABSL +#endif // defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS) #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_ diff --git a/yass/third_party/googletest/googlemock/src/gmock-internal-utils.cc b/yass/third_party/googletest/googlemock/src/gmock-internal-utils.cc index 5c2ce0d57e..96c7e306ec 100644 --- a/yass/third_party/googletest/googlemock/src/gmock-internal-utils.cc +++ b/yass/third_party/googletest/googlemock/src/gmock-internal-utils.cc @@ -44,6 +44,7 @@ #include #include // NOLINT #include +#include #include #include "gmock/gmock.h" @@ -211,14 +212,14 @@ constexpr char UnBase64Impl(char c, const char* const base64, char carry) { } template -constexpr std::array UnBase64Impl(IndexSequence, +constexpr std::array UnBase64Impl(std::index_sequence, const char* const base64) { return { {UnBase64Impl(UndoWebSafeEncoding(static_cast(I)), base64, 0)...}}; } constexpr std::array UnBase64(const char* const base64) { - return UnBase64Impl(MakeIndexSequence<256>{}, base64); + return UnBase64Impl(std::make_index_sequence<256>{}, base64); } static constexpr char kBase64[] = diff --git a/yass/third_party/googletest/googlemock/src/gmock-spec-builders.cc b/yass/third_party/googletest/googlemock/src/gmock-spec-builders.cc index de89471635..ffdf03dd45 100644 --- a/yass/third_party/googletest/googlemock/src/gmock-spec-builders.cc +++ b/yass/third_party/googletest/googlemock/src/gmock-spec-builders.cc @@ -490,6 +490,7 @@ class MockObjectRegistry { // failure, unless the user explicitly asked us to ignore it. ~MockObjectRegistry() { if (!GMOCK_FLAG_GET(catch_leaked_mocks)) return; + internal::MutexLock l(&internal::g_gmock_mutex); int leaked_count = 0; for (StateMap::const_iterator it = states_.begin(); it != states_.end(); @@ -530,7 +531,7 @@ class MockObjectRegistry { #ifdef GTEST_OS_QURT qurt_exception_raise_fatal(); #else - _exit(1); // We cannot call exit() as it is not reentrant and + _Exit(1); // We cannot call exit() as it is not reentrant and // may already have been called. #endif } diff --git a/yass/third_party/googletest/googlemock/test/gmock-more-actions_test.cc b/yass/third_party/googletest/googlemock/test/gmock-more-actions_test.cc index 9980f3bc45..354a79b192 100644 --- a/yass/third_party/googletest/googlemock/test/gmock-more-actions_test.cc +++ b/yass/third_party/googletest/googlemock/test/gmock-more-actions_test.cc @@ -85,6 +85,16 @@ struct UnaryFunctor { int operator()(bool x) { return x ? 1 : -1; } }; +struct UnaryMoveOnlyFunctor : UnaryFunctor { + UnaryMoveOnlyFunctor() = default; + UnaryMoveOnlyFunctor(const UnaryMoveOnlyFunctor&) = delete; + UnaryMoveOnlyFunctor(UnaryMoveOnlyFunctor&&) = default; +}; + +struct OneShotUnaryFunctor { + int operator()(bool x) && { return x ? 1 : -1; } +}; + const char* Binary(const char* input, short n) { return input + n; } // NOLINT int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT @@ -698,12 +708,24 @@ TEST(InvokeArgumentTest, Function0) { EXPECT_EQ(1, a.Perform(std::make_tuple(2, &Nullary))); } -// Tests using InvokeArgument with a unary function. +// Tests using InvokeArgument with a unary functor. TEST(InvokeArgumentTest, Functor1) { Action a = InvokeArgument<0>(true); // NOLINT EXPECT_EQ(1, a.Perform(std::make_tuple(UnaryFunctor()))); } +// Tests using InvokeArgument with a unary move-only functor. +TEST(InvokeArgumentTest, Functor1MoveOnly) { + Action a = InvokeArgument<0>(true); // NOLINT + EXPECT_EQ(1, a.Perform(std::make_tuple(UnaryMoveOnlyFunctor()))); +} + +// Tests using InvokeArgument with a one-shot unary functor. +TEST(InvokeArgumentTest, OneShotFunctor1) { + Action a = InvokeArgument<0>(true); // NOLINT + EXPECT_EQ(1, a.Perform(std::make_tuple(OneShotUnaryFunctor()))); +} + // Tests using InvokeArgument with a 5-ary function. TEST(InvokeArgumentTest, Function5) { Action a = // NOLINT @@ -806,6 +828,22 @@ TEST(InvokeArgumentTest, ByExplicitConstReferenceFunction) { EXPECT_FALSE(a.Perform(std::make_tuple(&ReferencesGlobalDouble))); } +TEST(InvokeArgumentTest, MoveOnlyType) { + struct Marker {}; + struct { + // Method takes a unique_ptr (to a type we don't care about), and an + // invocable type. + MOCK_METHOD(bool, MockMethod, + (std::unique_ptr, std::function), ()); + } mock; + + ON_CALL(mock, MockMethod(_, _)).WillByDefault(InvokeArgument<1>()); + + // This compiles, but is a little opaque as a workaround: + ON_CALL(mock, MockMethod(_, _)) + .WillByDefault(WithArg<1>(InvokeArgument<0>())); +} + // Tests DoAll(a1, a2). TEST(DoAllTest, TwoActions) { int n = 0; diff --git a/yass/third_party/googletest/googletest/CMakeLists.txt b/yass/third_party/googletest/googletest/CMakeLists.txt index 51a67c915c..dce6a7c9ee 100644 --- a/yass/third_party/googletest/googletest/CMakeLists.txt +++ b/yass/third_party/googletest/googletest/CMakeLists.txt @@ -147,7 +147,7 @@ target_include_directories(gtest SYSTEM INTERFACE target_include_directories(gtest_main SYSTEM INTERFACE "$" "$/${CMAKE_INSTALL_INCLUDEDIR}>") -if(CMAKE_SYSTEM_NAME MATCHES "QNX") +if(CMAKE_SYSTEM_NAME MATCHES "QNX" AND CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 7.1) target_link_libraries(gtest PUBLIC regex) endif() target_link_libraries(gtest_main PUBLIC gtest) diff --git a/yass/third_party/googletest/googletest/cmake/Config.cmake.in b/yass/third_party/googletest/googletest/cmake/Config.cmake.in index 12be4498b1..3f706612b2 100644 --- a/yass/third_party/googletest/googletest/cmake/Config.cmake.in +++ b/yass/third_party/googletest/googletest/cmake/Config.cmake.in @@ -4,6 +4,10 @@ if (@GTEST_HAS_PTHREAD@) set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@) find_dependency(Threads) endif() +if (@GTEST_HAS_ABSL@) + find_dependency(absl) + find_dependency(re2) +endif() include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") check_required_components("@project_name@") diff --git a/yass/third_party/googletest/googletest/cmake/internal_utils.cmake b/yass/third_party/googletest/googletest/cmake/internal_utils.cmake index 21887b2e0c..580ac1cbc3 100644 --- a/yass/third_party/googletest/googletest/cmake/internal_utils.cmake +++ b/yass/third_party/googletest/googletest/cmake/internal_utils.cmake @@ -247,7 +247,9 @@ function(cxx_executable name dir libs) ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN}) endfunction() -find_package(Python3) +if(gtest_build_tests) + find_package(Python3) +endif() # cxx_test_with_flags(name cxx_flags libs srcs...) # diff --git a/yass/third_party/googletest/googletest/include/gtest/gtest-assertion-result.h b/yass/third_party/googletest/googletest/include/gtest/gtest-assertion-result.h index 56fe128f2a..74eb2b1f3c 100644 --- a/yass/third_party/googletest/googletest/include/gtest/gtest-assertion-result.h +++ b/yass/third_party/googletest/googletest/include/gtest/gtest-assertion-result.h @@ -129,7 +129,7 @@ namespace testing { // // Expected: Foo() is even // Actual: it's 5 -// + class GTEST_API_ AssertionResult { public: // Copy constructor. diff --git a/yass/third_party/googletest/googletest/include/gtest/gtest-printers.h b/yass/third_party/googletest/googletest/include/gtest/gtest-printers.h index 1b12ef683c..b2822bcde2 100644 --- a/yass/third_party/googletest/googletest/include/gtest/gtest-printers.h +++ b/yass/third_party/googletest/googletest/include/gtest/gtest-printers.h @@ -124,7 +124,7 @@ #if GTEST_INTERNAL_HAS_STD_SPAN #include // NOLINT -#endif // GTEST_INTERNAL_HAS_STD_SPAN +#endif // GTEST_INTERNAL_HAS_STD_SPAN namespace testing { @@ -241,8 +241,8 @@ struct StreamPrinter { // ADL (possibly involving implicit conversions). // (Use SFINAE via return type, because it seems GCC < 12 doesn't handle name // lookup properly when we do it in the template parameter list.) - static auto PrintValue(const T& value, ::std::ostream* os) - -> decltype((void)(*os << value)) { + static auto PrintValue(const T& value, + ::std::ostream* os) -> decltype((void)(*os << value)) { // Call streaming operator found by ADL, possibly with implicit conversions // of the arguments. *os << value; @@ -552,49 +552,63 @@ int AppropriateResolution(FloatType val) { int full = std::numeric_limits::max_digits10; if (val < 0) val = -val; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfloat-equal" +#endif if (val < 1000000) { FloatType mulfor6 = 1e10; - if (val >= 100000.0) { // 100,000 to 999,999 + // Without these static casts, the template instantiation for float would + // fail to compile when -Wdouble-promotion is enabled, as the arithmetic and + // comparison logic would promote floats to doubles. + if (val >= static_cast(100000.0)) { // 100,000 to 999,999 mulfor6 = 1.0; - } else if (val >= 10000.0) { + } else if (val >= static_cast(10000.0)) { mulfor6 = 1e1; - } else if (val >= 1000.0) { + } else if (val >= static_cast(1000.0)) { mulfor6 = 1e2; - } else if (val >= 100.0) { + } else if (val >= static_cast(100.0)) { mulfor6 = 1e3; - } else if (val >= 10.0) { + } else if (val >= static_cast(10.0)) { mulfor6 = 1e4; - } else if (val >= 1.0) { + } else if (val >= static_cast(1.0)) { mulfor6 = 1e5; - } else if (val >= 0.1) { + } else if (val >= static_cast(0.1)) { mulfor6 = 1e6; - } else if (val >= 0.01) { + } else if (val >= static_cast(0.01)) { mulfor6 = 1e7; - } else if (val >= 0.001) { + } else if (val >= static_cast(0.001)) { mulfor6 = 1e8; - } else if (val >= 0.0001) { + } else if (val >= static_cast(0.0001)) { mulfor6 = 1e9; } - if (static_cast(static_cast(val * mulfor6 + 0.5)) / + if (static_cast(static_cast( + val * mulfor6 + (static_cast(0.5)))) / mulfor6 == val) return 6; - } else if (val < 1e10) { - FloatType divfor6 = 1.0; - if (val >= 1e9) { // 1,000,000,000 to 9,999,999,999 + } else if (val < static_cast(1e10)) { + FloatType divfor6 = static_cast(1.0); + if (val >= static_cast(1e9)) { // 1,000,000,000 to 9,999,999,999 divfor6 = 10000; - } else if (val >= 1e8) { // 100,000,000 to 999,999,999 + } else if (val >= + static_cast(1e8)) { // 100,000,000 to 999,999,999 divfor6 = 1000; - } else if (val >= 1e7) { // 10,000,000 to 99,999,999 + } else if (val >= + static_cast(1e7)) { // 10,000,000 to 99,999,999 divfor6 = 100; - } else if (val >= 1e6) { // 1,000,000 to 9,999,999 + } else if (val >= static_cast(1e6)) { // 1,000,000 to 9,999,999 divfor6 = 10; } - if (static_cast(static_cast(val / divfor6 + 0.5)) * + if (static_cast(static_cast( + val / divfor6 + (static_cast(0.5)))) * divfor6 == val) return 6; } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif return full; } diff --git a/yass/third_party/googletest/googletest/include/gtest/gtest.h b/yass/third_party/googletest/googletest/include/gtest/gtest.h index a932e686af..c899669520 100644 --- a/yass/third_party/googletest/googletest/include/gtest/gtest.h +++ b/yass/third_party/googletest/googletest/include/gtest/gtest.h @@ -60,16 +60,16 @@ #include #include -#include "gtest/gtest-assertion-result.h" -#include "gtest/gtest-death-test.h" -#include "gtest/gtest-matchers.h" -#include "gtest/gtest-message.h" -#include "gtest/gtest-param-test.h" -#include "gtest/gtest-printers.h" -#include "gtest/gtest-test-part.h" -#include "gtest/gtest-typed-test.h" -#include "gtest/gtest_pred_impl.h" -#include "gtest/gtest_prod.h" +#include "gtest/gtest-assertion-result.h" // IWYU pragma: export +#include "gtest/gtest-death-test.h" // IWYU pragma: export +#include "gtest/gtest-matchers.h" // IWYU pragma: export +#include "gtest/gtest-message.h" // IWYU pragma: export +#include "gtest/gtest-param-test.h" // IWYU pragma: export +#include "gtest/gtest-printers.h" // IWYU pragma: export +#include "gtest/gtest-test-part.h" // IWYU pragma: export +#include "gtest/gtest-typed-test.h" // IWYU pragma: export +#include "gtest/gtest_pred_impl.h" // IWYU pragma: export +#include "gtest/gtest_prod.h" // IWYU pragma: export #include "gtest/internal/gtest-internal.h" #include "gtest/internal/gtest-string.h" @@ -607,7 +607,7 @@ class GTEST_API_ TestInfo { friend class internal::UnitTestImpl; friend class internal::StreamingListenerTest; friend TestInfo* internal::MakeAndRegisterTestInfo( - const char* test_suite_name, const char* name, const char* type_param, + std::string test_suite_name, const char* name, const char* type_param, const char* value_param, internal::CodeLocation code_location, internal::TypeId fixture_class_id, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc, @@ -615,7 +615,7 @@ class GTEST_API_ TestInfo { // Constructs a TestInfo object. The newly constructed instance assumes // ownership of the factory object. - TestInfo(const std::string& test_suite_name, const std::string& name, + TestInfo(std::string test_suite_name, std::string name, const char* a_type_param, // NULL if not a type-parameterized test const char* a_value_param, // NULL if not a value-parameterized test internal::CodeLocation a_code_location, @@ -683,7 +683,7 @@ class GTEST_API_ TestSuite { // this is not a type-parameterized test. // set_up_tc: pointer to the function that sets up the test suite // tear_down_tc: pointer to the function that tears down the test suite - TestSuite(const char* name, const char* a_type_param, + TestSuite(const std::string& name, const char* a_type_param, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc); @@ -1262,6 +1262,20 @@ class GTEST_API_ UnitTest { // total_test_suite_count() - 1. If i is not in that range, returns NULL. TestSuite* GetMutableTestSuite(int i); + // Invokes OsStackTrackGetterInterface::UponLeavingGTest. UponLeavingGTest() + // should be called immediately before Google Test calls user code. It saves + // some information about the current stack that CurrentStackTrace() will use + // to find and hide Google Test stack frames. + void UponLeavingGTest(); + + // Sets the TestSuite object for the test that's currently running. + void set_current_test_suite(TestSuite* a_current_test_suite) + GTEST_LOCK_EXCLUDED_(mutex_); + + // Sets the TestInfo object for the test that's currently running. + void set_current_test_info(TestInfo* a_current_test_info) + GTEST_LOCK_EXCLUDED_(mutex_); + // Accessors for the implementation object. internal::UnitTestImpl* impl() { return impl_; } const internal::UnitTestImpl* impl() const { return impl_; } @@ -1270,6 +1284,8 @@ class GTEST_API_ UnitTest { // members of UnitTest. friend class ScopedTrace; friend class Test; + friend class TestInfo; + friend class TestSuite; friend class internal::AssertHelper; friend class internal::StreamingListenerTest; friend class internal::UnitTestRecordPropertyTestHelper; @@ -1751,6 +1767,7 @@ class TestWithParam : public Test, public WithParamInterface {}; // generic name and clashes with some other libraries. #if !(defined(GTEST_DONT_DEFINE_FAIL) && GTEST_DONT_DEFINE_FAIL) #define FAIL() GTEST_FAIL() +#define FAIL_AT(file, line) GTEST_FAIL_AT(file, line) #endif // Generates a success with a generic message. @@ -2307,7 +2324,8 @@ TestInfo* RegisterTest(const char* test_suite_name, const char* test_name, // tests are successful, or 1 otherwise. // // RUN_ALL_TESTS() should be invoked after the command line has been -// parsed by InitGoogleTest(). +// parsed by InitGoogleTest(). RUN_ALL_TESTS will tear down and delete any +// installed environments and should only be called once per binary. // // This function was formerly a macro; thus, it is in the global // namespace and has an all-caps name. diff --git a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h index 61536d6572..3925e36baf 100644 --- a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h +++ b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h @@ -71,7 +71,7 @@ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ // // exit status: The integer exit information in the format specified // by wait(2) -// exit code: The integer code passed to exit(3), _exit(2), or +// exit code: The integer code passed to exit(3), _Exit(2), or // returned from main() class GTEST_API_ DeathTest { public: diff --git a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h index 5189c81dab..6dc47be54a 100644 --- a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h +++ b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h @@ -43,6 +43,7 @@ #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ #include +#include #include "gtest/internal/gtest-port.h" #include "gtest/internal/gtest-string.h" @@ -70,8 +71,9 @@ class GTEST_API_ FilePath { public: FilePath() : pathname_("") {} FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) {} + FilePath(FilePath&& rhs) noexcept : pathname_(std::move(rhs.pathname_)) {} - explicit FilePath(const std::string& pathname) : pathname_(pathname) { + explicit FilePath(std::string pathname) : pathname_(std::move(pathname)) { Normalize(); } @@ -79,6 +81,10 @@ class GTEST_API_ FilePath { Set(rhs); return *this; } + FilePath& operator=(FilePath&& rhs) noexcept { + pathname_ = std::move(rhs.pathname_); + return *this; + } void Set(const FilePath& rhs) { pathname_ = rhs.pathname_; } diff --git a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h index 4f077fcfbe..cffb8e1145 100644 --- a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h +++ b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h @@ -474,8 +474,8 @@ using SetUpTestSuiteFunc = void (*)(); using TearDownTestSuiteFunc = void (*)(); struct CodeLocation { - CodeLocation(const std::string& a_file, int a_line) - : file(a_file), line(a_line) {} + CodeLocation(std::string a_file, int a_line) + : file(std::move(a_file)), line(a_line) {} std::string file; int line; @@ -555,7 +555,7 @@ struct SuiteApiResolver : T { // type_param: the name of the test's type parameter, or NULL if // this is not a typed or a type-parameterized test. // value_param: text representation of the test's value parameter, -// or NULL if this is not a type-parameterized test. +// or NULL if this is not a value-parameterized test. // code_location: code location where the test is defined // fixture_class_id: ID of the test fixture class // set_up_tc: pointer to the function that sets up the test suite @@ -564,7 +564,7 @@ struct SuiteApiResolver : T { // The newly created TestInfo instance will assume // ownership of the factory object. GTEST_API_ TestInfo* MakeAndRegisterTestInfo( - const char* test_suite_name, const char* name, const char* type_param, + std::string test_suite_name, const char* name, const char* type_param, const char* value_param, CodeLocation code_location, TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc, TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory); @@ -595,8 +595,7 @@ class GTEST_API_ TypedTestSuitePState { fflush(stderr); posix::Abort(); } - registered_tests_.insert( - ::std::make_pair(test_name, CodeLocation(file, line))); + registered_tests_.emplace(test_name, CodeLocation(file, line)); return true; } @@ -700,7 +699,7 @@ class TypeParameterizedTest { // specified in INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, TestSuite, // Types). Valid values for 'index' are [0, N - 1] where N is the // length of Types. - static bool Register(const char* prefix, const CodeLocation& code_location, + static bool Register(const char* prefix, CodeLocation code_location, const char* case_name, const char* test_names, int index, const std::vector& type_names = GenerateNames()) { @@ -712,8 +711,7 @@ class TypeParameterizedTest { // list. MakeAndRegisterTestInfo( (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + - "/" + type_names[static_cast(index)]) - .c_str(), + "/" + type_names[static_cast(index)]), StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(), GetTypeName().c_str(), nullptr, // No value parameter. @@ -725,13 +723,9 @@ class TypeParameterizedTest { new TestFactoryImpl); // Next, recurses (at compile time) with the tail of the type list. - return TypeParameterizedTest::Register(prefix, - code_location, - case_name, - test_names, - index + 1, - type_names); + return TypeParameterizedTest:: + Register(prefix, std::move(code_location), case_name, test_names, + index + 1, type_names); } }; @@ -739,7 +733,7 @@ class TypeParameterizedTest { template class TypeParameterizedTest { public: - static bool Register(const char* /*prefix*/, const CodeLocation&, + static bool Register(const char* /*prefix*/, CodeLocation, const char* /*case_name*/, const char* /*test_names*/, int /*index*/, const std::vector& = @@ -786,7 +780,8 @@ class TypeParameterizedTestSuite { // Next, recurses (at compile time) with the tail of the test list. return TypeParameterizedTestSuite::Register(prefix, code_location, + Types>::Register(prefix, + std::move(code_location), state, case_name, SkipComma(test_names), type_names); @@ -1142,40 +1137,6 @@ class NativeArray { void (NativeArray::*clone_)(const Element*, size_t); }; -// Backport of std::index_sequence. -template -struct IndexSequence { - using type = IndexSequence; -}; - -// Double the IndexSequence, and one if plus_one is true. -template -struct DoubleSequence; -template -struct DoubleSequence, sizeofT> { - using type = IndexSequence; -}; -template -struct DoubleSequence, sizeofT> { - using type = IndexSequence; -}; - -// Backport of std::make_index_sequence. -// It uses O(ln(N)) instantiation depth. -template -struct MakeIndexSequenceImpl - : DoubleSequence::type, - N / 2>::type {}; - -template <> -struct MakeIndexSequenceImpl<0> : IndexSequence<> {}; - -template -using MakeIndexSequence = typename MakeIndexSequenceImpl::type; - -template -using IndexSequenceFor = typename MakeIndexSequence::type; - template struct Ignore { Ignore(...); // NOLINT @@ -1184,7 +1145,7 @@ struct Ignore { template struct ElemFromListImpl; template -struct ElemFromListImpl> { +struct ElemFromListImpl> { // We make Ignore a template to solve a problem with MSVC. // A non-template Ignore would work fine with `decltype(Ignore(I))...`, but // MSVC doesn't understand how to deal with that pack expansion. @@ -1195,9 +1156,8 @@ struct ElemFromListImpl> { template struct ElemFromList { - using type = - decltype(ElemFromListImpl::type>::Apply( - static_cast(nullptr)...)); + using type = decltype(ElemFromListImpl>::Apply( + static_cast(nullptr)...)); }; struct FlatTupleConstructTag {}; @@ -1222,9 +1182,9 @@ template struct FlatTupleBase; template -struct FlatTupleBase, IndexSequence> +struct FlatTupleBase, std::index_sequence> : FlatTupleElemBase, Idx>... { - using Indices = IndexSequence; + using Indices = std::index_sequence; FlatTupleBase() = default; template explicit FlatTupleBase(FlatTupleConstructTag, Args&&... args) @@ -1259,14 +1219,15 @@ struct FlatTupleBase, IndexSequence> // implementations. // FlatTuple and ElemFromList are not recursive and have a fixed depth // regardless of T... -// MakeIndexSequence, on the other hand, it is recursive but with an +// std::make_index_sequence, on the other hand, it is recursive but with an // instantiation depth of O(ln(N)). template class FlatTuple : private FlatTupleBase, - typename MakeIndexSequence::type> { - using Indices = typename FlatTupleBase< - FlatTuple, typename MakeIndexSequence::type>::Indices; + std::make_index_sequence> { + using Indices = + typename FlatTupleBase, + std::make_index_sequence>::Indices; public: FlatTuple() = default; diff --git a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h index b04f702063..cc7ea53173 100644 --- a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h +++ b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -85,7 +86,7 @@ namespace internal { // TEST_P macro is used to define two tests with the same name // but in different namespaces. GTEST_API_ void ReportInvalidTestSuiteType(const char* test_suite_name, - CodeLocation code_location); + const CodeLocation& code_location); template class ParamGeneratorInterface; @@ -379,9 +380,7 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface { // integer test parameter index. template std::string DefaultParamName(const TestParamInfo& info) { - Message name_stream; - name_stream << info.index; - return name_stream.GetString(); + return std::to_string(info.index); } template @@ -513,9 +512,10 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase { typedef ParamGenerator(GeneratorCreationFunc)(); using ParamNameGeneratorFunc = std::string(const TestParamInfo&); - explicit ParameterizedTestSuiteInfo(const char* name, + explicit ParameterizedTestSuiteInfo(std::string name, CodeLocation code_location) - : test_suite_name_(name), code_location_(code_location) {} + : test_suite_name_(std::move(name)), + code_location_(std::move(code_location)) {} // Test suite base name for display purposes. const std::string& GetTestSuiteName() const override { @@ -529,20 +529,21 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase { // prefix). test_base_name is the name of an individual test without // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is // test suite base name and DoBar is test base name. - void AddTestPattern(const char* test_suite_name, const char* test_base_name, + void AddTestPattern(const char*, + const char* test_base_name, TestMetaFactoryBase* meta_factory, CodeLocation code_location) { - tests_.push_back(std::shared_ptr(new TestInfo( - test_suite_name, test_base_name, meta_factory, code_location))); + tests_.emplace_back( + new TestInfo(test_base_name, meta_factory, std::move(code_location))); } // INSTANTIATE_TEST_SUITE_P macro uses AddGenerator() to record information // about a generator. - int AddTestSuiteInstantiation(const std::string& instantiation_name, + int AddTestSuiteInstantiation(std::string instantiation_name, GeneratorCreationFunc* func, ParamNameGeneratorFunc* name_func, const char* file, int line) { - instantiations_.push_back( - InstantiationInfo(instantiation_name, func, name_func, file, line)); + instantiations_.emplace_back(std::move(instantiation_name), func, name_func, + file, line); return 0; // Return value used only to run this method in namespace scope. } // UnitTest class invokes this method to register tests in this test suite @@ -553,34 +554,31 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase { void RegisterTests() override { bool generated_instantiations = false; - for (typename TestInfoContainer::iterator test_it = tests_.begin(); - test_it != tests_.end(); ++test_it) { - std::shared_ptr test_info = *test_it; - for (typename InstantiationContainer::iterator gen_it = - instantiations_.begin(); - gen_it != instantiations_.end(); ++gen_it) { - const std::string& instantiation_name = gen_it->name; - ParamGenerator generator((*gen_it->generator)()); - ParamNameGeneratorFunc* name_func = gen_it->name_func; - const char* file = gen_it->file; - int line = gen_it->line; + std::string test_suite_name; + std::string test_name; + for (const std::shared_ptr& test_info : tests_) { + for (const InstantiationInfo& instantiation : instantiations_) { + const std::string& instantiation_name = instantiation.name; + ParamGenerator generator((*instantiation.generator)()); + ParamNameGeneratorFunc* name_func = instantiation.name_func; + const char* file = instantiation.file; + int line = instantiation.line; - std::string test_suite_name; if (!instantiation_name.empty()) test_suite_name = instantiation_name + "/"; - test_suite_name += test_info->test_suite_base_name; + else + test_suite_name.clear(); + test_suite_name += test_suite_name_; size_t i = 0; std::set test_param_names; - for (typename ParamGenerator::iterator param_it = - generator.begin(); - param_it != generator.end(); ++param_it, ++i) { + for (const auto& param : generator) { generated_instantiations = true; - Message test_name_stream; + test_name.clear(); std::string param_name = - name_func(TestParamInfo(*param_it, i)); + name_func(TestParamInfo(param, i)); GTEST_CHECK_(IsValidParamName(param_name)) << "Parameterized test name '" << param_name @@ -592,23 +590,25 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase { << "Duplicate parameterized test name '" << param_name << "', in " << file << " line " << line << std::endl; - test_param_names.insert(param_name); - if (!test_info->test_base_name.empty()) { - test_name_stream << test_info->test_base_name << "/"; + test_name.append(test_info->test_base_name).append("/"); } - test_name_stream << param_name; + test_name += param_name; + + test_param_names.insert(std::move(param_name)); + MakeAndRegisterTestInfo( - test_suite_name.c_str(), test_name_stream.GetString().c_str(), + test_suite_name, test_name.c_str(), nullptr, // No type parameter. - PrintToString(*param_it).c_str(), test_info->code_location, + PrintToString(param).c_str(), test_info->code_location, GetTestSuiteTypeId(), SuiteApiResolver::GetSetUpCaseOrSuite(file, line), SuiteApiResolver::GetTearDownCaseOrSuite(file, line), - test_info->test_meta_factory->CreateTestFactory(*param_it)); - } // for param_it - } // for gen_it - } // for test_it + test_info->test_meta_factory->CreateTestFactory(param)); + ++i; + } // for param + } // for instantiation + } // for test_info if (!generated_instantiations) { // There are no generaotrs, or they all generate nothing ... @@ -621,15 +621,13 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase { // LocalTestInfo structure keeps information about a single test registered // with TEST_P macro. struct TestInfo { - TestInfo(const char* a_test_suite_base_name, const char* a_test_base_name, + TestInfo(const char* a_test_base_name, TestMetaFactoryBase* a_test_meta_factory, CodeLocation a_code_location) - : test_suite_base_name(a_test_suite_base_name), - test_base_name(a_test_base_name), + : test_base_name(a_test_base_name), test_meta_factory(a_test_meta_factory), - code_location(a_code_location) {} + code_location(std::move(a_code_location)) {} - const std::string test_suite_base_name; const std::string test_base_name; const std::unique_ptr> test_meta_factory; const CodeLocation code_location; @@ -639,11 +637,10 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase { // struct InstantiationInfo { - InstantiationInfo(const std::string& name_in, - GeneratorCreationFunc* generator_in, + InstantiationInfo(std::string name_in, GeneratorCreationFunc* generator_in, ParamNameGeneratorFunc* name_func_in, const char* file_in, int line_in) - : name(name_in), + : name(std::move(name_in)), generator(generator_in), name_func(name_func_in), file(file_in), @@ -704,29 +701,32 @@ class ParameterizedTestSuiteRegistry { // tests and instantiations of a particular test suite. template ParameterizedTestSuiteInfo* GetTestSuitePatternHolder( - const char* test_suite_name, CodeLocation code_location) { + std::string test_suite_name, CodeLocation code_location) { ParameterizedTestSuiteInfo* typed_test_info = nullptr; - for (auto& test_suite_info : test_suite_infos_) { - if (test_suite_info->GetTestSuiteName() == test_suite_name) { - if (test_suite_info->GetTestSuiteTypeId() != GetTypeId()) { - // Complain about incorrect usage of Google Test facilities - // and terminate the program since we cannot guaranty correct - // test suite setup and tear-down in this case. - ReportInvalidTestSuiteType(test_suite_name, code_location); - posix::Abort(); - } else { - // At this point we are sure that the object we found is of the same - // type we are looking for, so we downcast it to that type - // without further checks. - typed_test_info = CheckedDowncastToActualType< - ParameterizedTestSuiteInfo>(test_suite_info); - } - break; + + auto item_it = suite_name_to_info_index_.find(test_suite_name); + if (item_it != suite_name_to_info_index_.end()) { + auto* test_suite_info = test_suite_infos_[item_it->second]; + if (test_suite_info->GetTestSuiteTypeId() != GetTypeId()) { + // Complain about incorrect usage of Google Test facilities + // and terminate the program since we cannot guaranty correct + // test suite setup and tear-down in this case. + ReportInvalidTestSuiteType(test_suite_name.c_str(), code_location); + posix::Abort(); + } else { + // At this point we are sure that the object we found is of the same + // type we are looking for, so we downcast it to that type + // without further checks. + typed_test_info = + CheckedDowncastToActualType>( + test_suite_info); } } if (typed_test_info == nullptr) { typed_test_info = new ParameterizedTestSuiteInfo( - test_suite_name, code_location); + test_suite_name, std::move(code_location)); + suite_name_to_info_index_.emplace(std::move(test_suite_name), + test_suite_infos_.size()); test_suite_infos_.push_back(typed_test_info); } return typed_test_info; @@ -740,8 +740,9 @@ class ParameterizedTestSuiteRegistry { #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ template ParameterizedTestCaseInfo* GetTestCasePatternHolder( - const char* test_case_name, CodeLocation code_location) { - return GetTestSuitePatternHolder(test_case_name, code_location); + std::string test_case_name, CodeLocation code_location) { + return GetTestSuitePatternHolder(std::move(test_case_name), + std::move(code_location)); } #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ @@ -750,6 +751,7 @@ class ParameterizedTestSuiteRegistry { using TestSuiteInfoContainer = ::std::vector; TestSuiteInfoContainer test_suite_infos_; + ::std::unordered_map suite_name_to_info_index_; ParameterizedTestSuiteRegistry(const ParameterizedTestSuiteRegistry&) = delete; @@ -776,7 +778,7 @@ class TypeParameterizedTestSuiteRegistry { private: struct TypeParameterizedTestSuiteInfo { explicit TypeParameterizedTestSuiteInfo(CodeLocation c) - : code_location(c), instantiated(false) {} + : code_location(std::move(c)), instantiated(false) {} CodeLocation code_location; bool instantiated; @@ -805,12 +807,12 @@ class ValueArray { template operator ParamGenerator() const { // NOLINT - return ValuesIn(MakeVector(MakeIndexSequence())); + return ValuesIn(MakeVector(std::make_index_sequence())); } private: template - std::vector MakeVector(IndexSequence) const { + std::vector MakeVector(std::index_sequence) const { return std::vector{static_cast(v_.template Get())...}; } @@ -840,7 +842,7 @@ class CartesianProductGenerator template class IteratorImpl; template - class IteratorImpl> + class IteratorImpl> : public ParamIteratorInterface { public: IteratorImpl(const ParamGeneratorInterface* base, @@ -931,7 +933,7 @@ class CartesianProductGenerator std::shared_ptr current_value_; }; - using Iterator = IteratorImpl::type>; + using Iterator = IteratorImpl>; std::tuple...> generators_; }; diff --git a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h index 3162f2b1cb..7ec968f312 100644 --- a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h +++ b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h @@ -56,6 +56,8 @@ #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE) #define GTEST_OS_WINDOWS_PHONE 1 #define GTEST_OS_WINDOWS_TV_TITLE 1 +#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_GAMES) +#define GTEST_OS_WINDOWS_GAMES 1 #else // WINAPI_FAMILY defined but no known partition matched. // Default to desktop. diff --git a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-port.h b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-port.h index d061a49b9f..6c469e9bea 100644 --- a/yass/third_party/googletest/googletest/include/gtest/internal/gtest-port.h +++ b/yass/third_party/googletest/googletest/include/gtest/internal/gtest-port.h @@ -338,7 +338,8 @@ #define GTEST_HAS_NOTIFICATION_ 0 #endif -#ifdef GTEST_HAS_ABSL +#if defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS) +#define GTEST_INTERNAL_HAS_ABSL_FLAGS // Used only in this file. #include "absl/flags/declare.h" #include "absl/flags/flag.h" #include "absl/flags/reflection.h" @@ -658,9 +659,9 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; // platforms except known mobile / embedded ones. Also, if the port doesn't have // a file system, stream redirection is not supported. #if defined(GTEST_OS_WINDOWS_MOBILE) || defined(GTEST_OS_WINDOWS_PHONE) || \ - defined(GTEST_OS_WINDOWS_RT) || defined(GTEST_OS_ESP8266) || \ - defined(GTEST_OS_XTENSA) || defined(GTEST_OS_QURT) || \ - !GTEST_HAS_FILE_SYSTEM + defined(GTEST_OS_WINDOWS_RT) || defined(GTEST_OS_WINDOWS_GAMES) || \ + defined(GTEST_OS_ESP8266) || defined(GTEST_OS_XTENSA) || \ + defined(GTEST_OS_QURT) || !GTEST_HAS_FILE_SYSTEM #define GTEST_HAS_STREAM_REDIRECTION 0 #else #define GTEST_HAS_STREAM_REDIRECTION 1 @@ -2005,7 +2006,9 @@ inline std::string StripTrailingSpaces(std::string str) { namespace posix { // File system porting. -#if GTEST_HAS_FILE_SYSTEM +// Note: Not every I/O-related function is related to file systems, so don't +// just disable all of them here. For example, fileno() and isatty(), etc. must +// always be available in order to detect if a pipe points to a terminal. #ifdef GTEST_OS_WINDOWS typedef struct _stat StatStruct; @@ -2016,27 +2019,32 @@ inline int FileNo(FILE* file) { return reinterpret_cast(_fileno(file)); } // time and thus not defined there. #else inline int FileNo(FILE* file) { return _fileno(file); } +#if GTEST_HAS_FILE_SYSTEM inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); } inline int RmDir(const char* dir) { return _rmdir(dir); } inline bool IsDir(const StatStruct& st) { return (_S_IFDIR & st.st_mode) != 0; } +#endif #endif // GTEST_OS_WINDOWS_MOBILE #elif defined(GTEST_OS_ESP8266) typedef struct stat StatStruct; inline int FileNo(FILE* file) { return fileno(file); } +#if GTEST_HAS_FILE_SYSTEM inline int Stat(const char* path, StatStruct* buf) { // stat function not implemented on ESP8266 return 0; } inline int RmDir(const char* dir) { return rmdir(dir); } inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } +#endif #else typedef struct stat StatStruct; inline int FileNo(FILE* file) { return fileno(file); } +#if GTEST_HAS_FILE_SYSTEM inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); } #ifdef GTEST_OS_QURT // QuRT doesn't support any directory functions, including rmdir @@ -2045,9 +2053,9 @@ inline int RmDir(const char*) { return 0; } inline int RmDir(const char* dir) { return rmdir(dir); } #endif inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } +#endif #endif // GTEST_OS_WINDOWS -#endif // GTEST_HAS_FILE_SYSTEM // Other functions with a different name on Windows. @@ -2100,8 +2108,9 @@ GTEST_DISABLE_MSC_DEPRECATED_PUSH_() // defined there. #if GTEST_HAS_FILE_SYSTEM #if !defined(GTEST_OS_WINDOWS_MOBILE) && !defined(GTEST_OS_WINDOWS_PHONE) && \ - !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_ESP8266) && \ - !defined(GTEST_OS_XTENSA) && !defined(GTEST_OS_QURT) + !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_WINDOWS_GAMES) && \ + !defined(GTEST_OS_ESP8266) && !defined(GTEST_OS_XTENSA) && \ + !defined(GTEST_OS_QURT) inline int ChDir(const char* dir) { return chdir(dir); } #endif inline FILE* FOpen(const char* path, const char* mode) { @@ -2245,7 +2254,7 @@ using TimeInMillis = int64_t; // Represents time in milliseconds. #endif // !defined(GTEST_FLAG) // Pick a command line flags implementation. -#ifdef GTEST_HAS_ABSL +#ifdef GTEST_INTERNAL_HAS_ABSL_FLAGS // Macros for defining flags. #define GTEST_DEFINE_bool_(name, default_val, doc) \ @@ -2270,7 +2279,8 @@ using TimeInMillis = int64_t; // Represents time in milliseconds. (void)(::absl::SetFlag(>EST_FLAG(name), value)) #define GTEST_USE_OWN_FLAGFILE_FLAG_ 0 -#else // GTEST_HAS_ABSL +#undef GTEST_INTERNAL_HAS_ABSL_FLAGS +#else // ndef GTEST_INTERNAL_HAS_ABSL_FLAGS // Macros for defining flags. #define GTEST_DEFINE_bool_(name, default_val, doc) \ @@ -2312,7 +2322,7 @@ using TimeInMillis = int64_t; // Represents time in milliseconds. #define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value) #define GTEST_USE_OWN_FLAGFILE_FLAG_ 1 -#endif // GTEST_HAS_ABSL +#endif // GTEST_INTERNAL_HAS_ABSL_FLAGS // Thread annotations #if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_) diff --git a/yass/third_party/googletest/googletest/src/gtest-death-test.cc b/yass/third_party/googletest/googletest/src/gtest-death-test.cc index 8417a300f7..15472f1a79 100644 --- a/yass/third_party/googletest/googletest/src/gtest-death-test.cc +++ b/yass/third_party/googletest/googletest/src/gtest-death-test.cc @@ -32,6 +32,8 @@ #include "gtest/gtest-death-test.h" +#include + #include #include #include @@ -115,7 +117,7 @@ GTEST_DEFINE_string_( GTEST_DEFINE_bool_( death_test_use_fork, testing::internal::BoolFromGTestEnv("death_test_use_fork", false), - "Instructs to use fork()/_exit() instead of clone() in death tests. " + "Instructs to use fork()/_Exit() instead of clone() in death tests. " "Ignored and always uses fork() on POSIX systems where clone() is not " "implemented. Useful when running under valgrind or similar tools if " "those do not support clone(). Valgrind 3.3.1 will just fail if " @@ -299,7 +301,7 @@ enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW }; fputc(kDeathTestInternalError, parent); fprintf(parent, "%s", message.c_str()); fflush(parent); - _exit(1); + _Exit(1); } else { fprintf(stderr, "%s", message.c_str()); fflush(stderr); @@ -511,7 +513,7 @@ std::string DeathTestImpl::GetErrorLogs() { return GetCapturedStderr(); } // Signals that the death test code which should have exited, didn't. // Should be called only in a death test child process. // Writes a status byte to the child's status file descriptor, then -// calls _exit(1). +// calls _Exit(1). void DeathTestImpl::Abort(AbortReason reason) { // The parent process considers the death test to be a failure if // it finds any data in our pipe. So, here we write a single flag byte @@ -523,13 +525,13 @@ void DeathTestImpl::Abort(AbortReason reason) { GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1)); // We are leaking the descriptor here because on some platforms (i.e., // when built as Windows DLL), destructors of global objects will still - // run after calling _exit(). On such systems, write_fd_ will be + // run after calling _Exit(). On such systems, write_fd_ will be // indirectly closed from the destructor of UnitTestImpl, causing double // close if it is also closed here. On debug configurations, double close // may assert. As there are no in-process buffers to flush here, we are // relying on the OS to close the descriptor after the process terminates // when the destructors are not run. - _exit(1); // Exits w/o any normal exit hooks (we were supposed to crash) + _Exit(1); // Exits w/o any normal exit hooks (we were supposed to crash) } // Returns an indented copy of stderr output for a death test. @@ -628,13 +630,13 @@ bool DeathTestImpl::Passed(bool status_ok) { #ifndef GTEST_OS_WINDOWS // Note: The return value points into args, so the return value's lifetime is // bound to that of args. -static std::unique_ptr CreateArgvFromArgs( - std::vector& args) { - auto result = std::make_unique(args.size() + 1); - for (size_t i = 0; i < args.size(); ++i) { - result[i] = &args[i][0]; +static std::vector CreateArgvFromArgs(std::vector& args) { + std::vector result; + result.reserve(args.size() + 1); + for (auto& arg : args) { + result.push_back(&arg[0]); } - result[args.size()] = nullptr; // extra null terminator + result.push_back(nullptr); // Extra null terminator. return result; } #endif @@ -1034,8 +1036,8 @@ DeathTest::TestRole FuchsiaDeathTest::AssumeRole() { // "Fuchsia Test Component" which contains a "Fuchsia Component Manifest") // Launching processes is a privileged operation in Fuchsia, and the // declaration indicates that the ability is required for the component. - std::unique_ptr argv = CreateArgvFromArgs(args); - status = fdio_spawn_etc(child_job, FDIO_SPAWN_CLONE_ALL, argv[0], argv.get(), + std::vector argv = CreateArgvFromArgs(args); + status = fdio_spawn_etc(child_job, FDIO_SPAWN_CLONE_ALL, argv[0], argv.data(), nullptr, 2, spawn_actions, child_process_.reset_and_get_address(), nullptr); GTEST_DEATH_TEST_CHECK_(status == ZX_OK); @@ -1333,7 +1335,7 @@ static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) { #endif // GTEST_HAS_CLONE if (use_fork && (child_pid = fork()) == 0) { - _exit(ExecDeathTestChildMain(&args)); + _Exit(ExecDeathTestChildMain(&args)); } #endif // GTEST_OS_QNX #ifdef GTEST_OS_LINUX @@ -1386,8 +1388,8 @@ DeathTest::TestRole ExecDeathTest::AssumeRole() { // is necessary. FlushInfoLog(); - std::unique_ptr argv = CreateArgvFromArgs(args); - const pid_t child_pid = ExecDeathTestSpawnChild(argv.get(), pipe_fd[0]); + std::vector argv = CreateArgvFromArgs(args); + const pid_t child_pid = ExecDeathTestSpawnChild(argv.data(), pipe_fd[0]); GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1])); set_child_pid(child_pid); set_read_fd(pipe_fd[0]); diff --git a/yass/third_party/googletest/googletest/src/gtest-internal-inl.h b/yass/third_party/googletest/googletest/src/gtest-internal-inl.h index 4799a1e7ba..cc6f00488f 100644 --- a/yass/third_party/googletest/googletest/src/gtest-internal-inl.h +++ b/yass/third_party/googletest/googletest/src/gtest-internal-inl.h @@ -46,6 +46,7 @@ #include #include #include +#include #include #include "gtest/internal/gtest-port.h" @@ -649,13 +650,15 @@ class GTEST_API_ UnitTestImpl { // this is not a typed or a type-parameterized test. // set_up_tc: pointer to the function that sets up the test suite // tear_down_tc: pointer to the function that tears down the test suite - TestSuite* GetTestSuite(const char* test_suite_name, const char* type_param, + TestSuite* GetTestSuite(const std::string& test_suite_name, + const char* type_param, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc); // Legacy API is deprecated but still available #ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - TestCase* GetTestCase(const char* test_case_name, const char* type_param, + TestCase* GetTestCase(const std::string& test_case_name, + const char* type_param, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc) { return GetTestSuite(test_case_name, type_param, set_up_tc, tear_down_tc); @@ -681,13 +684,13 @@ class GTEST_API_ UnitTestImpl { // AddTestInfo(), which is called to register a TEST or TEST_F // before main() is reached. if (original_working_dir_.IsEmpty()) { - original_working_dir_.Set(FilePath::GetCurrentDir()); + original_working_dir_ = FilePath::GetCurrentDir(); GTEST_CHECK_(!original_working_dir_.IsEmpty()) << "Failed to get the current working directory."; } #endif // GTEST_HAS_FILE_SYSTEM - GetTestSuite(test_info->test_suite_name(), test_info->type_param(), + GetTestSuite(test_info->test_suite_name_, test_info->type_param(), set_up_tc, tear_down_tc) ->AddTestInfo(test_info); } @@ -709,18 +712,6 @@ class GTEST_API_ UnitTestImpl { return type_parameterized_test_registry_; } - // Sets the TestSuite object for the test that's currently running. - void set_current_test_suite(TestSuite* a_current_test_suite) { - current_test_suite_ = a_current_test_suite; - } - - // Sets the TestInfo object for the test that's currently running. If - // current_test_info is NULL, the assertion results will be stored in - // ad_hoc_test_result_. - void set_current_test_info(TestInfo* a_current_test_info) { - current_test_info_ = a_current_test_info; - } - // Registers all parameterized tests defined using TEST_P and // INSTANTIATE_TEST_SUITE_P, creating regular tests for each test/parameter // combination. This method can be called more then once; it has guards @@ -835,12 +826,30 @@ class GTEST_API_ UnitTestImpl { bool catch_exceptions() const { return catch_exceptions_; } private: + struct CompareTestSuitesByPointer { + bool operator()(const TestSuite* lhs, const TestSuite* rhs) const { + return lhs->name_ < rhs->name_; + } + }; + friend class ::testing::UnitTest; // Used by UnitTest::Run() to capture the state of // GTEST_FLAG(catch_exceptions) at the moment it starts. void set_catch_exceptions(bool value) { catch_exceptions_ = value; } + // Sets the TestSuite object for the test that's currently running. + void set_current_test_suite(TestSuite* a_current_test_suite) { + current_test_suite_ = a_current_test_suite; + } + + // Sets the TestInfo object for the test that's currently running. If + // current_test_info is NULL, the assertion results will be stored in + // ad_hoc_test_result_. + void set_current_test_info(TestInfo* a_current_test_info) { + current_test_info_ = a_current_test_info; + } + // The UnitTest object that owns this implementation object. UnitTest* const parent_; @@ -873,6 +882,9 @@ class GTEST_API_ UnitTestImpl { // elements in the vector. std::vector test_suites_; + // The set of TestSuites by name. + std::unordered_map test_suites_by_name_; + // Provides a level of indirection for the test suite list to allow // easy shuffling and restoring the test suite order. The i-th // element of this vector is the index of the i-th test suite in the diff --git a/yass/third_party/googletest/googletest/src/gtest-port.cc b/yass/third_party/googletest/googletest/src/gtest-port.cc index 3bb7dd4508..1038ad7bf6 100644 --- a/yass/third_party/googletest/googletest/src/gtest-port.cc +++ b/yass/third_party/googletest/googletest/src/gtest-port.cc @@ -587,9 +587,11 @@ class ThreadLocalRegistryImpl { // thread's ID. typedef std::map ThreadIdToThreadLocals; - // Holds the thread id and thread handle that we pass from - // StartWatcherThreadFor to WatcherThreadFunc. - typedef std::pair ThreadIdAndHandle; + struct WatcherThreadParams { + DWORD thread_id; + HANDLE handle; + Notification has_initialized; + }; static void StartWatcherThreadFor(DWORD thread_id) { // The returned handle will be kept in thread_map and closed by @@ -597,15 +599,20 @@ class ThreadLocalRegistryImpl { HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION, FALSE, thread_id); GTEST_CHECK_(thread != nullptr); + + WatcherThreadParams* watcher_thread_params = new WatcherThreadParams; + watcher_thread_params->thread_id = thread_id; + watcher_thread_params->handle = thread; + // We need to pass a valid thread ID pointer into CreateThread for it // to work correctly under Win98. DWORD watcher_thread_id; - HANDLE watcher_thread = ::CreateThread( - nullptr, // Default security. - 0, // Default stack size - &ThreadLocalRegistryImpl::WatcherThreadFunc, - reinterpret_cast(new ThreadIdAndHandle(thread_id, thread)), - CREATE_SUSPENDED, &watcher_thread_id); + HANDLE watcher_thread = + ::CreateThread(nullptr, // Default security. + 0, // Default stack size + &ThreadLocalRegistryImpl::WatcherThreadFunc, + reinterpret_cast(watcher_thread_params), + CREATE_SUSPENDED, &watcher_thread_id); GTEST_CHECK_(watcher_thread != nullptr) << "CreateThread failed with error " << ::GetLastError() << "."; // Give the watcher thread the same priority as ours to avoid being @@ -614,17 +621,25 @@ class ThreadLocalRegistryImpl { ::GetThreadPriority(::GetCurrentThread())); ::ResumeThread(watcher_thread); ::CloseHandle(watcher_thread); + + // Wait for the watcher thread to start to avoid race conditions. + // One specific race condition that can happen is that we have returned + // from main and have started to tear down, the newly spawned watcher + // thread may access already-freed variables, like global shared_ptrs. + watcher_thread_params->has_initialized.WaitForNotification(); } // Monitors exit from a given thread and notifies those // ThreadIdToThreadLocals about thread termination. static DWORD WINAPI WatcherThreadFunc(LPVOID param) { - const ThreadIdAndHandle* tah = - reinterpret_cast(param); - GTEST_CHECK_(::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0); - OnThreadExit(tah->first); - ::CloseHandle(tah->second); - delete tah; + WatcherThreadParams* watcher_thread_params = + reinterpret_cast(param); + watcher_thread_params->has_initialized.Notify(); + GTEST_CHECK_(::WaitForSingleObject(watcher_thread_params->handle, + INFINITE) == WAIT_OBJECT_0); + OnThreadExit(watcher_thread_params->thread_id); + ::CloseHandle(watcher_thread_params->handle); + delete watcher_thread_params; return 0; } @@ -1033,12 +1048,12 @@ GTestLog::~GTestLog() { } } +#if GTEST_HAS_STREAM_REDIRECTION + // Disable Microsoft deprecation warnings for POSIX functions called from // this class (creat, dup, dup2, and close) GTEST_DISABLE_MSC_DEPRECATED_PUSH_() -#if GTEST_HAS_STREAM_REDIRECTION - namespace { #if defined(GTEST_OS_LINUX_ANDROID) || defined(GTEST_OS_IOS) @@ -1333,8 +1348,8 @@ bool ParseInt32(const Message& src_text, const char* str, int32_t* value) { ) { Message msg; msg << "WARNING: " << src_text - << " is expected to be a 32-bit integer, but actually" - << " has value " << str << ", which overflows.\n"; + << " is expected to be a 32-bit integer, but actually" << " has value " + << str << ", which overflows.\n"; printf("%s", msg.GetString().c_str()); fflush(stdout); return false; diff --git a/yass/third_party/googletest/googletest/src/gtest.cc b/yass/third_party/googletest/googletest/src/gtest.cc index 85d45b58e3..d64c18d7fd 100644 --- a/yass/third_party/googletest/googletest/src/gtest.cc +++ b/yass/third_party/googletest/googletest/src/gtest.cc @@ -162,6 +162,10 @@ #define GTEST_HAS_BUILTIN(x) 0 #endif // defined(__has_builtin) +#if defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS) +#define GTEST_HAS_ABSL_FLAGS +#endif + namespace testing { using internal::CountIf; @@ -375,7 +379,7 @@ GTEST_DEFINE_string_( testing::internal::StringFromGTestEnv("stream_result_to", ""), "This flag specifies the host name and the port number on which to stream " "test results. Example: \"localhost:555\". The flag is effective only on " - "Linux."); + "Linux and macOS."); GTEST_DEFINE_bool_( throw_on_failure, @@ -447,6 +451,19 @@ static bool ShouldRunTestSuite(const TestSuite* test_suite) { return test_suite->should_run(); } +namespace { + +// Returns true if test part results of type `type` should include a stack +// trace. +bool ShouldEmitStackTraceForResultType(TestPartResult::Type type) { + // Suppress emission of the stack trace for SUCCEED() since it likely never + // requires investigation, and GTEST_SKIP() since skipping is an intentional + // act by the developer rather than a failure requiring investigation. + return type != TestPartResult::kSuccess && type != TestPartResult::kSkip; +} + +} // namespace + // AssertHelper constructor. AssertHelper::AssertHelper(TestPartResult::Type type, const char* file, int line, const char* message) @@ -459,7 +476,9 @@ void AssertHelper::operator=(const Message& message) const { UnitTest::GetInstance()->AddTestPartResult( data_->type, data_->file, data_->line, AppendUserMessage(data_->message, message), - UnitTest::GetInstance()->impl()->CurrentOsStackTraceExceptTop(1) + ShouldEmitStackTraceForResultType(data_->type) + ? UnitTest::GetInstance()->impl()->CurrentOsStackTraceExceptTop(1) + : "" // Skips the stack frame for this function itself. ); // NOLINT } @@ -517,7 +536,8 @@ void InsertSyntheticTestCase(const std::string& name, CodeLocation location, if (ignored.find(name) != ignored.end()) return; const char kMissingInstantiation[] = // - " is defined via TEST_P, but never instantiated. None of the test cases " + " is defined via TEST_P, but never instantiated. None of the test " + "cases " "will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only " "ones provided expand to nothing." "\n\n" @@ -558,7 +578,7 @@ void InsertSyntheticTestCase(const std::string& name, CodeLocation location, void RegisterTypeParameterizedTestSuite(const char* test_suite_name, CodeLocation code_location) { GetUnitTestImpl()->type_parameterized_test_registry().RegisterTestSuite( - test_suite_name, code_location); + test_suite_name, std::move(code_location)); } void RegisterTypeParameterizedTestSuiteInstantiation(const char* case_name) { @@ -569,7 +589,7 @@ void RegisterTypeParameterizedTestSuiteInstantiation(const char* case_name) { void TypeParameterizedTestSuiteRegistry::RegisterTestSuite( const char* test_suite_name, CodeLocation code_location) { suites_.emplace(std::string(test_suite_name), - TypeParameterizedTestSuiteInfo(code_location)); + TypeParameterizedTestSuiteInfo(std::move(code_location))); } void TypeParameterizedTestSuiteRegistry::RegisterInstantiation( @@ -596,10 +616,12 @@ void TypeParameterizedTestSuiteRegistry::CheckForInstantiations() { "\n\n" "Ideally, TYPED_TEST_P definitions should only ever be included as " "part of binaries that intend to use them. (As opposed to, for " - "example, being placed in a library that may be linked in to get other " + "example, being placed in a library that may be linked in to get " + "other " "utilities.)" "\n\n" - "To suppress this error for this test suite, insert the following line " + "To suppress this error for this test suite, insert the following " + "line " "(in a non-header) in the namespace it is defined in:" "\n\n" "GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(" + @@ -779,7 +801,7 @@ class UnitTestFilter { // Returns true if and only if name matches at least one of the patterns in // the filter. bool MatchesName(const std::string& name) const { - return exact_match_patterns_.count(name) > 0 || + return exact_match_patterns_.find(name) != exact_match_patterns_.end() || std::any_of(glob_patterns_.begin(), glob_patterns_.end(), [&name](const std::string& pattern) { return PatternMatchesString( @@ -2318,7 +2340,7 @@ static const char* const kReservedTestCaseAttributes[] = { "type_param", "value_param", "file", "line"}; // Use a slightly different set for allowed output to ensure existing tests can -// still RecordProperty("result") or "RecordProperty(timestamp") +// still RecordProperty("result") or RecordProperty("timestamp") static const char* const kReservedOutputTestCaseAttributes[] = { "classname", "name", "status", "time", "type_param", "value_param", "file", "line", "result", "timestamp"}; @@ -2718,18 +2740,16 @@ bool Test::IsSkipped() { // Constructs a TestInfo object. It assumes ownership of the test factory // object. -TestInfo::TestInfo(const std::string& a_test_suite_name, - const std::string& a_name, const char* a_type_param, - const char* a_value_param, +TestInfo::TestInfo(std::string a_test_suite_name, std::string a_name, + const char* a_type_param, const char* a_value_param, internal::CodeLocation a_code_location, internal::TypeId fixture_class_id, internal::TestFactoryBase* factory) - : test_suite_name_(a_test_suite_name), - // begin()/end() is MSVC 17.3.3 ASAN crash workaround (GitHub issue #3997) - name_(a_name.begin(), a_name.end()), + : test_suite_name_(std::move(a_test_suite_name)), + name_(std::move(a_name)), type_param_(a_type_param ? new std::string(a_type_param) : nullptr), value_param_(a_value_param ? new std::string(a_value_param) : nullptr), - location_(a_code_location), + location_(std::move(a_code_location)), fixture_class_id_(fixture_class_id), should_run_(false), is_disabled_(false), @@ -2762,19 +2782,19 @@ namespace internal { // The newly created TestInfo instance will assume // ownership of the factory object. TestInfo* MakeAndRegisterTestInfo( - const char* test_suite_name, const char* name, const char* type_param, + std::string test_suite_name, const char* name, const char* type_param, const char* value_param, CodeLocation code_location, TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc, TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory) { TestInfo* const test_info = - new TestInfo(test_suite_name, name, type_param, value_param, - code_location, fixture_class_id, factory); + new TestInfo(std::move(test_suite_name), name, type_param, value_param, + std::move(code_location), fixture_class_id, factory); GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info); return test_info; } void ReportInvalidTestSuiteType(const char* test_suite_name, - CodeLocation code_location) { + const CodeLocation& code_location) { Message errors; errors << "Attempted redefinition of test suite " << test_suite_name << ".\n" @@ -2814,14 +2834,13 @@ void TestInfo::Run() { } // Tells UnitTest where to store test result. - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - impl->set_current_test_info(this); + UnitTest::GetInstance()->set_current_test_info(this); // Notifies the unit test event listeners that a test is about to start. repeater->OnTestStart(*this); result_.set_start_timestamp(internal::GetTimeInMillis()); internal::Timer timer; - impl->os_stack_trace_getter()->UponLeavingGTest(); + UnitTest::GetInstance()->UponLeavingGTest(); // Creates the test object. Test* const test = internal::HandleExceptionsInMethodIfSupported( @@ -2839,7 +2858,7 @@ void TestInfo::Run() { if (test != nullptr) { // Deletes the test object. - impl->os_stack_trace_getter()->UponLeavingGTest(); + UnitTest::GetInstance()->UponLeavingGTest(); internal::HandleExceptionsInMethodIfSupported( test, &Test::DeleteSelf_, "the test fixture's destructor"); } @@ -2851,15 +2870,14 @@ void TestInfo::Run() { // Tells UnitTest to stop associating assertion results to this // test. - impl->set_current_test_info(nullptr); + UnitTest::GetInstance()->set_current_test_info(nullptr); } // Skip and records a skipped test result for this object. void TestInfo::Skip() { if (!should_run_) return; - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - impl->set_current_test_info(this); + UnitTest::GetInstance()->set_current_test_info(this); TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater(); @@ -2868,12 +2886,13 @@ void TestInfo::Skip() { const TestPartResult test_part_result = TestPartResult(TestPartResult::kSkip, this->file(), this->line(), ""); - impl->GetTestPartResultReporterForCurrentThread()->ReportTestPartResult( - test_part_result); + internal::GetUnitTestImpl() + ->GetTestPartResultReporterForCurrentThread() + ->ReportTestPartResult(test_part_result); // Notifies the unit test event listener that a test has just finished. repeater->OnTestEnd(*this); - impl->set_current_test_info(nullptr); + UnitTest::GetInstance()->set_current_test_info(nullptr); } // class TestSuite @@ -2927,7 +2946,7 @@ int TestSuite::total_test_count() const { // this is not a typed or a type-parameterized test suite. // set_up_tc: pointer to the function that sets up the test suite // tear_down_tc: pointer to the function that tears down the test suite -TestSuite::TestSuite(const char* a_name, const char* a_type_param, +TestSuite::TestSuite(const std::string& a_name, const char* a_type_param, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc) : name_(a_name), @@ -2969,8 +2988,7 @@ void TestSuite::AddTestInfo(TestInfo* test_info) { void TestSuite::Run() { if (!should_run_) return; - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - impl->set_current_test_suite(this); + UnitTest::GetInstance()->set_current_test_suite(this); TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater(); @@ -3000,7 +3018,7 @@ void TestSuite::Run() { repeater->OnTestCaseStart(*this); #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - impl->os_stack_trace_getter()->UponLeavingGTest(); + UnitTest::GetInstance()->UponLeavingGTest(); internal::HandleExceptionsInMethodIfSupported( this, &TestSuite::RunSetUpTestSuite, "SetUpTestSuite()"); @@ -3025,7 +3043,7 @@ void TestSuite::Run() { } elapsed_time_ = timer.Elapsed(); - impl->os_stack_trace_getter()->UponLeavingGTest(); + UnitTest::GetInstance()->UponLeavingGTest(); internal::HandleExceptionsInMethodIfSupported( this, &TestSuite::RunTearDownTestSuite, "TearDownTestSuite()"); @@ -3036,15 +3054,14 @@ void TestSuite::Run() { repeater->OnTestCaseEnd(*this); #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - impl->set_current_test_suite(nullptr); + UnitTest::GetInstance()->set_current_test_suite(nullptr); } // Skips all tests under this TestSuite. void TestSuite::Skip() { if (!should_run_) return; - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - impl->set_current_test_suite(this); + UnitTest::GetInstance()->set_current_test_suite(this); TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater(); @@ -3066,7 +3083,7 @@ void TestSuite::Skip() { repeater->OnTestCaseEnd(*this); #endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ - impl->set_current_test_suite(nullptr); + UnitTest::GetInstance()->set_current_test_suite(nullptr); } // Clears the results of all tests in this test suite. @@ -3167,9 +3184,9 @@ static void PrintTestPartResult(const TestPartResult& test_part_result) { } // class PrettyUnitTestResultPrinter -#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MOBILE) && \ - !defined(GTEST_OS_WINDOWS_PHONE) && !defined(GTEST_OS_WINDOWS_RT) && \ - !defined(GTEST_OS_WINDOWS_MINGW) +#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MOBILE) && \ + !defined(GTEST_OS_WINDOWS_GAMES) && !defined(GTEST_OS_WINDOWS_PHONE) && \ + !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_WINDOWS_MINGW) // Returns the character attribute for the given color. static WORD GetColorAttribute(GTestColor color) { @@ -3253,6 +3270,7 @@ bool ShouldUseColor(bool stdout_is_tty) { term != nullptr && (String::CStringEquals(term, "xterm") || String::CStringEquals(term, "xterm-color") || String::CStringEquals(term, "xterm-kitty") || + String::CStringEquals(term, "alacritty") || String::CStringEquals(term, "screen") || String::CStringEquals(term, "tmux") || String::CStringEquals(term, "rxvt-unicode") || @@ -3283,11 +3301,9 @@ static void ColoredPrintf(GTestColor color, const char* fmt, ...) { va_start(args, fmt); static const bool in_color_mode = -#if GTEST_HAS_FILE_SYSTEM + // We don't condition this on GTEST_HAS_FILE_SYSTEM because we still need + // to be able to detect terminal I/O regardless. ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0); -#else - false; -#endif // GTEST_HAS_FILE_SYSTEM const bool use_color = in_color_mode && (color != GTestColor::kDefault); @@ -3297,9 +3313,9 @@ static void ColoredPrintf(GTestColor color, const char* fmt, ...) { return; } -#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MOBILE) && \ - !defined(GTEST_OS_WINDOWS_PHONE) && !defined(GTEST_OS_WINDOWS_RT) && \ - !defined(GTEST_OS_WINDOWS_MINGW) +#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MOBILE) && \ + !defined(GTEST_OS_WINDOWS_GAMES) && !defined(GTEST_OS_WINDOWS_PHONE) && \ + !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_WINDOWS_MINGW) const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE); // Gets the current text color. @@ -4422,8 +4438,8 @@ std::string XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes( Message attributes; for (int i = 0; i < result.test_property_count(); ++i) { const TestProperty& property = result.GetTestProperty(i); - attributes << " " << property.key() << "=" - << "\"" << EscapeXmlAttribute(property.value()) << "\""; + attributes << " " << property.key() << "=" << "\"" + << EscapeXmlAttribute(property.value()) << "\""; } return attributes.GetString(); } @@ -4727,28 +4743,53 @@ void JsonUnitTestResultPrinter::OutputJsonTestResult(::std::ostream* stream, const TestResult& result) { const std::string kIndent = Indent(10); - int failures = 0; - for (int i = 0; i < result.total_part_count(); ++i) { - const TestPartResult& part = result.GetTestPartResult(i); - if (part.failed()) { - *stream << ",\n"; - if (++failures == 1) { - *stream << kIndent << "\"" - << "failures" - << "\": [\n"; + { + int failures = 0; + for (int i = 0; i < result.total_part_count(); ++i) { + const TestPartResult& part = result.GetTestPartResult(i); + if (part.failed()) { + *stream << ",\n"; + if (++failures == 1) { + *stream << kIndent << "\"" << "failures" << "\": [\n"; + } + const std::string location = + internal::FormatCompilerIndependentFileLocation(part.file_name(), + part.line_number()); + const std::string message = + EscapeJson(location + "\n" + part.message()); + *stream << kIndent << " {\n" + << kIndent << " \"failure\": \"" << message << "\",\n" + << kIndent << " \"type\": \"\"\n" + << kIndent << " }"; } - const std::string location = - internal::FormatCompilerIndependentFileLocation(part.file_name(), - part.line_number()); - const std::string message = EscapeJson(location + "\n" + part.message()); - *stream << kIndent << " {\n" - << kIndent << " \"failure\": \"" << message << "\",\n" - << kIndent << " \"type\": \"\"\n" - << kIndent << " }"; } + + if (failures > 0) *stream << "\n" << kIndent << "]"; + } + + { + int skipped = 0; + for (int i = 0; i < result.total_part_count(); ++i) { + const TestPartResult& part = result.GetTestPartResult(i); + if (part.skipped()) { + *stream << ",\n"; + if (++skipped == 1) { + *stream << kIndent << "\"" << "skipped" << "\": [\n"; + } + const std::string location = + internal::FormatCompilerIndependentFileLocation(part.file_name(), + part.line_number()); + const std::string message = + EscapeJson(location + "\n" + part.message()); + *stream << kIndent << " {\n" + << kIndent << " \"message\": \"" << message << "\"\n" + << kIndent << " }"; + } + } + + if (skipped > 0) *stream << "\n" << kIndent << "]"; } - if (failures > 0) *stream << "\n" << kIndent << "]"; *stream << "\n" << Indent(8) << "}"; } @@ -4885,8 +4926,8 @@ std::string JsonUnitTestResultPrinter::TestPropertiesAsJson( for (int i = 0; i < result.test_property_count(); ++i) { const TestProperty& property = result.GetTestProperty(i); attributes << ",\n" - << indent << "\"" << property.key() << "\": " - << "\"" << EscapeJson(property.value()) << "\""; + << indent << "\"" << property.key() << "\": " << "\"" + << EscapeJson(property.value()) << "\""; } return attributes.GetString(); } @@ -5284,6 +5325,22 @@ TestSuite* UnitTest::GetMutableTestSuite(int i) { return impl()->GetMutableSuiteCase(i); } +void UnitTest::UponLeavingGTest() { + impl()->os_stack_trace_getter()->UponLeavingGTest(); +} + +// Sets the TestSuite object for the test that's currently running. +void UnitTest::set_current_test_suite(TestSuite* a_current_test_suite) { + internal::MutexLock lock(&mutex_); + impl_->set_current_test_suite(a_current_test_suite); +} + +// Sets the TestInfo object for the test that's currently running. +void UnitTest::set_current_test_info(TestInfo* a_current_test_info) { + internal::MutexLock lock(&mutex_); + impl_->set_current_test_info(a_current_test_info); +} + // Returns the list of event listeners that can be used to track events // inside Google Test. TestEventListeners& UnitTest::listeners() { return *impl()->listeners(); } @@ -5443,7 +5500,7 @@ int UnitTest::Run() { // about crashes - they are expected. if (impl()->catch_exceptions() || in_death_test_child_process) { #if !defined(GTEST_OS_WINDOWS_MOBILE) && !defined(GTEST_OS_WINDOWS_PHONE) && \ - !defined(GTEST_OS_WINDOWS_RT) + !defined(GTEST_OS_WINDOWS_RT) && !defined(GTEST_OS_WINDOWS_GAMES) // SetErrorMode doesn't exist on CE. SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); @@ -5713,29 +5770,6 @@ void UnitTestImpl::PostFlagParsingInit() { } } -// A predicate that checks the name of a TestSuite against a known -// value. -// -// This is used for implementation of the UnitTest class only. We put -// it in the anonymous namespace to prevent polluting the outer -// namespace. -// -// TestSuiteNameIs is copyable. -class TestSuiteNameIs { - public: - // Constructor. - explicit TestSuiteNameIs(const std::string& name) : name_(name) {} - - // Returns true if and only if the name of test_suite matches name_. - bool operator()(const TestSuite* test_suite) const { - return test_suite != nullptr && - strcmp(test_suite->name(), name_.c_str()) == 0; - } - - private: - std::string name_; -}; - // Finds and returns a TestSuite with the given name. If one doesn't // exist, creates one and returns it. It's the CALLER'S // RESPONSIBILITY to ensure that this function is only called WHEN THE @@ -5749,19 +5783,27 @@ class TestSuiteNameIs { // set_up_tc: pointer to the function that sets up the test suite // tear_down_tc: pointer to the function that tears down the test suite TestSuite* UnitTestImpl::GetTestSuite( - const char* test_suite_name, const char* type_param, + const std::string& test_suite_name, const char* type_param, internal::SetUpTestSuiteFunc set_up_tc, internal::TearDownTestSuiteFunc tear_down_tc) { - // Can we find a TestSuite with the given name? - const auto test_suite = - std::find_if(test_suites_.rbegin(), test_suites_.rend(), - TestSuiteNameIs(test_suite_name)); + // During initialization, all TestInfos for a given suite are added in + // sequence. To optimize this case, see if the most recently added suite is + // the one being requested now. + if (!test_suites_.empty() && + (*test_suites_.rbegin())->name_ == test_suite_name) { + return *test_suites_.rbegin(); + } - if (test_suite != test_suites_.rend()) return *test_suite; + // Fall back to searching the collection. + auto item_it = test_suites_by_name_.find(test_suite_name); + if (item_it != test_suites_by_name_.end()) { + return item_it->second; + } - // No. Let's create one. + // Not found. Create a new instance. auto* const new_test_suite = new TestSuite(test_suite_name, type_param, set_up_tc, tear_down_tc); + test_suites_by_name_.emplace(test_suite_name, new_test_suite); const UnitTestFilter death_test_suite_filter(kDeathTestSuiteFilter); // Is this a death test suite? @@ -5974,6 +6016,12 @@ bool UnitTestImpl::RunAllTests() { } repeater->OnTestProgramEnd(*parent_); + // Destroy environments in normal code, not in static teardown. + bool delete_environment_on_teardown = true; + if (delete_environment_on_teardown) { + ForEach(environments_, internal::Delete); + environments_.clear(); + } if (!gtest_is_initialized_before_run_all_tests) { ColoredPrintf( @@ -6107,12 +6155,11 @@ int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) { int num_runnable_tests = 0; int num_selected_tests = 0; for (auto* test_suite : test_suites_) { - const std::string& test_suite_name = test_suite->name(); + const std::string& test_suite_name = test_suite->name_; test_suite->set_should_run(false); - for (size_t j = 0; j < test_suite->test_info_list().size(); j++) { - TestInfo* const test_info = test_suite->test_info_list()[j]; - const std::string test_name(test_info->name()); + for (TestInfo* test_info : test_suite->test_info_list()) { + const std::string& test_name = test_info->name_; // A test is disabled if test suite name or test name matches // kDisableTestFilter. const bool is_disabled = @@ -6203,8 +6250,8 @@ void UnitTestImpl::ListTestsMatchingFilter() { #if GTEST_HAS_FILE_SYSTEM const std::string& output_format = UnitTestOptions::GetOutputFormat(); if (output_format == "xml" || output_format == "json") { - FILE* fileout = OpenFileForWriting( - UnitTestOptions::GetAbsolutePathToOutputFile().c_str()); + FILE* fileout = + OpenFileForWriting(UnitTestOptions::GetAbsolutePathToOutputFile()); std::stringstream stream; if (output_format == "xml") { XmlUnitTestResultPrinter( @@ -6685,7 +6732,7 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) { // remain in place. Unrecognized flags are not reported and do not cause the // program to exit. void ParseGoogleTestFlagsOnly(int* argc, char** argv) { -#ifdef GTEST_HAS_ABSL +#ifdef GTEST_HAS_ABSL_FLAGS if (*argc <= 0) return; std::vector positional_args; @@ -6771,11 +6818,13 @@ void InitGoogleTestImpl(int* argc, CharType** argv) { #ifdef GTEST_HAS_ABSL absl::InitializeSymbolizer(g_argvs[0].c_str()); +#ifdef GTEST_HAS_ABSL_FLAGS // When using the Abseil Flags library, set the program usage message to the // help message, but remove the color-encoding from the message first. absl::SetProgramUsageMessage(absl::StrReplaceAll( kColorEncodedHelpMessage, {{"@D", ""}, {"@R", ""}, {"@G", ""}, {"@Y", ""}, {"@@", "@"}})); +#endif // GTEST_HAS_ABSL_FLAGS #endif // GTEST_HAS_ABSL ParseGoogleTestFlagsOnly(argc, argv); diff --git a/yass/third_party/googletest/googletest/test/googletest-color-test.py b/yass/third_party/googletest/googletest/test/googletest-color-test.py index 8926a48155..8968cf1f68 100755 --- a/yass/third_party/googletest/googletest/test/googletest-color-test.py +++ b/yass/third_party/googletest/googletest/test/googletest-color-test.py @@ -80,6 +80,7 @@ class GTestColorTest(gtest_test_utils.TestCase): self.assertTrue(UsesColor('xterm', None, None)) self.assertTrue(UsesColor('xterm-color', None, None)) self.assertTrue(UsesColor('xterm-kitty', None, None)) + self.assertTrue(UsesColor('alacritty', None, None)) self.assertTrue(UsesColor('xterm-256color', None, None)) def testFlagOnly(self): diff --git a/yass/third_party/googletest/googletest/test/googletest-death-test-test.cc b/yass/third_party/googletest/googletest/test/googletest-death-test-test.cc index 4cc81b723e..75742c938c 100644 --- a/yass/third_party/googletest/googletest/test/googletest-death-test-test.cc +++ b/yass/third_party/googletest/googletest/test/googletest-death-test-test.cc @@ -30,6 +30,8 @@ // // Tests for death tests. +#include + #include "gtest/gtest-death-test.h" #include "gtest/gtest.h" #include "gtest/internal/gtest-filepath.h" @@ -111,15 +113,15 @@ void DieWithMessage(const ::std::string& message) { fprintf(stderr, "%s", message.c_str()); fflush(stderr); // Make sure the text is printed before the process exits. - // We call _exit() instead of exit(), as the former is a direct + // We call _Exit() instead of exit(), as the former is a direct // system call and thus safer in the presence of threads. exit() // will invoke user-defined exit-hooks, which may do dangerous // things that conflict with death tests. // - // Some compilers can recognize that _exit() never returns and issue the + // Some compilers can recognize that _Exit() never returns and issue the // 'unreachable code' warning for code following this function, unless // fooled by a fake condition. - if (AlwaysTrue()) _exit(1); + if (AlwaysTrue()) _Exit(1); } void DieInside(const ::std::string& function) { @@ -238,13 +240,13 @@ TEST(ExitStatusPredicateTest, ExitedWithCode) { #else -// Returns the exit status of a process that calls _exit(2) with a +// Returns the exit status of a process that calls _Exit(2) with a // given exit code. This is a helper function for the // ExitStatusPredicateTest test suite. static int NormalExitStatus(int exit_code) { pid_t child_pid = fork(); if (child_pid == 0) { - _exit(exit_code); + _Exit(exit_code); } int status; waitpid(child_pid, &status, 0); @@ -260,7 +262,7 @@ static int KilledExitStatus(int signum) { pid_t child_pid = fork(); if (child_pid == 0) { raise(signum); - _exit(1); + _Exit(1); } int status; waitpid(child_pid, &status, 0); @@ -313,7 +315,7 @@ TEST_F(TestForDeathTest, SingleStatement) { ASSERT_DEATH(return, ""); if (AlwaysTrue()) - EXPECT_DEATH(_exit(1), ""); + EXPECT_DEATH(_Exit(1), ""); else // This empty "else" branch is meant to ensure that EXPECT_DEATH // doesn't expand into an "if" statement without an "else" @@ -324,7 +326,7 @@ TEST_F(TestForDeathTest, SingleStatement) { if (AlwaysFalse()) ; else - EXPECT_DEATH(_exit(1), "") << 1 << 2 << 3; + EXPECT_DEATH(_Exit(1), "") << 1 << 2 << 3; } #ifdef __GNUC__ #pragma GCC diagnostic pop @@ -339,11 +341,11 @@ TEST_F(TestForDeathTest, SwitchStatement) { switch (0) default: - ASSERT_DEATH(_exit(1), "") << "exit in default switch handler"; + ASSERT_DEATH(_Exit(1), "") << "exit in default switch handler"; switch (0) case 0: - EXPECT_DEATH(_exit(1), "") << "exit in switch case"; + EXPECT_DEATH(_Exit(1), "") << "exit in switch case"; GTEST_DISABLE_MSC_WARNINGS_POP_() } @@ -371,10 +373,10 @@ TEST_F(TestForDeathTest, FastDeathTestInChangedDir) { GTEST_FLAG_SET(death_test_style, "fast"); ChangeToRootDir(); - EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), ""); + EXPECT_EXIT(_Exit(1), testing::ExitedWithCode(1), ""); ChangeToRootDir(); - ASSERT_DEATH(_exit(1), ""); + ASSERT_DEATH(_Exit(1), ""); } #ifdef GTEST_OS_LINUX @@ -416,7 +418,7 @@ void DisableSigprofActionAndTimer(struct sigaction* old_signal_action) { TEST_F(TestForDeathTest, FastSigprofActionSet) { GTEST_FLAG_SET(death_test_style, "fast"); SetSigprofActionAndTimer(); - EXPECT_DEATH(_exit(1), ""); + EXPECT_DEATH(_Exit(1), ""); struct sigaction old_signal_action; DisableSigprofActionAndTimer(&old_signal_action); EXPECT_TRUE(old_signal_action.sa_sigaction == SigprofAction); @@ -425,7 +427,7 @@ TEST_F(TestForDeathTest, FastSigprofActionSet) { TEST_F(TestForDeathTest, ThreadSafeSigprofActionSet) { GTEST_FLAG_SET(death_test_style, "threadsafe"); SetSigprofActionAndTimer(); - EXPECT_DEATH(_exit(1), ""); + EXPECT_DEATH(_Exit(1), ""); struct sigaction old_signal_action; DisableSigprofActionAndTimer(&old_signal_action); EXPECT_TRUE(old_signal_action.sa_sigaction == SigprofAction); @@ -449,24 +451,24 @@ TEST_F(TestForDeathTest, ThreadsafeDeathTestInLoop) { GTEST_FLAG_SET(death_test_style, "threadsafe"); for (int i = 0; i < 3; ++i) - EXPECT_EXIT(_exit(i), testing::ExitedWithCode(i), "") << ": i = " << i; + EXPECT_EXIT(_Exit(i), testing::ExitedWithCode(i), "") << ": i = " << i; } TEST_F(TestForDeathTest, ThreadsafeDeathTestInChangedDir) { GTEST_FLAG_SET(death_test_style, "threadsafe"); ChangeToRootDir(); - EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), ""); + EXPECT_EXIT(_Exit(1), testing::ExitedWithCode(1), ""); ChangeToRootDir(); - ASSERT_DEATH(_exit(1), ""); + ASSERT_DEATH(_Exit(1), ""); } TEST_F(TestForDeathTest, MixedStyles) { GTEST_FLAG_SET(death_test_style, "threadsafe"); - EXPECT_DEATH(_exit(1), ""); + EXPECT_DEATH(_Exit(1), ""); GTEST_FLAG_SET(death_test_style, "fast"); - EXPECT_DEATH(_exit(1), ""); + EXPECT_DEATH(_Exit(1), ""); } #if GTEST_HAS_CLONE && GTEST_HAS_PTHREAD @@ -480,7 +482,7 @@ TEST_F(TestForDeathTest, DoesNotExecuteAtforkHooks) { GTEST_FLAG_SET(death_test_style, "threadsafe"); pthread_flag = false; ASSERT_EQ(0, pthread_atfork(&SetPthreadFlag, nullptr, nullptr)); - ASSERT_DEATH(_exit(1), ""); + ASSERT_DEATH(_Exit(1), ""); ASSERT_FALSE(pthread_flag); } } @@ -805,8 +807,8 @@ TEST_F(TestForDeathTest, AssertDebugDeathAborts10) { // Tests the *_EXIT family of macros, using a variety of predicates. static void TestExitMacros() { - EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), ""); - ASSERT_EXIT(_exit(42), testing::ExitedWithCode(42), ""); + EXPECT_EXIT(_Exit(1), testing::ExitedWithCode(1), ""); + ASSERT_EXIT(_Exit(42), testing::ExitedWithCode(42), ""); #ifdef GTEST_OS_WINDOWS @@ -823,7 +825,7 @@ static void TestExitMacros() { EXPECT_FATAL_FAILURE( { // NOLINT - ASSERT_EXIT(_exit(0), testing::KilledBySignal(SIGSEGV), "") + ASSERT_EXIT(_Exit(0), testing::KilledBySignal(SIGSEGV), "") << "This failure is expected, too."; }, "This failure is expected, too."); @@ -849,7 +851,7 @@ TEST_F(TestForDeathTest, InvalidStyle) { GTEST_FLAG_SET(death_test_style, "rococo"); EXPECT_NONFATAL_FAILURE( { // NOLINT - EXPECT_DEATH(_exit(0), "") << "This failure is expected."; + EXPECT_DEATH(_Exit(0), "") << "This failure is expected."; }, "This failure is expected."); } @@ -1140,7 +1142,7 @@ TEST_F(MacroLogicDeathTest, ChildDoesNotDie) { // This time there are two calls to Abort: one since the test didn't // die, and another from the ReturnSentinel when it's destroyed. The // sentinel normally isn't destroyed if a test doesn't die, since - // _exit(2) is called in that case by ForkingDeathTest, but not by + // _Exit(2) is called in that case by ForkingDeathTest, but not by // our MockDeathTest. ASSERT_EQ(2U, factory_->AbortCalls()); EXPECT_EQ(DeathTest::TEST_DID_NOT_DIE, factory_->AbortArgument(0)); @@ -1152,21 +1154,21 @@ TEST_F(MacroLogicDeathTest, ChildDoesNotDie) { // Tests that a successful death test does not register a successful // test part. TEST(SuccessRegistrationDeathTest, NoSuccessPart) { - EXPECT_DEATH(_exit(1), ""); + EXPECT_DEATH(_Exit(1), ""); EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count()); } TEST(StreamingAssertionsDeathTest, DeathTest) { - EXPECT_DEATH(_exit(1), "") << "unexpected failure"; - ASSERT_DEATH(_exit(1), "") << "unexpected failure"; + EXPECT_DEATH(_Exit(1), "") << "unexpected failure"; + ASSERT_DEATH(_Exit(1), "") << "unexpected failure"; EXPECT_NONFATAL_FAILURE( { // NOLINT - EXPECT_DEATH(_exit(0), "") << "expected failure"; + EXPECT_DEATH(_Exit(0), "") << "expected failure"; }, "expected failure"); EXPECT_FATAL_FAILURE( { // NOLINT - ASSERT_DEATH(_exit(0), "") << "expected failure"; + ASSERT_DEATH(_Exit(0), "") << "expected failure"; }, "expected failure"); } @@ -1330,7 +1332,7 @@ TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInFastStyle) { { fprintf(stderr, InDeathTestChild() ? "Inside" : "Outside"); fflush(stderr); - _exit(1); + _Exit(1); }, "Inside"); } @@ -1342,7 +1344,7 @@ TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInThreadSafeStyle) { { fprintf(stderr, InDeathTestChild() ? "Inside" : "Outside"); fflush(stderr); - _exit(1); + _Exit(1); }, "Inside"); } @@ -1350,7 +1352,7 @@ TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInThreadSafeStyle) { void DieWithMessage(const char* message) { fputs(message, stderr); fflush(stderr); // Make sure the text is printed before the process exits. - _exit(1); + _Exit(1); } TEST(MatcherDeathTest, DoesNotBreakBareRegexMatching) { @@ -1466,7 +1468,7 @@ TEST(ConditionalDeathMacrosSyntaxDeathTest, SingleStatement) { ASSERT_DEATH_IF_SUPPORTED(return, ""); if (AlwaysTrue()) - EXPECT_DEATH_IF_SUPPORTED(_exit(1), ""); + EXPECT_DEATH_IF_SUPPORTED(_Exit(1), ""); else // This empty "else" branch is meant to ensure that EXPECT_DEATH // doesn't expand into an "if" statement without an "else" @@ -1477,7 +1479,7 @@ TEST(ConditionalDeathMacrosSyntaxDeathTest, SingleStatement) { if (AlwaysFalse()) ; // NOLINT else - EXPECT_DEATH_IF_SUPPORTED(_exit(1), "") << 1 << 2 << 3; + EXPECT_DEATH_IF_SUPPORTED(_Exit(1), "") << 1 << 2 << 3; } #ifdef __GNUC__ #pragma GCC diagnostic pop @@ -1492,11 +1494,11 @@ TEST(ConditionalDeathMacrosSyntaxDeathTest, SwitchStatement) { switch (0) default: - ASSERT_DEATH_IF_SUPPORTED(_exit(1), "") << "exit in default switch handler"; + ASSERT_DEATH_IF_SUPPORTED(_Exit(1), "") << "exit in default switch handler"; switch (0) case 0: - EXPECT_DEATH_IF_SUPPORTED(_exit(1), "") << "exit in switch case"; + EXPECT_DEATH_IF_SUPPORTED(_Exit(1), "") << "exit in switch case"; GTEST_DISABLE_MSC_WARNINGS_POP_() } diff --git a/yass/third_party/googletest/googletest/test/googletest-json-output-unittest.py b/yass/third_party/googletest/googletest/test/googletest-json-output-unittest.py index cb97694520..d3338e3d2f 100644 --- a/yass/third_party/googletest/googletest/test/googletest-json-output-unittest.py +++ b/yass/third_party/googletest/googletest/test/googletest-json-output-unittest.py @@ -150,6 +150,9 @@ EXPECTED_NON_EMPTY = { 'time': '*', 'timestamp': '*', 'classname': 'SkippedTest', + 'skipped': [ + {'message': 'gtest_xml_output_unittest_.cc:*\n\n'} + ], }, { 'name': 'SkippedWithMessage', @@ -160,6 +163,12 @@ EXPECTED_NON_EMPTY = { 'time': '*', 'timestamp': '*', 'classname': 'SkippedTest', + 'skipped': [{ + 'message': ( + 'gtest_xml_output_unittest_.cc:*\n' + 'It is good practice to tell why you skip a test.\n' + ) + }], }, { 'name': 'SkippedAfterFailure', @@ -179,6 +188,12 @@ EXPECTED_NON_EMPTY = { ), 'type': '', }], + 'skipped': [{ + 'message': ( + 'gtest_xml_output_unittest_.cc:*\n' + 'It is good practice to tell why you skip a test.\n' + ) + }], }, ], }, diff --git a/yass/third_party/googletest/googletest/test/googletest-options-test.cc b/yass/third_party/googletest/googletest/test/googletest-options-test.cc index b712c06fa3..91d06a5097 100644 --- a/yass/third_party/googletest/googletest/test/googletest-options-test.cc +++ b/yass/third_party/googletest/googletest/test/googletest-options-test.cc @@ -115,11 +115,14 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) { strcasecmp("gtest_dll_test", exe_str.c_str()) == 0; #elif defined(GTEST_OS_FUCHSIA) const bool success = exe_str == "app"; +#elif defined(__EMSCRIPTEN__) + const bool success = exe_str == "patched_googletest-options-test.js"; #else const bool success = exe_str == "googletest-options-test" || exe_str == "gtest_all_test" || exe_str == "lt-gtest_all_test" || exe_str == "gtest_dll_test"; -#endif // GTEST_OS_WINDOWS +#endif // platform ifdefs + if (!success) FAIL() << "GetCurrentExecutableName() returns " << exe_str; } diff --git a/yass/third_party/googletest/googletest/test/googletest-output-test-golden-lin.txt b/yass/third_party/googletest/googletest/test/googletest-output-test-golden-lin.txt index 6ddf822ffb..533eb8c6e0 100644 --- a/yass/third_party/googletest/googletest/test/googletest-output-test-golden-lin.txt +++ b/yass/third_party/googletest/googletest/test/googletest-output-test-golden-lin.txt @@ -696,7 +696,6 @@ Expected: 1 fatal failure Actual: googletest-output-test_.cc:#: Success: Succeeded -Stack trace: (omitted) Stack trace: (omitted) @@ -733,7 +732,6 @@ Expected: 1 non-fatal failure Actual: googletest-output-test_.cc:#: Success: Succeeded -Stack trace: (omitted) Stack trace: (omitted) @@ -770,7 +768,6 @@ Expected: 1 fatal failure Actual: googletest-output-test_.cc:#: Success: Succeeded -Stack trace: (omitted) Stack trace: (omitted) @@ -807,7 +804,6 @@ Expected: 1 non-fatal failure Actual: googletest-output-test_.cc:#: Success: Succeeded -Stack trace: (omitted) Stack trace: (omitted) @@ -970,7 +966,6 @@ googletest-output-test_.cc:#: Skipped [----------] 1 test from TestSuiteThatSkipsInSetUp googletest-output-test_.cc:#: Skipped Skip entire test suite -Stack trace: (omitted) [ RUN ] TestSuiteThatSkipsInSetUp.ShouldNotRun googletest-output-test_.cc:#: Skipped diff --git a/yass/third_party/googletest/googletest/test/gtest_environment_test.cc b/yass/third_party/googletest/googletest/test/gtest_environment_test.cc index 122eaf3ca8..03657c7d89 100644 --- a/yass/third_party/googletest/googletest/test/gtest_environment_test.cc +++ b/yass/third_party/googletest/googletest/test/gtest_environment_test.cc @@ -40,16 +40,21 @@ namespace { enum FailureType { NO_FAILURE, NON_FATAL_FAILURE, FATAL_FAILURE }; +// Was SetUp run? +bool set_up_was_run; +// Was TearDown run? +bool tear_down_was_run; +// Was the TEST run? +bool test_was_run; + // For testing using global test environments. class MyEnvironment : public testing::Environment { public: - MyEnvironment() { Reset(); } - // Depending on the value of failure_in_set_up_, SetUp() will // generate a non-fatal failure, generate a fatal failure, or // succeed. void SetUp() override { - set_up_was_run_ = true; + set_up_was_run = true; switch (failure_in_set_up_) { case NON_FATAL_FAILURE: @@ -65,36 +70,18 @@ class MyEnvironment : public testing::Environment { // Generates a non-fatal failure. void TearDown() override { - tear_down_was_run_ = true; + tear_down_was_run = true; ADD_FAILURE() << "Expected non-fatal failure in global tear-down."; } - // Resets the state of the environment s.t. it can be reused. - void Reset() { - failure_in_set_up_ = NO_FAILURE; - set_up_was_run_ = false; - tear_down_was_run_ = false; - } - // We call this function to set the type of failure SetUp() should // generate. void set_failure_in_set_up(FailureType type) { failure_in_set_up_ = type; } - // Was SetUp() run? - bool set_up_was_run() const { return set_up_was_run_; } - - // Was TearDown() run? - bool tear_down_was_run() const { return tear_down_was_run_; } - private: FailureType failure_in_set_up_; - bool set_up_was_run_; - bool tear_down_was_run_; }; -// Was the TEST run? -bool test_was_run; - // The sole purpose of this TEST is to enable us to check whether it // was run. TEST(FooTest, Bar) { test_was_run = true; } @@ -112,67 +99,88 @@ void Check(bool condition, const char* msg) { // The 'failure' parameter specifies the type of failure that should // be generated by the global set-up. int RunAllTests(MyEnvironment* env, FailureType failure) { - env->Reset(); - env->set_failure_in_set_up(failure); + set_up_was_run = false; + tear_down_was_run = false; test_was_run = false; + env->set_failure_in_set_up(failure); testing::internal::GetUnitTestImpl()->ClearAdHocTestResult(); return RUN_ALL_TESTS(); } +// Registers a global test environment, and verifies that the +// registration function returns its argument. +MyEnvironment* RegisterTestEnv() { + MyEnvironment* const env = new MyEnvironment; + Check(testing::AddGlobalTestEnvironment(env) == env, + "AddGlobalTestEnvironment() should return its argument."); + return env; +} + +// Verifies that RUN_ALL_TESTS() runs the tests when the global +// set-up is successful. +void TestGlobalSetUp() { + MyEnvironment* const env = RegisterTestEnv(); + Check(RunAllTests(env, NO_FAILURE) != 0, + "RUN_ALL_TESTS() should return non-zero, as the global tear-down " + "should generate a failure."); + Check(test_was_run, + "The tests should run, as the global set-up should generate no " + "failure"); + Check(tear_down_was_run, + "The global tear-down should run, as the global set-up was run."); +} + +// Verifies that RUN_ALL_TESTS() runs the tests when the global +// set-up generates no fatal failure. +void TestTestsRun() { + MyEnvironment* const env = RegisterTestEnv(); + Check(RunAllTests(env, NON_FATAL_FAILURE) != 0, + "RUN_ALL_TESTS() should return non-zero, as both the global set-up " + "and the global tear-down should generate a non-fatal failure."); + Check(test_was_run, + "The tests should run, as the global set-up should generate no " + "fatal failure."); + Check(tear_down_was_run, + "The global tear-down should run, as the global set-up was run."); +} + +// Verifies that RUN_ALL_TESTS() runs no test when the global set-up +// generates a fatal failure. +void TestNoTestsRunSetUpFailure() { + MyEnvironment* const env = RegisterTestEnv(); + Check(RunAllTests(env, FATAL_FAILURE) != 0, + "RUN_ALL_TESTS() should return non-zero, as the global set-up " + "should generate a fatal failure."); + Check(!test_was_run, + "The tests should not run, as the global set-up should generate " + "a fatal failure."); + Check(tear_down_was_run, + "The global tear-down should run, as the global set-up was run."); +} + +// Verifies that RUN_ALL_TESTS() doesn't do global set-up or +// tear-down when there is no test to run. +void TestNoTestsSkipsSetUp() { + MyEnvironment* const env = RegisterTestEnv(); + GTEST_FLAG_SET(filter, "-*"); + Check(RunAllTests(env, NO_FAILURE) == 0, + "RUN_ALL_TESTS() should return zero, as there is no test to run."); + Check(!set_up_was_run, + "The global set-up should not run, as there is no test to run."); + Check(!tear_down_was_run, + "The global tear-down should not run, " + "as the global set-up was not run."); +} + } // namespace int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); - // Registers a global test environment, and verifies that the - // registration function returns its argument. - MyEnvironment* const env = new MyEnvironment; - Check(testing::AddGlobalTestEnvironment(env) == env, - "AddGlobalTestEnvironment() should return its argument."); - - // Verifies that RUN_ALL_TESTS() runs the tests when the global - // set-up is successful. - Check(RunAllTests(env, NO_FAILURE) != 0, - "RUN_ALL_TESTS() should return non-zero, as the global tear-down " - "should generate a failure."); - Check(test_was_run, - "The tests should run, as the global set-up should generate no " - "failure"); - Check(env->tear_down_was_run(), - "The global tear-down should run, as the global set-up was run."); - - // Verifies that RUN_ALL_TESTS() runs the tests when the global - // set-up generates no fatal failure. - Check(RunAllTests(env, NON_FATAL_FAILURE) != 0, - "RUN_ALL_TESTS() should return non-zero, as both the global set-up " - "and the global tear-down should generate a non-fatal failure."); - Check(test_was_run, - "The tests should run, as the global set-up should generate no " - "fatal failure."); - Check(env->tear_down_was_run(), - "The global tear-down should run, as the global set-up was run."); - - // Verifies that RUN_ALL_TESTS() runs no test when the global set-up - // generates a fatal failure. - Check(RunAllTests(env, FATAL_FAILURE) != 0, - "RUN_ALL_TESTS() should return non-zero, as the global set-up " - "should generate a fatal failure."); - Check(!test_was_run, - "The tests should not run, as the global set-up should generate " - "a fatal failure."); - Check(env->tear_down_was_run(), - "The global tear-down should run, as the global set-up was run."); - - // Verifies that RUN_ALL_TESTS() doesn't do global set-up or - // tear-down when there is no test to run. - GTEST_FLAG_SET(filter, "-*"); - Check(RunAllTests(env, NO_FAILURE) == 0, - "RUN_ALL_TESTS() should return zero, as there is no test to run."); - Check(!env->set_up_was_run(), - "The global set-up should not run, as there is no test to run."); - Check(!env->tear_down_was_run(), - "The global tear-down should not run, " - "as the global set-up was not run."); + TestGlobalSetUp(); + TestTestsRun(); + TestNoTestsRunSetUpFailure(); + TestNoTestsSkipsSetUp(); printf("PASS\n"); return 0; diff --git a/yass/third_party/googletest/googletest/test/gtest_json_test_utils.py b/yass/third_party/googletest/googletest/test/gtest_json_test_utils.py index 86a5925b07..694a7a60db 100644 --- a/yass/third_party/googletest/googletest/test/gtest_json_test_utils.py +++ b/yass/third_party/googletest/googletest/test/gtest_json_test_utils.py @@ -51,6 +51,9 @@ def normalize(obj): elif key == 'failure': value = re.sub(r'^.*[/\\](.*:)\d+\n', '\\1*\n', value) return re.sub(r'Stack trace:\n(.|\n)*', 'Stack trace:\n*', value) + elif key == 'message': + value = re.sub(r'^.*[/\\](.*:)\d+\n', '\\1*\n', value) + return re.sub(r'Stack trace:\n(.|\n)*', 'Stack trace:\n*', value) elif key == 'file': return re.sub(r'^.*[/\\](.*)', '\\1', value) else: diff --git a/yass/third_party/googletest/googletest/test/gtest_repeat_test.cc b/yass/third_party/googletest/googletest/test/gtest_repeat_test.cc index f67b7886e1..55103d0e77 100644 --- a/yass/third_party/googletest/googletest/test/gtest_repeat_test.cc +++ b/yass/third_party/googletest/googletest/test/gtest_repeat_test.cc @@ -61,7 +61,6 @@ int g_environment_tear_down_count = 0; class MyEnvironment : public testing::Environment { public: - MyEnvironment() = default; void SetUp() override { g_environment_set_up_count++; } void TearDown() override { g_environment_tear_down_count++; } }; @@ -117,6 +116,7 @@ void ResetCounts() { g_should_pass_count = 0; g_death_test_count = 0; g_param_test_count = 0; + testing::AddGlobalTestEnvironment(new MyEnvironment); } // Checks that the count for each test is expected. @@ -197,8 +197,6 @@ void TestRepeatWithFilterForFailedTests(int repeat) { int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); - testing::AddGlobalTestEnvironment(new MyEnvironment); - TestRepeatUnspecified(); TestRepeat(0); TestRepeat(1); diff --git a/yass/third_party/googletest/googletest/test/gtest_unittest.cc b/yass/third_party/googletest/googletest/test/gtest_unittest.cc index 67d776ed86..edbe2ea26c 100644 --- a/yass/third_party/googletest/googletest/test/gtest_unittest.cc +++ b/yass/third_party/googletest/googletest/test/gtest_unittest.cc @@ -422,11 +422,14 @@ TEST(FormatTimeInMillisAsSecondsTest, FormatsNegativeNumber) { EXPECT_EQ("-1234567.89", FormatTimeInMillisAsSeconds(-1234567890)); } +// TODO: b/287046337 - In emscripten, local time zone modification is not +// supported. +#if !defined(__EMSCRIPTEN__) // Tests FormatEpochTimeInMillisAsIso8601(). The correctness of conversion // for particular dates below was verified in Python using // datetime.datetime.fromutctimestamp(/1000). -// FormatEpochTimeInMillisAsIso8601 depends on the current timezone, so we +// FormatEpochTimeInMillisAsIso8601 depends on the local timezone, so we // have to set up a particular timezone to obtain predictable results. class FormatEpochTimeInMillisAsIso8601Test : public Test { public: @@ -445,9 +448,8 @@ class FormatEpochTimeInMillisAsIso8601Test : public Test { } GTEST_DISABLE_MSC_DEPRECATED_POP_() - // Set up the time zone for FormatEpochTimeInMillisAsIso8601 to use. We - // cannot use the local time zone because the function's output depends - // on the time zone. + // Set the local time zone for FormatEpochTimeInMillisAsIso8601 to be + // a fixed time zone for reproducibility purposes. SetTimeZone("UTC+00"); } @@ -514,6 +516,8 @@ TEST_F(FormatEpochTimeInMillisAsIso8601Test, PrintsEpochStart) { EXPECT_EQ("1970-01-01T00:00:00.000", FormatEpochTimeInMillisAsIso8601(0)); } +#endif // __EMSCRIPTEN__ + #ifdef __BORLANDC__ // Silences warnings: "Condition is always true", "Unreachable code" #pragma option push -w-ccc -w-rch @@ -4168,8 +4172,8 @@ TEST(AssertionSyntaxTest, ExceptionAssertionsBehavesLikeSingleStatement) { #endif TEST(AssertionSyntaxTest, NoFatalFailureAssertionsBehavesLikeSingleStatement) { if (AlwaysFalse()) - EXPECT_NO_FATAL_FAILURE(FAIL()) << "This should never be executed. " - << "It's a compilation test only."; + EXPECT_NO_FATAL_FAILURE(FAIL()) + << "This should never be executed. " << "It's a compilation test only."; else ; // NOLINT @@ -6667,6 +6671,9 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) { SetEnv("TERM", "xterm-kitty"); // TERM supports colors. EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY. + SetEnv("TERM", "alacritty"); // TERM supports colors. + EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY. + SetEnv("TERM", "xterm-256color"); // TERM supports colors. EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY. @@ -6691,7 +6698,7 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) { SetEnv("TERM", "linux"); // TERM supports colors. EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY. - SetEnv("TERM", "cygwin"); // TERM supports colors. + SetEnv("TERM", "cygwin"); // TERM supports colors. EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY. #endif // GTEST_OS_WINDOWS } @@ -7475,22 +7482,6 @@ TEST(NativeArrayTest, WorksForTwoDimensionalArray) { EXPECT_EQ(a, na.begin()); } -// IndexSequence -TEST(IndexSequence, MakeIndexSequence) { - using testing::internal::IndexSequence; - using testing::internal::MakeIndexSequence; - EXPECT_TRUE( - (std::is_same, MakeIndexSequence<0>::type>::value)); - EXPECT_TRUE( - (std::is_same, MakeIndexSequence<1>::type>::value)); - EXPECT_TRUE( - (std::is_same, MakeIndexSequence<2>::type>::value)); - EXPECT_TRUE(( - std::is_same, MakeIndexSequence<3>::type>::value)); - EXPECT_TRUE( - (std::is_base_of, MakeIndexSequence<3>>::value)); -} - // ElemFromList TEST(ElemFromList, Basic) { using testing::internal::ElemFromList; diff --git a/yass/third_party/googletest/googletest/test/gtest_xml_output_unittest.py b/yass/third_party/googletest/googletest/test/gtest_xml_output_unittest.py index 422569e483..c3fea2c0a3 100755 --- a/yass/third_party/googletest/googletest/test/gtest_xml_output_unittest.py +++ b/yass/third_party/googletest/googletest/test/gtest_xml_output_unittest.py @@ -112,20 +112,23 @@ Invalid characters in brackets []%(stack)s]]> - + - + - + diff --git a/yass/third_party/googletest/googletest_deps.bzl b/yass/third_party/googletest/googletest_deps.bzl index 8f19cbed76..1b7d2c8b8b 100644 --- a/yass/third_party/googletest/googletest_deps.bzl +++ b/yass/third_party/googletest/googletest_deps.bzl @@ -1,22 +1,28 @@ """Load dependencies needed to use the googletest library as a 3rd-party consumer.""" load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("//:fake_fuchsia_sdk.bzl", "fake_fuchsia_sdk") def googletest_deps(): """Loads common dependencies needed to use the googletest library.""" if not native.existing_rule("com_googlesource_code_re2"): http_archive( - name = "com_googlesource_code_re2", # 2023-03-17T11:36:51Z - sha256 = "cb8b5312a65f2598954545a76e8bce913f35fbb3a21a5c88797a4448e9f9b9d9", - strip_prefix = "re2-578843a516fd1da7084ae46209a75f3613b6065e", - urls = ["https://github.com/google/re2/archive/578843a516fd1da7084ae46209a75f3613b6065e.zip"], + name = "com_googlesource_code_re2", + sha256 = "828341ad08524618a626167bd320b0c2acc97bd1c28eff693a9ea33a7ed2a85f", + strip_prefix = "re2-2023-11-01", + urls = ["https://github.com/google/re2/releases/download/2023-11-01/re2-2023-11-01.zip"], ) if not native.existing_rule("com_google_absl"): http_archive( - name = "com_google_absl", # 2023-09-13T14:58:42Z - sha256 = "7766815ef6293dc7bca58fef59a96d7d3230874412dcd36dafb0e313ed1356f2", - strip_prefix = "abseil-cpp-9e1789ffea47fdeb3133aa42aa9592f3673fb6ed", - urls = ["https://github.com/abseil/abseil-cpp/archive/9e1789ffea47fdeb3133aa42aa9592f3673fb6ed.zip"], + name = "com_google_absl", + sha256 = "338420448b140f0dfd1a1ea3c3ce71b3bc172071f24f4d9a57d59b45037da440", + strip_prefix = "abseil-cpp-20240116.0", + urls = ["https://github.com/abseil/abseil-cpp/releases/download/20240116.0/abseil-cpp-20240116.0.tar.gz"], + ) + + if not native.existing_rule("fuchsia_sdk"): + fake_fuchsia_sdk( + name = "fuchsia_sdk", ) diff --git a/yass/third_party/quiche/src/quiche/quic/core/http/quic_spdy_client_stream_test.cc b/yass/third_party/quiche/src/quiche/quic/core/http/quic_spdy_client_stream_test.cc index af875dc0ae..ed03be2a3a 100644 --- a/yass/third_party/quiche/src/quiche/quic/core/http/quic_spdy_client_stream_test.cc +++ b/yass/third_party/quiche/src/quiche/quic/core/http/quic_spdy_client_stream_test.cc @@ -12,6 +12,7 @@ #include "quiche/quic/core/crypto/null_encrypter.h" #include "quiche/quic/core/http/quic_spdy_client_session.h" #include "quiche/quic/core/http/spdy_utils.h" +#include "quiche/quic/core/quic_error_codes.h" #include "quiche/quic/core/quic_utils.h" #include "quiche/quic/platform/api/quic_logging.h" #include "quiche/quic/platform/api/quic_socket_address.h" @@ -114,6 +115,8 @@ TEST_P(QuicSpdyClientStreamTest, TestReceivingIllegalResponseStatusCode) { headers); EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_BAD_APPLICATION_PAYLOAD)); + EXPECT_EQ(stream_->ietf_application_error(), + static_cast(QuicHttp3ErrorCode::GENERAL_PROTOCOL_ERROR)); } TEST_P(QuicSpdyClientStreamTest, InvalidResponseHeader) { @@ -126,6 +129,8 @@ TEST_P(QuicSpdyClientStreamTest, InvalidResponseHeader) { headers); EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_BAD_APPLICATION_PAYLOAD)); + EXPECT_EQ(stream_->ietf_application_error(), + static_cast(QuicHttp3ErrorCode::GENERAL_PROTOCOL_ERROR)); } TEST_P(QuicSpdyClientStreamTest, MissingStatusCode) { @@ -138,6 +143,8 @@ TEST_P(QuicSpdyClientStreamTest, MissingStatusCode) { headers); EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_BAD_APPLICATION_PAYLOAD)); + EXPECT_EQ(stream_->ietf_application_error(), + static_cast(QuicHttp3ErrorCode::GENERAL_PROTOCOL_ERROR)); } TEST_P(QuicSpdyClientStreamTest, TestFraming) { @@ -164,6 +171,8 @@ TEST_P(QuicSpdyClientStreamTest, HostAllowedInResponseHeader) { stream_->OnStreamHeaderList(false, headers.uncompressed_header_bytes(), headers); EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_STREAM_NO_ERROR)); + EXPECT_EQ(stream_->ietf_application_error(), + static_cast(QuicHttp3ErrorCode::HTTP3_NO_ERROR)); } TEST_P(QuicSpdyClientStreamTest, Test100ContinueBeforeSuccessful) { @@ -341,6 +350,8 @@ TEST_P(QuicSpdyClientStreamTest, QuicStreamFrame(stream_->id(), /*fin=*/false, /*offset=*/0, data)); EXPECT_NE(QUIC_STREAM_NO_ERROR, stream_->stream_error()); + EXPECT_EQ(stream_->ietf_application_error(), + static_cast(QuicHttp3ErrorCode::GENERAL_PROTOCOL_ERROR)); } // Test that receiving trailing headers (on the headers stream), containing a diff --git a/yass/third_party/quiche/src/quiche/quic/core/quic_session.h b/yass/third_party/quiche/src/quiche/quic/core/quic_session.h index d92e4e360f..3ac68bd2b3 100644 --- a/yass/third_party/quiche/src/quiche/quic/core/quic_session.h +++ b/yass/third_party/quiche/src/quiche/quic/core/quic_session.h @@ -506,6 +506,9 @@ class QUICHE_EXPORT QuicSession // Returns the Google QUIC error code QuicErrorCode error() const { return on_closed_frame_.quic_error_code; } + // The error code on the wire. For Google QUIC frames, this has the same + // value as `error()`. + uint64_t wire_error() const { return on_closed_frame_.wire_error_code; } const std::string& error_details() const { return on_closed_frame_.error_details; } diff --git a/yass/third_party/quiche/src/quiche/quic/core/quic_stream.h b/yass/third_party/quiche/src/quiche/quic/core/quic_stream.h index c846fe0275..4ce0d3a2ba 100644 --- a/yass/third_party/quiche/src/quiche/quic/core/quic_stream.h +++ b/yass/third_party/quiche/src/quiche/quic/core/quic_stream.h @@ -221,6 +221,10 @@ class QUICHE_EXPORT QuicStream : public QuicStreamSequencer::StreamInterface { QuicRstStreamErrorCode stream_error() const { return stream_error_.internal_code(); } + // Application error code of RESET_STREAM. + uint64_t ietf_application_error() const { + return stream_error_.ietf_application_code(); + } QuicErrorCode connection_error() const { return connection_error_; } bool reading_stopped() const { diff --git a/yass/third_party/quiche/src/quiche/spdy/core/spdy_framer_test.cc b/yass/third_party/quiche/src/quiche/spdy/core/spdy_framer_test.cc index d9283de897..9c52adadf2 100644 --- a/yass/third_party/quiche/src/quiche/spdy/core/spdy_framer_test.cc +++ b/yass/third_party/quiche/src/quiche/spdy/core/spdy_framer_test.cc @@ -204,8 +204,8 @@ class SpdyFramerPeer { } output->Reset(); EXPECT_TRUE(framer->SerializePushPromise(push_promise, output)); - SpdySerializedFrame serialized_headers_old_version(output->Begin(), - output->Size(), false); + SpdySerializedFrame serialized_headers_old_version = + MakeSerializedFrame(output->Begin(), output->Size()); framer->hpack_encoder_.reset(nullptr); auto* saved_debug_visitor = framer->debug_visitor_; framer->debug_visitor_ = nullptr; @@ -719,8 +719,8 @@ TEST_P(SpdyFramerTest, AcceptMaxFrameSizeSetting) { 0x00, 0x00, 0x00, 0x00, // Junk payload }; - SpdySerializedFrame frame(reinterpret_cast(kH2FrameData), - sizeof(kH2FrameData), false); + SpdySerializedFrame frame = MakeSerializedFrame( + reinterpret_cast(kH2FrameData), sizeof(kH2FrameData)); EXPECT_CALL(visitor, OnCommonHeader(1, 16384, 0x0, 0x0)); EXPECT_CALL(visitor, OnDataFrameHeader(1, 1 << 14, false)); @@ -744,8 +744,8 @@ TEST_P(SpdyFramerTest, ExceedMaxFrameSizeSetting) { 0x00, 0x00, 0x00, 0x00, // Junk payload }; - SpdySerializedFrame frame(reinterpret_cast(kH2FrameData), - sizeof(kH2FrameData), false); + SpdySerializedFrame frame = MakeSerializedFrame( + reinterpret_cast(kH2FrameData), sizeof(kH2FrameData)); EXPECT_CALL(visitor, OnCommonHeader(1, 16385, 0x0, 0x0)); EXPECT_CALL(visitor, OnError(Http2DecoderAdapter::SPDY_OVERSIZED_PAYLOAD, _)); @@ -775,8 +775,8 @@ TEST_P(SpdyFramerTest, AcceptLargerMaxFrameSizeSetting) { 0x00, 0x00, 0x00, 0x00, // Junk payload }; - SpdySerializedFrame frame(reinterpret_cast(kH2FrameData), - sizeof(kH2FrameData), false); + SpdySerializedFrame frame = MakeSerializedFrame( + reinterpret_cast(kH2FrameData), sizeof(kH2FrameData)); EXPECT_CALL(visitor, OnCommonHeader(1, big_frame_size, 0x0, 0x0)); EXPECT_CALL(visitor, OnDataFrameHeader(1, big_frame_size, false)); @@ -804,8 +804,8 @@ TEST_P(SpdyFramerTest, OversizedDataPaddingError) { 0x00, 0x00, 0x00, 0x00, // Padding }; - SpdySerializedFrame frame(reinterpret_cast(kH2FrameData), - sizeof(kH2FrameData), false); + SpdySerializedFrame frame = MakeSerializedFrame( + reinterpret_cast(kH2FrameData), sizeof(kH2FrameData)); { testing::InSequence seq; @@ -839,7 +839,8 @@ TEST_P(SpdyFramerTest, CorrectlySizedDataPaddingNoError) { 0x00, 0x00, 0x00, 0x00, // Padding }; - SpdySerializedFrame frame(kH2FrameData, sizeof(kH2FrameData), false); + SpdySerializedFrame frame = + MakeSerializedFrame(kH2FrameData, sizeof(kH2FrameData)); { testing::InSequence seq; @@ -879,8 +880,8 @@ TEST_P(SpdyFramerTest, OversizedHeadersPaddingError) { 0x00, 0x00, 0x00, 0x00, // Padding }; - SpdySerializedFrame frame(reinterpret_cast(kH2FrameData), - sizeof(kH2FrameData), false); + SpdySerializedFrame frame = MakeSerializedFrame( + reinterpret_cast(kH2FrameData), sizeof(kH2FrameData)); EXPECT_CALL(visitor, OnCommonHeader(1, 5, 0x1, 0x8)); EXPECT_CALL(visitor, OnHeaders(1, 5, false, 0, 0, false, false, false)); @@ -911,7 +912,8 @@ TEST_P(SpdyFramerTest, CorrectlySizedHeadersPaddingNoError) { 0x00, 0x00, 0x00, 0x00, // Padding }; - SpdySerializedFrame frame(kH2FrameData, sizeof(kH2FrameData), false); + SpdySerializedFrame frame = + MakeSerializedFrame(kH2FrameData, sizeof(kH2FrameData)); EXPECT_CALL(visitor, OnCommonHeader(1, 5, 0x1, 0x8)); EXPECT_CALL(visitor, OnHeaders(1, 5, false, 0, 0, false, false, false)); @@ -1039,7 +1041,8 @@ TEST_P(SpdyFramerTest, SettingsWithStreamIdNotZero) { 0x0a, 0x0b, 0x0c, 0x0d, // Value: 168496141 }; - SpdySerializedFrame frame(kH2FrameData, sizeof(kH2FrameData), false); + SpdySerializedFrame frame = + MakeSerializedFrame(kH2FrameData, sizeof(kH2FrameData)); // We shouldn't have to read the whole frame before we signal an error. EXPECT_CALL(visitor, OnCommonHeader(1, 6, 0x4, 0x0)); @@ -1070,7 +1073,8 @@ TEST_P(SpdyFramerTest, GoawayWithStreamIdNotZero) { 0x47, 0x41, // Description }; - SpdySerializedFrame frame(kH2FrameData, sizeof(kH2FrameData), false); + SpdySerializedFrame frame = + MakeSerializedFrame(kH2FrameData, sizeof(kH2FrameData)); // We shouldn't have to read the whole frame before we signal an error. EXPECT_CALL(visitor, OnCommonHeader(1, 10, 0x7, 0x0)); @@ -2501,7 +2505,8 @@ TEST_P(SpdyFramerTest, SendUnexpectedContinuation) { }; // frame-format on - SpdySerializedFrame frame(kH2FrameData, sizeof(kH2FrameData), false); + SpdySerializedFrame frame = + MakeSerializedFrame(kH2FrameData, sizeof(kH2FrameData)); // We shouldn't have to read the whole frame before we signal an error. EXPECT_CALL(visitor, OnCommonHeader(42, 18, 0x9, 0x4)); @@ -2853,7 +2858,8 @@ TEST_P(SpdyFramerTest, MultipleContinuationFramesWithIterator) { EXPECT_TRUE(frame_it.HasNextFrame()); EXPECT_GT(frame_it.NextFrame(&output_), 0u); - SpdySerializedFrame headers_frame(output_.Begin(), output_.Size(), false); + SpdySerializedFrame headers_frame = + MakeSerializedFrame(output_.Begin(), output_.Size()); EXPECT_EQ(headers_frame.size(), kHttp2MaxControlFrameSendSize); TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION); @@ -2869,7 +2875,8 @@ TEST_P(SpdyFramerTest, MultipleContinuationFramesWithIterator) { output_.Reset(); EXPECT_TRUE(frame_it.HasNextFrame()); EXPECT_GT(frame_it.NextFrame(&output_), 0u); - SpdySerializedFrame first_cont_frame(output_.Begin(), output_.Size(), false); + SpdySerializedFrame first_cont_frame = + MakeSerializedFrame(output_.Begin(), output_.Size()); EXPECT_EQ(first_cont_frame.size(), kHttp2MaxControlFrameSendSize); visitor.SimulateInFramer( @@ -2884,7 +2891,8 @@ TEST_P(SpdyFramerTest, MultipleContinuationFramesWithIterator) { output_.Reset(); EXPECT_TRUE(frame_it.HasNextFrame()); EXPECT_GT(frame_it.NextFrame(&output_), 0u); - SpdySerializedFrame second_cont_frame(output_.Begin(), output_.Size(), false); + SpdySerializedFrame second_cont_frame = + MakeSerializedFrame(output_.Begin(), output_.Size()); EXPECT_LT(second_cont_frame.size(), kHttp2MaxControlFrameSendSize); visitor.SimulateInFramer( @@ -2919,8 +2927,8 @@ TEST_P(SpdyFramerTest, PushPromiseFramesWithIterator) { EXPECT_TRUE(frame_it.HasNextFrame()); EXPECT_GT(frame_it.NextFrame(&output_), 0u); - SpdySerializedFrame push_promise_frame(output_.Begin(), output_.Size(), - false); + SpdySerializedFrame push_promise_frame = + MakeSerializedFrame(output_.Begin(), output_.Size()); EXPECT_EQ(push_promise_frame.size(), kHttp2MaxControlFrameSendSize); TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION); @@ -2936,7 +2944,8 @@ TEST_P(SpdyFramerTest, PushPromiseFramesWithIterator) { EXPECT_TRUE(frame_it.HasNextFrame()); output_.Reset(); EXPECT_GT(frame_it.NextFrame(&output_), 0u); - SpdySerializedFrame first_cont_frame(output_.Begin(), output_.Size(), false); + SpdySerializedFrame first_cont_frame = + MakeSerializedFrame(output_.Begin(), output_.Size()); EXPECT_EQ(first_cont_frame.size(), kHttp2MaxControlFrameSendSize); visitor.SimulateInFramer( @@ -2951,7 +2960,8 @@ TEST_P(SpdyFramerTest, PushPromiseFramesWithIterator) { EXPECT_TRUE(frame_it.HasNextFrame()); output_.Reset(); EXPECT_GT(frame_it.NextFrame(&output_), 0u); - SpdySerializedFrame second_cont_frame(output_.Begin(), output_.Size(), false); + SpdySerializedFrame second_cont_frame = + MakeSerializedFrame(output_.Begin(), output_.Size()); EXPECT_LT(second_cont_frame.size(), kHttp2MaxControlFrameSendSize); visitor.SimulateInFramer( diff --git a/yass/third_party/quiche/src/quiche/spdy/core/spdy_protocol.h b/yass/third_party/quiche/src/quiche/spdy/core/spdy_protocol.h index ebcb21acd6..ec57be22e3 100644 --- a/yass/third_party/quiche/src/quiche/spdy/core/spdy_protocol.h +++ b/yass/third_party/quiche/src/quiche/spdy/core/spdy_protocol.h @@ -993,84 +993,41 @@ class QUICHE_EXPORT SpdyUnknownIR : public SpdyFrameIR { class QUICHE_EXPORT SpdySerializedFrame { public: - SpdySerializedFrame() - : frame_(const_cast("")), size_(0), owns_buffer_(false) {} + SpdySerializedFrame() : size_(0) {} // Creates a valid SpdySerializedFrame using a pre-created buffer. SpdySerializedFrame(std::unique_ptr data, size_t size) - : frame_(data.release()), size_(size), owns_buffer_(true) {} - - // Create a valid SpdySerializedFrame using a pre-created buffer. - // If |owns_buffer| is true, this class takes ownership of the buffer and will - // delete it on cleanup. The buffer must have been created using new char[]. - // If |owns_buffer| is false, the caller retains ownership of the buffer and - // is responsible for making sure the buffer outlives this frame. In other - // words, this class does NOT create a copy of the buffer. - SpdySerializedFrame(char* data, size_t size, bool owns_buffer) - : frame_(data), size_(size), owns_buffer_(owns_buffer) {} + : frame_(std::move(data)), size_(size) {} SpdySerializedFrame(SpdySerializedFrame&& other) - : frame_(other.frame_), - size_(other.size_), - owns_buffer_(other.owns_buffer_) { - // |other| is no longer responsible for the buffer. - other.owns_buffer_ = false; - } + : frame_(std::move(other.frame_)), size_(other.size_) {} + SpdySerializedFrame(const SpdySerializedFrame&) = delete; SpdySerializedFrame& operator=(const SpdySerializedFrame&) = delete; SpdySerializedFrame& operator=(SpdySerializedFrame&& other) { - // Free buffer if necessary. - if (owns_buffer_) { - delete[] frame_; - } // Take over |other|. - frame_ = other.frame_; + frame_ = std::move(other.frame_); size_ = other.size_; - owns_buffer_ = other.owns_buffer_; - // |other| is no longer responsible for the buffer. - other.owns_buffer_ = false; return *this; } - ~SpdySerializedFrame() { - if (owns_buffer_) { - delete[] frame_; - } - } + ~SpdySerializedFrame() = default; // Provides access to the frame bytes, which is a buffer containing the frame // packed as expected for sending over the wire. - char* data() const { return frame_; } + char* data() const { return frame_.get(); } // Returns the actual size of the underlying buffer. size_t size() const { return size_; } operator absl::string_view() const { - return absl::string_view{frame_, size_}; - } - - // Returns a buffer containing the contents of the frame, of which the caller - // takes ownership, and clears this SpdySerializedFrame. - char* ReleaseBuffer() { - char* buffer; - if (owns_buffer_) { - // If the buffer is owned, relinquish ownership to the caller. - buffer = frame_; - owns_buffer_ = false; - } else { - // Otherwise, we need to make a copy to give to the caller. - buffer = new char[size_]; - memcpy(buffer, frame_, size_); - } - *this = SpdySerializedFrame(); - return buffer; + return absl::string_view{frame_.get(), size_}; } private: - char* frame_; + std::unique_ptr frame_; size_t size_; - bool owns_buffer_; }; // This interface is for classes that want to process SpdyFrameIRs without