From ef186227937cf47788b413cdc63cf66f919b33ba Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 9 Dec 2024 14:10:13 +0000 Subject: [PATCH] - Fix undefined signals/functions that comes from bad visibility scope. - Fix binding loop on cacheBuffer and wrong variables on call statistics. - Remove apostrophe from user-agent. - Add RemoteCardDAV into contact list. - Fix crash on starting a call while a conferenceInfo is loading. - Contact details redirection after creating one. --- Linphone/core/account/AccountCore.hpp | 5 +++-- Linphone/core/call/CallCore.hpp | 2 +- Linphone/core/conference/ConferenceInfoCore.cpp | 5 +++-- Linphone/core/payload-type/PayloadTypeCore.hpp | 4 ++-- Linphone/core/setting/SettingsCore.hpp | 2 +- Linphone/model/tool/ToolModel.cpp | 3 ++- Linphone/tool/LinphoneEnums.hpp | 1 + Linphone/view/Control/Button/Settings/SwitchSetting.qml | 4 ++-- Linphone/view/Control/Container/Contact/ContactLayout.qml | 2 +- Linphone/view/Control/Display/Call/CallStatistics.qml | 4 ++-- Linphone/view/Page/Form/Contact/ContactEdition.qml | 2 +- Linphone/view/Page/Layout/Main/MainLayout.qml | 4 ++-- Linphone/view/Page/Main/Call/CallPage.qml | 4 ++++ Linphone/view/Page/Main/Contact/ContactPage.qml | 2 +- 14 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Linphone/core/account/AccountCore.hpp b/Linphone/core/account/AccountCore.hpp index 1c9fcb335..670e85bef 100644 --- a/Linphone/core/account/AccountCore.hpp +++ b/Linphone/core/account/AccountCore.hpp @@ -31,6 +31,7 @@ class AccountCore : public QObject, public AbstractObject { Q_OBJECT +public: Q_PROPERTY(QString contactAddress READ getContactAddress CONSTANT) Q_PROPERTY(QString identityAddress READ getIdentityAddress CONSTANT) Q_PROPERTY(QString pictureUri READ getPictureUri WRITE lSetPictureUri NOTIFY pictureUriChanged) @@ -71,10 +72,9 @@ class AccountCore : public QObject, public AbstractObject { Q_PROPERTY(QString audioVideoConferenceFactoryAddress READ getAudioVideoConferenceFactoryAddress WRITE lSetAudioVideoConferenceFactoryAddress NOTIFY audioVideoConferenceFactoryAddressChanged) Q_PROPERTY(QString limeServerUrl READ getLimeServerUrl WRITE lSetLimeServerUrl NOTIFY limeServerUrlChanged) + DECLARE_CORE_GET(int, voicemailCount, VoicemailCount) DECLARE_CORE_GETSET_MEMBER(QString, voicemailAddress, VoicemailAddress) - -public: static QSharedPointer create(const std::shared_ptr &account); // Should be call from model Thread. Will be automatically in App thread after initialization AccountCore(const std::shared_ptr &account); @@ -170,6 +170,7 @@ signals: void audioVideoConferenceFactoryAddressChanged(); void limeServerUrlChanged(); void removed(); + // void voicemailAddressChanged(); // Account requests void lSetPictureUri(QString pictureUri); diff --git a/Linphone/core/call/CallCore.hpp b/Linphone/core/call/CallCore.hpp index a9bc2d2b2..639785832 100644 --- a/Linphone/core/call/CallCore.hpp +++ b/Linphone/core/call/CallCore.hpp @@ -96,6 +96,7 @@ public: class CallCore : public QObject, public AbstractObject { Q_OBJECT +public: Q_PROPERTY(LinphoneEnums::CallStatus status READ getStatus NOTIFY statusChanged) Q_PROPERTY(LinphoneEnums::CallDir dir READ getDir NOTIFY dirChanged) Q_PROPERTY(LinphoneEnums::CallState state READ getState NOTIFY stateChanged) @@ -140,7 +141,6 @@ class CallCore : public QObject, public AbstractObject { DECLARE_GUI_GETSET(bool, isStarted, IsStarted) -public: // Should be call from model Thread. Will be automatically in App thread after initialization static QSharedPointer create(const std::shared_ptr &call); CallCore(const std::shared_ptr &call); diff --git a/Linphone/core/conference/ConferenceInfoCore.cpp b/Linphone/core/conference/ConferenceInfoCore.cpp index ce2961bf5..a3a57b4e1 100644 --- a/Linphone/core/conference/ConferenceInfoCore.cpp +++ b/Linphone/core/conference/ConferenceInfoCore.cpp @@ -97,14 +97,15 @@ ConferenceInfoCore::ConferenceInfoCore(std::shared_ptr mIsScheduled = true; mDuration = 60; mEndDateTime = mDateTime.addSecs(mDuration * 60); - App::postModelSync([this]() { + App::postModelAsync([this]() { auto defaultAccount = CoreModel::getInstance()->getCore()->getDefaultAccount(); if (defaultAccount) { auto accountAddress = defaultAccount->getContactAddress(); if (accountAddress) { auto cleanedClonedAddress = accountAddress->clone(); cleanedClonedAddress->clean(); - mOrganizerAddress = Utils::coreStringToAppString(cleanedClonedAddress->asStringUriOnly()); + auto address = Utils::coreStringToAppString(cleanedClonedAddress->asStringUriOnly()); + App::postCoreAsync([this, address]() { setOrganizerAddress(address); }); } } }); diff --git a/Linphone/core/payload-type/PayloadTypeCore.hpp b/Linphone/core/payload-type/PayloadTypeCore.hpp index 04dd03291..8c66324e2 100644 --- a/Linphone/core/payload-type/PayloadTypeCore.hpp +++ b/Linphone/core/payload-type/PayloadTypeCore.hpp @@ -31,19 +31,19 @@ class PayloadTypeCore : public QObject, public AbstractObject { Q_OBJECT +public: Q_ENUMS(Family) Q_PROPERTY(Family family MEMBER mFamily CONSTANT) DECLARE_CORE_MEMBER(int, clockRate, ClockRate) DECLARE_CORE_MEMBER(QString, recvFmtp, RecvFmtp) -public: enum Family { Audio, Video, Text }; static QSharedPointer create(Family family, const std::shared_ptr &payloadType); PayloadTypeCore(Family family, const std::shared_ptr &payloadType); - PayloadTypeCore() {}; + PayloadTypeCore(){}; ~PayloadTypeCore(); void setSelf(QSharedPointer me); diff --git a/Linphone/core/setting/SettingsCore.hpp b/Linphone/core/setting/SettingsCore.hpp index c38a7e198..cb0382e75 100644 --- a/Linphone/core/setting/SettingsCore.hpp +++ b/Linphone/core/setting/SettingsCore.hpp @@ -32,6 +32,7 @@ class SettingsCore : public QObject, public AbstractObject { Q_OBJECT +public: // Security Q_PROPERTY(bool vfsEnabled READ getVfsEnabled WRITE setVfsEnabled NOTIFY vfsEnabledChanged) @@ -69,7 +70,6 @@ class SettingsCore : public QObject, public AbstractObject { Q_PROPERTY(QString logsFolder READ getLogsFolder) Q_PROPERTY(bool dnd READ dndEnabled WRITE lEnableDnd NOTIFY dndChanged) -public: static QSharedPointer create(); SettingsCore(QObject *parent = Q_NULLPTR); virtual ~SettingsCore(); diff --git a/Linphone/model/tool/ToolModel.cpp b/Linphone/model/tool/ToolModel.cpp index f36f22440..20e92379b 100644 --- a/Linphone/model/tool/ToolModel.cpp +++ b/Linphone/model/tool/ToolModel.cpp @@ -365,5 +365,6 @@ QString ToolModel::computeUserAgent(const std::shared_ptr &con .arg(Utils::getApplicationProduct()) .arg(SettingsModel::getDeviceName(config).replace('\\', "\\\\").replace('(', "\\(").replace(')', "\\)")) .arg(Utils::getOsProduct()) - .arg(qVersion()); + .arg(qVersion()) + .remove("'"); } diff --git a/Linphone/tool/LinphoneEnums.hpp b/Linphone/tool/LinphoneEnums.hpp index 3aff8ed6e..147fee251 100644 --- a/Linphone/tool/LinphoneEnums.hpp +++ b/Linphone/tool/LinphoneEnums.hpp @@ -272,6 +272,7 @@ enum class MagicSearchSource { Request = int(linphone::MagicSearch::Source::Request), FavoriteFriends = int(linphone::MagicSearch::Source::FavoriteFriends), ConferencesInfo = int(linphone::MagicSearch::Source::ConferencesInfo), + RemoteCardDAV = int(linphone::MagicSearch::Source::RemoteCardDAV), All = int(linphone::MagicSearch::Source::All) }; Q_ENUM_NS(MagicSearchSource); diff --git a/Linphone/view/Control/Button/Settings/SwitchSetting.qml b/Linphone/view/Control/Button/Settings/SwitchSetting.qml index 5cffef89a..e60a1c427 100644 --- a/Linphone/view/Control/Button/Settings/SwitchSetting.qml +++ b/Linphone/view/Control/Button/Settings/SwitchSetting.qml @@ -38,14 +38,14 @@ RowLayout { Switch { id: switchButton Layout.alignment: Qt.AlignRight | Qt.AlignVCenter - checked: propertyOwner[mainItem.propertyName] + checked: propertyOwner ? propertyOwner[mainItem.propertyName] : false enabled: mainItem.enabled onCheckedChanged: mainItem.checkedChanged(checked) onToggled: binding.when = true } Binding { id: binding - target: propertyOwner + target: propertyOwner ? propertyOwner : null property: mainItem.propertyName value: switchButton.checked when: false diff --git a/Linphone/view/Control/Container/Contact/ContactLayout.qml b/Linphone/view/Control/Container/Contact/ContactLayout.qml index bb663496b..1451bca89 100644 --- a/Linphone/view/Control/Container/Contact/ContactLayout.qml +++ b/Linphone/view/Control/Container/Contact/ContactLayout.qml @@ -67,7 +67,7 @@ ColumnLayout { } Item { id: verticalLayoutSecondLine - visible: contactDetail.useVerticalLayout + visible: mainItem.useVerticalLayout Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: childrenRect.width Layout.preferredHeight: childrenRect.height diff --git a/Linphone/view/Control/Display/Call/CallStatistics.qml b/Linphone/view/Control/Display/Call/CallStatistics.qml index 32da1e9d1..03b42c021 100644 --- a/Linphone/view/Control/Display/Call/CallStatistics.qml +++ b/Linphone/view/Control/Display/Call/CallStatistics.qml @@ -80,7 +80,7 @@ ColumnLayout { Layout.leftMargin: 16 * DefaultStyle.dp Layout.rightMargin: 16 * DefaultStyle.dp - visible: mainItem.localVideoEnabled || mainItem.remoteVideoEnabled + visible: mainItem.call?.core.localVideoEnabled || mainItem.call?.core.remoteVideoEnabled || false contentItem: ColumnLayout { spacing: 12 * DefaultStyle.dp @@ -140,4 +140,4 @@ ColumnLayout { } } Item{Layout.fillHeight: true} -} \ No newline at end of file +} diff --git a/Linphone/view/Page/Form/Contact/ContactEdition.qml b/Linphone/view/Page/Form/Contact/ContactEdition.qml index 19668e3d2..aa0a86c8b 100644 --- a/Linphone/view/Page/Form/Contact/ContactEdition.qml +++ b/Linphone/view/Page/Form/Contact/ContactEdition.qml @@ -18,7 +18,7 @@ MainRightPanel { if (contact.core.isSaved) { var mainWin = UtilsCpp.getMainWindow() UtilsCpp.smartShowWindow(mainWin) - mainWin.goToContactDetail(contact) + mainWin.displayContactPage(contact) } } } diff --git a/Linphone/view/Page/Layout/Main/MainLayout.qml b/Linphone/view/Page/Layout/Main/MainLayout.qml index 74fd8ada6..5f1c09653 100644 --- a/Linphone/view/Page/Layout/Main/MainLayout.qml +++ b/Linphone/view/Page/Layout/Main/MainLayout.qml @@ -302,8 +302,8 @@ Item { delegate: Item { Connections { target: modelData.core - onShowMwiChanged: voicemail.updateCumulatedMwi() - onVoicemailAddressChanged: voicemail.updateCumulatedMwi() + function onShowMwiChanged() {voicemail.updateCumulatedMwi()} + function onVoicemailAddressChanged(){voicemail.updateCumulatedMwi()} } } } diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index 8c20402ed..7c6f726dd 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -267,6 +267,10 @@ AbstractMainPage { event.accepted = true } } + // remove binding loop + onContentHeightChanged: Qt.callLater(function(){ + historyListView.cacheBuffer = Math.max(contentHeight,0) + }) onActiveFocusChanged: if(activeFocus && currentIndex <0) currentIndex = 0 Connections { diff --git a/Linphone/view/Page/Main/Contact/ContactPage.qml b/Linphone/view/Page/Main/Contact/ContactPage.qml index d4309ee0c..76619a3ad 100644 --- a/Linphone/view/Page/Main/Contact/ContactPage.qml +++ b/Linphone/view/Page/Main/Contact/ContactPage.qml @@ -237,7 +237,7 @@ AbstractMainPage { searchBarText: searchBar.text hideSuggestions: true showDefaultAddress: false - sourceFlags: LinphoneEnums.MagicSearchSource.Friends | LinphoneEnums.MagicSearchSource.FavoriteFriends | LinphoneEnums.MagicSearchSource.LdapServers + sourceFlags: LinphoneEnums.MagicSearchSource.Friends | LinphoneEnums.MagicSearchSource.FavoriteFriends | LinphoneEnums.MagicSearchSource.LdapServers | LinphoneEnums.MagicSearchSource.RemoteCardDAV onHighlightedContactChanged: mainItem.selectedContact = highlightedContact onContactDeletionRequested: (contact) => { mainItem.deleteContact(contact)