From 6506bbeb18c8a136fca916b63dde238142741343 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 26 Jul 2023 16:46:18 +0200 Subject: [PATCH] Migrate call logs after starting core. Fix Ref initialization for sip addresses optimizations. Update SDK to 5.2.78 (chat rooms loading optimization) --- CHANGELOG.md | 2 +- linphone-app/src/components/core/CoreManager.cpp | 6 +++--- .../src/components/sip-addresses/SipAddressesModel.cpp | 5 +++-- .../src/components/sip-addresses/SipAddressesModel.hpp | 6 ++++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e992a1d66..faecf6f33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Create thumbnails into memory instead of disk. - Display video thumbnails. - Crop thumbnail and pictures if distored. -- Update SDK to 5.2.66 +- Update SDK to 5.2.72 ### Removed - Picture zoom on mouse over. diff --git a/linphone-app/src/components/core/CoreManager.cpp b/linphone-app/src/components/core/CoreManager.cpp index 6a57252a9..d6f639288 100644 --- a/linphone-app/src/components/core/CoreManager.cpp +++ b/linphone-app/src/components/core/CoreManager.cpp @@ -221,18 +221,16 @@ void CoreManager::cleanLogs () const { void CoreManager::setDatabasesPaths () { SET_DATABASE_PATH(Friends, Paths::getFriendsListFilePath()); - linphone_core_set_call_logs_database_path(mCore->cPtr(), Paths::getCallHistoryFilePath().c_str());// Setting the message database let SDK to migrate data if(QFile::exists(Utils::coreStringToAppString(Paths::getMessageHistoryFilePath()))){ linphone_core_set_chat_database_path(mCore->cPtr(), Paths::getMessageHistoryFilePath().c_str());// Setting the message database let SDK to migrate data QFile::remove(Utils::coreStringToAppString(Paths::getMessageHistoryFilePath())); } } -#undef SET_DATABASE_PATH - // ----------------------------------------------------------------------------- void CoreManager::setOtherPaths () { + SET_DATABASE_PATH(CallLogs, Paths::getCallHistoryFilePath());// Setting the call logs database let SDK to migrate data if (mCore->getZrtpSecretsFile().empty() || !Paths::filePathExists(mCore->getZrtpSecretsFile(), true)) mCore->setZrtpSecretsFile(Paths::getZrtpSecretsFilePath());// Use application path if Linphone default is not available qInfo() << "Using ZrtpSecrets path : " << QString::fromStdString(mCore->getZrtpSecretsFile()); @@ -257,6 +255,8 @@ void CoreManager::setResourcesPaths () { // ----------------------------------------------------------------------------- +#undef SET_DATABASE_PATH + void CoreManager::createLinphoneCore (const QString &configPath) { qInfo() << QStringLiteral("Launch async core creation."); diff --git a/linphone-app/src/components/sip-addresses/SipAddressesModel.cpp b/linphone-app/src/components/sip-addresses/SipAddressesModel.cpp index 934dd264f..502700bb1 100644 --- a/linphone-app/src/components/sip-addresses/SipAddressesModel.cpp +++ b/linphone-app/src/components/sip-addresses/SipAddressesModel.cpp @@ -667,10 +667,11 @@ void SipAddressesModel::initSipAddresses () { qInfo() << "Sip addresses model from Chats :" << stepsTimer.restart() << "ms."; initSipAddressesFromCalls(); qInfo() << "Sip addresses model from Calls :" << stepsTimer.restart() << "ms."; - initRefs(); - qInfo() << "Sip addresses model from Refs :" << stepsTimer.restart() << "ms."; initSipAddressesFromContacts(); qInfo() << "Sip addresses model from Contacts :" << stepsTimer.restart() << "ms."; + mRefs.clear(); + initRefs(); + qInfo() << "Sip addresses model init Refs :" << stepsTimer.restart() << "ms."; qInfo() << "Sip addresses model initialized in:" << timer.elapsed() << "ms."; } diff --git a/linphone-app/src/components/sip-addresses/SipAddressesModel.hpp b/linphone-app/src/components/sip-addresses/SipAddressesModel.hpp index 38bcc2ff0..7b152fb7c 100644 --- a/linphone-app/src/components/sip-addresses/SipAddressesModel.hpp +++ b/linphone-app/src/components/sip-addresses/SipAddressesModel.hpp @@ -172,8 +172,10 @@ private: SipAddressEntry *getSipAddressEntry (const QString &peerAddress, const std::shared_ptr& lAddress) { auto it = mPeerAddressToSipAddressEntry.find(peerAddress); - if (it == mPeerAddressToSipAddressEntry.end()) - it = mPeerAddressToSipAddressEntry.insert(peerAddress, { peerAddress, nullptr, Presence::Offline, {}, {}, DisplayNames(lAddress) }); + if (it == mPeerAddressToSipAddressEntry.end()){ + it = mPeerAddressToSipAddressEntry.insert(peerAddress, { peerAddress, nullptr, Presence::Offline, {}, {}, DisplayNames(lAddress) }); + mRefs << &(*it); + } return &(*it); } QHash mPeerAddressToSipAddressEntry;