mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-21 05:38:12 +00:00
Only override zrtp secrets, user certificates and root ca paths if they are empty or that the file does not exist.
This commit is contained in:
parent
a064407f53
commit
cadaec54c6
3 changed files with 17 additions and 8 deletions
|
|
@ -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.
|
||||
mCore->setZrtpSecretsFile(Paths::getZrtpSecretsFilePath());
|
||||
mCore->setUserCertificatesPath(Paths::getUserCertificatesDirPath());
|
||||
mCore->setRootCa(Paths::getRootCaFilePath());
|
||||
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 () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue