Commit cadaec54 authored by Ghislain MARY's avatar Ghislain MARY

Only override zrtp secrets, user certificates and root ca paths if they are...

Only override zrtp secrets, user certificates and root ca paths if they are empty or that the file does not exist.
parent a064407f
......@@ -64,10 +64,6 @@ inline bool filePathExists (const QString &path) {
return file.exists();
}
inline bool filePathExists (const string &path) {
return filePathExists(Utils::linphoneStringToQString(path));
}
inline void ensureDirPathExists (const QString &path) {
QDir dir(path);
if (!dir.exists() && !dir.mkpath(path))
......@@ -160,6 +156,12 @@ inline QString getAppMessageHistoryFilePath () {
// -----------------------------------------------------------------------------
bool Paths::filePathExists (const string &path) {
return filePathExists(Utils::linphoneStringToQString(path));
}
// -----------------------------------------------------------------------------
string Paths::getAssistantConfigDirPath () {
return getReadableDirPath(getAppAssistantConfigDirPath());
}
......
......@@ -30,6 +30,8 @@
// =============================================================================
namespace Paths {
bool filePathExists (const std::string &path);
std::string getAssistantConfigDirPath ();
std::string getAvatarsDirPath ();
std::string getCallHistoryFilePath ();
......
......@@ -103,10 +103,15 @@ void CoreManager::setDatabasesPaths () {
}
void CoreManager::setOtherPaths () {
// Force paths. Ask me why if it's a problem for you.
if (mCore->getZrtpSecretsFile().empty() || !Paths::filePathExists(mCore->getZrtpSecretsFile())) {
mCore->setZrtpSecretsFile(Paths::getZrtpSecretsFilePath());
}
if (mCore->getUserCertificatesPath().empty() || !Paths::filePathExists(mCore->getUserCertificatesPath())) {
mCore->setUserCertificatesPath(Paths::getUserCertificatesDirPath());
}
if (mCore->getRootCa().empty() || !Paths::filePathExists(mCore->getRootCa())) {
mCore->setRootCa(Paths::getRootCaFilePath());
}
}
void CoreManager::setResourcesPaths () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment