From 5829ccc71eab2cffd5fe6ff5e1a01dda4f6d9137 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 18 Apr 2017 11:27:35 +0200 Subject: [PATCH] make sure Linphone Core paths are only set if not available --- .../src/components/core/CoreManager.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/linphone-desktop/src/components/core/CoreManager.cpp b/linphone-desktop/src/components/core/CoreManager.cpp index cceded981..f1a883880 100644 --- a/linphone-desktop/src/components/core/CoreManager.cpp +++ b/linphone-desktop/src/components/core/CoreManager.cpp @@ -92,9 +92,18 @@ void CoreManager::setDatabasesPaths () { } void CoreManager::setOtherPaths () { - mCore->setZrtpSecretsFile(Paths::getZrtpSecretsFilepath()); - mCore->setUserCertificatesPath(Paths::getUserCertificatesDirpath()); - mCore->setRootCa(Paths::getRootCaFilepath()); + if (mCore->getZrtpSecretsFile().empty()) + mCore->setZrtpSecretsFile(Paths::getZrtpSecretsFilepath()); + + // This one is actually a database but it MUST be set after the zrtp secrets + // as it allows automatic migration from old version(secrets, xml) to new version (data, sqlite). + mCore->setZrtpCacheDatabasePath(Paths::getZrtpDataFilepath()); + + if (mCore->getUserCertificatesPath().empty()) + mCore->setUserCertificatesPath(Paths::getUserCertificatesDirpath()); + + if (mCore->getRootCa().empty()) + mCore->setRootCa(Paths::getRootCaFilepath()); } void CoreManager::setResourcesPaths () {