From ceccc36a4c077869632c0ddc1591da94a4f7ecd0 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 24 Sep 2024 17:54:54 +0200 Subject: [PATCH] Windows: fix versions, executable name, icons, folder installation Fix a crash coming from Notifier (Component was not set/used on the correct indexes) Fix reg_routes for Linphones accounts. Update SDK --- Linphone/CMakeLists.txt | 20 ++++++++++++++++--- Linphone/application_info.cmake | 4 ++-- Linphone/core/notifier/Notifier.cpp | 7 ++----- Linphone/core/notifier/Notifier.hpp | 13 ++++++------ .../data/assistant/create-app-sip-account.rc | 1 + .../data/assistant/use-app-sip-account.rc | 1 + README.md | 3 ++- cmake/install/install.cmake | 2 +- cmake/install/windows/appDetailsWindows.rc.in | 8 ++++---- 9 files changed, 37 insertions(+), 22 deletions(-) diff --git a/Linphone/CMakeLists.txt b/Linphone/CMakeLists.txt index 8211bf2da..40a54cec5 100644 --- a/Linphone/CMakeLists.txt +++ b/Linphone/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -project(Linphone VERSION 6.0 LANGUAGES CXX) +project(Linphone VERSION 6.0.0 LANGUAGES CXX) ################################################################ # PACKAGES @@ -52,6 +52,13 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)#useful for config.h if(NOT LINPHONEAPP_VERSION) bc_compute_full_version(LINPHONEAPP_VERSION) endif() + +set(LINPHONE_MAJOR_VERSION) +set(LINPHONE_MINOR_VERSION) +set(LINPHONE_MICRO_VERSION) +set(LINPHONE_BRANCH_VERSION) +bc_parse_full_version(${LINPHONEAPP_VERSION} LINPHONE_MAJOR_VERSION LINPHONE_MINOR_VERSION LINPHONE_MICRO_VERSION LINPHONE_BRANCH_VERSION) + include(application_info.cmake) string(TIMESTAMP CURRENT_YEAR "%Y") if(NOT APPLICATION_START_LICENCE OR "${CURRENT_YEAR}" STREQUAL "${APPLICATION_START_LICENCE}") @@ -98,6 +105,12 @@ add_subdirectory(model) add_subdirectory(view) add_subdirectory(core) +# set application details +if(WIN32) + configure_file("${CMAKE_SOURCE_DIR}/cmake/install/windows/appDetailsWindows.rc.in" "${CMAKE_CURRENT_BINARY_DIR}/appDetailsWindows.rc") + set(_APPDETAILS_RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/appDetailsWindows.rc) +endif() + #fonts.qrc is in data and not in data/font because we want to use 'font' in path and not in prefix. #TODO make prefix working set(_LINPHONEAPP_FONTS_FILES) @@ -108,8 +121,9 @@ list(APPEND _LINPHONEAPP_FONTS_FILES data/fonts.qrc) set_property(SOURCE data/fonts.qrc PROPERTY SKIP_AUTORCC ON) qt6_add_executable(Linphone - ${_LINPHONEAPP_SOURCES} - ${_LINPHONEAPP_FONTS_FILES} + ${_LINPHONEAPP_SOURCES} + ${_LINPHONEAPP_FONTS_FILES} + ${_APPDETAILS_RC_FILE} ) set_source_files_properties(${_LINPHONEAPP_QML_SINGLETONS} PROPERTIES QT_QML_SINGLETON_TYPE TRUE) diff --git a/Linphone/application_info.cmake b/Linphone/application_info.cmake index acc498d93..bbabebe91 100644 --- a/Linphone/application_info.cmake +++ b/Linphone/application_info.cmake @@ -1,6 +1,6 @@ set(APPLICATION_DESCRIPTION "A libre SIP client") set(APPLICATION_ID "com.belledonnecommunications.linphone60") -set(APPLICATION_NAME Linphone60) +set(APPLICATION_NAME Linphone6) set(APPLICATION_URL "https://www.linphone.org") set(APPLICATION_VENDOR "Belledonne Communications") set(APPLICATION_LICENCE "GNU General Public License V3") @@ -8,4 +8,4 @@ set(APPLICATION_LICENCE_URL "https://www.gnu.org/licenses/gpl-3.0.html") set(APPLICATION_START_LICENCE "2010") set(APPLICATION_SEMVER ${LINPHONEAPP_VERSION}) -set(EXECUTABLE_NAME linphone60) +set(EXECUTABLE_NAME linphone6) diff --git a/Linphone/core/notifier/Notifier.cpp b/Linphone/core/notifier/Notifier.cpp index 396e288e0..8a08c82a4 100644 --- a/Linphone/core/notifier/Notifier.cpp +++ b/Linphone/core/notifier/Notifier.cpp @@ -98,7 +98,7 @@ const QHash Notifier::Notifications = { Notifier::Notifier(QObject *parent) : QObject(parent) { mustBeInMainThread(getClassName()); const int nComponents = Notifications.size(); - mComponents = new QQmlComponent *[nComponents]; + mComponents.resize(nComponents); QQmlEngine *engine = App::getInstance()->mEngine; for (const auto &key : Notifications.keys()) { @@ -120,10 +120,7 @@ Notifier::~Notifier() { delete mMutex; const int nComponents = Notifications.size(); - if (mComponents) { - delete[] mComponents; - mComponents = nullptr; - } + mComponents.clear(); } // ----------------------------------------------------------------------------- diff --git a/Linphone/core/notifier/Notifier.hpp b/Linphone/core/notifier/Notifier.hpp index 9e71a8bdf..7105d3d25 100644 --- a/Linphone/core/notifier/Notifier.hpp +++ b/Linphone/core/notifier/Notifier.hpp @@ -41,12 +41,12 @@ public: ~Notifier(); enum NotificationType { - ReceivedMessage, - ReceivedFileMessage, + //ReceivedMessage, + //ReceivedFileMessage, ReceivedCall, - NewVersionAvailable, - SnapshotWasTaken, - RecordingCompleted + //NewVersionAvailable, + //SnapshotWasTaken, + //RecordingCompleted }; // void notifyReceivedCall(Call *call); @@ -95,7 +95,8 @@ private: int mInstancesNumber = 0; QMutex *mMutex = nullptr; - QQmlComponent **mComponents = nullptr; + //QQmlComponent **mComponents = nullptr; + QVector mComponents; static const QHash Notifications; diff --git a/Linphone/data/assistant/create-app-sip-account.rc b/Linphone/data/assistant/create-app-sip-account.rc index f55f6927d..a00ea1df1 100644 --- a/Linphone/data/assistant/create-app-sip-account.rc +++ b/Linphone/data/assistant/create-app-sip-account.rc @@ -14,6 +14,7 @@ 600 sip:?@sip.linphone.org <sip:sip.linphone.org;transport=tls> + <sip:sip.linphone.org;transport=tls> 1 default_nat_policy_values sip.linphone.org diff --git a/Linphone/data/assistant/use-app-sip-account.rc b/Linphone/data/assistant/use-app-sip-account.rc index 487baf469..202236ebb 100644 --- a/Linphone/data/assistant/use-app-sip-account.rc +++ b/Linphone/data/assistant/use-app-sip-account.rc @@ -14,6 +14,7 @@ 600 sip:?@sip.linphone.org <sip:sip.linphone.org;transport=tls> + <sip:sip.linphone.org;transport=tls> 1 default_nat_policy_values sip.linphone.org diff --git a/README.md b/README.md index cc690899f..0181f1e76 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,7 @@ For example: ## Specific instructions for the Windows platform 32-bit version is not supported as Qt6 doesn't provide 32bits packages for MSVC. +Visual Studio 2022 is only supported. 1. Install main tools: - `MinGW/MSYS2` : [download](https://www.msys2.org/) @@ -186,7 +187,7 @@ Specify `-DENABLE_WINDOWS_TOOLS_CHECK=ON` when building the SDK to install autom 2. Ensure that you have downloaded the correct Qt version on msvc. -3. Or open a Command line with Visual Studio `Developer Command Prompt for VS 2019` and call qtenv2.bat that is in your qt binaries eg: `C:\Qt\\msvc2019\bin\qtenv2.bat` +3. Or open a Command line with Visual Studio `Developer Command Prompt for VS 2022` and call qtenv2.bat that is in your qt binaries eg: `C:\Qt\\msvc2019\bin\qtenv2.bat` 4. Build as usual with adding `-A x64` to `cmake ..` (General Steps) : - `cmake .. -DCMAKE_BUILD_PARALLEL_LEVEL=10 -DCMAKE_BUILD_TYPE=RelWithDebInfo -A x64` diff --git a/cmake/install/install.cmake b/cmake/install/install.cmake index cf42ec0ae..2f9b216b5 100644 --- a/cmake/install/install.cmake +++ b/cmake/install/install.cmake @@ -185,7 +185,7 @@ if(${ENABLE_APP_PACKAGING}) configure_file("${CMAKE_SOURCE_DIR}/cmake/install/cleanCPack.cmake.in" "${CMAKE_BINARY_DIR}/cmake/install/cleanCPack.cmake" @ONLY) set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_BINARY_DIR}/cmake/install/cleanCPack.cmake") - + set(CPACK_PACKAGE_INSTALL_DIRECTORY ${APPLICATION_NAME}) if(APPLE) ############################################## # APPLE diff --git a/cmake/install/windows/appDetailsWindows.rc.in b/cmake/install/windows/appDetailsWindows.rc.in index 94fa1b416..4cdf17feb 100644 --- a/cmake/install/windows/appDetailsWindows.rc.in +++ b/cmake/install/windows/appDetailsWindows.rc.in @@ -1,4 +1,4 @@ -A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "assets/icon.ico" +A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "data/icon.ico" # if defined(UNDER_CE) # include @@ -7,8 +7,8 @@ A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "assets/icon.ico" # endif VS_VERSION_INFO VERSIONINFO - PRODUCTVERSION ${version_major},${version_minor},${version_patch},0 - FILEVERSION ${version_major},${version_minor},${version_patch},0 + PRODUCTVERSION ${LINPHONE_MAJOR_VERSION},${LINPHONE_MINOR_VERSION},${LINPHONE_MICRO_VERSION},0 + FILEVERSION ${LINPHONE_MAJOR_VERSION},${LINPHONE_MINOR_VERSION},${LINPHONE_MICRO_VERSION},0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG @@ -37,4 +37,4 @@ VS_VERSION_INFO VERSIONINFO VALUE "Translation", 0x409, 1200 END END -/* End of Version info */ \ No newline at end of file +/* End of Version info */