From 485a2ad8feab6b1dee7c672ce03736d819fd9d37 Mon Sep 17 00:00:00 2001 From: Sebastian Streich Date: Thu, 24 Oct 2024 22:06:01 +0200 Subject: [PATCH] Re:#9966 Fix Crash in MZFlickable --- .gitignore | 2 +- extension/socks5proxy/bin/CMakeLists.txt | 1 + nebula/ui/components/MZFlickable.qml | 12 ++++-------- src/commands/commandui.cpp | 2 +- src/platforms/windows/daemon/windowsfirewall.cpp | 3 ++- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 937287dc4f..d9cfd2ffa2 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,7 @@ nebula/nebula_autogen/ nebula/libnebula.a src/mozillavpn_autogen/ /build-*/ -/build/ +/build*/ dummybuild # Node (for functional tests) diff --git a/extension/socks5proxy/bin/CMakeLists.txt b/extension/socks5proxy/bin/CMakeLists.txt index e8a9a46fa0..bac50d79e9 100644 --- a/extension/socks5proxy/bin/CMakeLists.txt +++ b/extension/socks5proxy/bin/CMakeLists.txt @@ -18,6 +18,7 @@ if(WIN32) target_sources(socksproxy PRIVATE windowsbypass.cpp windowsbypass.h) + target_link_libraries(socksproxy PRIVATE Iphlpapi.lib) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/socksproxy.exe diff --git a/nebula/ui/components/MZFlickable.qml b/nebula/ui/components/MZFlickable.qml index 0df52bcbca..b0130fa77d 100644 --- a/nebula/ui/components/MZFlickable.qml +++ b/nebula/ui/components/MZFlickable.qml @@ -22,15 +22,11 @@ Flickable { boundsBehavior: Flickable.StopAtBounds opacity: 0 - onFlickContentHeightChanged: { - recalculateContentHeight() - } - - onHeightChanged: { - recalculateContentHeight() - } - Component.onCompleted: { + recalculateContentHeight() + this.onHeightChanged.connect(recalculateContentHeight) + this.onFlickContentHeightChanged.connect(recalculateContentHeight) + opacity = 1; if (Qt.platform.os === "windows") { maximumFlickVelocity = 700; diff --git a/src/commands/commandui.cpp b/src/commands/commandui.cpp index a0042b77f2..7b160c13b6 100644 --- a/src/commands/commandui.cpp +++ b/src/commands/commandui.cpp @@ -207,7 +207,7 @@ int CommandUI::run(QStringList& tokens) { EventListener eventListener; #endif -#ifdef MZ_DEBUG +#ifdef false // This enables the qt-creator qml debugger on debug builds.: // Go to QtCreator: Debug->Start Debugging-> Attach to QML port // Port is 1234. diff --git a/src/platforms/windows/daemon/windowsfirewall.cpp b/src/platforms/windows/daemon/windowsfirewall.cpp index b65e982476..50f1c767a5 100644 --- a/src/platforms/windows/daemon/windowsfirewall.cpp +++ b/src/platforms/windows/daemon/windowsfirewall.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "ipaddress.h" #include "leakdetector.h" @@ -320,7 +321,7 @@ bool WindowsFirewall::disableKillSwitch() { FwpmFilterDeleteById0(m_sessionHandle, filterID); } - for (const auto& filterID : qAsConst(m_activeRules)) { + for (const auto& filterID : std::as_const(m_activeRules)) { FwpmFilterDeleteById0(m_sessionHandle, filterID); }