diff --git a/linphone-desktop/src/app/paths/Paths.cpp b/linphone-desktop/src/app/paths/Paths.cpp index f0f964795..1fae7ce9c 100644 --- a/linphone-desktop/src/app/paths/Paths.cpp +++ b/linphone-desktop/src/app/paths/Paths.cpp @@ -40,6 +40,7 @@ #define PATH_CALL_HISTORY_LIST "/call-history.db" #define PATH_CONFIG "/linphonerc" #define PATH_FACTORY_CONFIG "/linphonerc-factory" +#define PATH_ROOT_CA "/rootca.pem" #define PATH_FRIENDS_LIST "/friends.db" #define PATH_MESSAGE_HISTORY_LIST "/message-history.db" #define PATH_ZRTP_DATA "/zrtp-lime.db" @@ -100,50 +101,56 @@ inline string getWritableFilePath (const QString &filename) { return getReadableFilePath(filename); } -static QString getAppPackageDataDirpath () { +// ----------------------------------------------------------------------------- + +inline QString getAppPackageDataDirpath () { QDir dir(QCoreApplication::applicationDirPath()); if (dir.dirName() == "MacOS") { dir.cdUp(); dir.cd("Resources"); - } else { + } else dir.cdUp(); - } + dir.cd("share/linphone"); return dir.absolutePath(); } -static QString getAppPackageMsPluginsDirpath () { +inline QString getAppPackageMsPluginsDirpath () { QDir dir(QCoreApplication::applicationDirPath()); if (dir.dirName() == "MacOS") { dir.cdUp(); dir.cd("Resources"); - } else { + } else dir.cdUp(); - } + dir.cd(MSPLUGINS_DIR); return dir.absolutePath(); } -static QString getAppConfigFilepath () { +inline QString getAppConfigFilepath () { if (QSysInfo::productType() == "macos") return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_CONFIG; return QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + PATH_CONFIG; } -static QString getAppCallHistoryFilepath () { +inline QString getAppCallHistoryFilepath () { return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_CALL_HISTORY_LIST; } -static QString getAppFactoryConfigFilepath () { +inline QString getAppFactoryConfigFilepath () { return getAppPackageDataDirpath() + PATH_FACTORY_CONFIG; } -static QString getAppFriendsFilepath () { +inline QString getAppRootCaFilepath () { + return getAppPackageDataDirpath() + PATH_ROOT_CA; +} + +inline QString getAppFriendsFilepath () { return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_FRIENDS_LIST; } -static QString getAppMessageHistoryFilepath () { +inline QString getAppMessageHistoryFilepath () { return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_MESSAGE_HISTORY_LIST; } @@ -157,6 +164,10 @@ string Paths::getCallHistoryFilepath () { return getWritableFilePath(getAppCallHistoryFilepath()); } +string Paths::getCapturesDirpath () { + return getWritableDirectoryPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_CAPTURES); +} + string Paths::getConfigFilepath (const QString &config_path) { if (!config_path.isEmpty()) return getWritableFilePath(QFileInfo(config_path).absoluteFilePath()); @@ -188,12 +199,16 @@ string Paths::getPackageMsPluginsDirpath () { return getReadableDirectoryPath(getAppPackageMsPluginsDirpath()); } +string Paths::getRootCaFilepath () { + return getReadableFilePath(getAppRootCaFilepath()); +} + string Paths::getThumbnailsDirpath () { return getWritableDirectoryPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_THUMBNAILS); } -string Paths::getCapturesDirpath () { - return getWritableDirectoryPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_CAPTURES); +string Paths::getUserCertificatesDirpath () { + return getWritableDirectoryPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_USER_CERTIFICATES); } string Paths::getZrtpDataFilepath () { @@ -204,10 +219,6 @@ string Paths::getZrtpSecretsFilepath () { return getWritableFilePath(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + PATH_ZRTP_SECRETS); } -string Paths::getUserCertificatesDirpath () { - return getWritableDirectoryPath(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + PATH_USER_CERTIFICATES); -} - // ----------------------------------------------------------------------------- static void migrateFile (const QString &old_path, const QString &new_path) { diff --git a/linphone-desktop/src/app/paths/Paths.hpp b/linphone-desktop/src/app/paths/Paths.hpp index d6df9f495..d0fe09e5c 100644 --- a/linphone-desktop/src/app/paths/Paths.hpp +++ b/linphone-desktop/src/app/paths/Paths.hpp @@ -31,19 +31,18 @@ namespace Paths { std::string getAvatarsDirpath (); - std::string getCapturesDirpath (); - std::string getLogsDirpath (); - std::string getThumbnailsDirpath (); - std::string getUserCertificatesDirpath (); - - std::string getPackageDataDirpath (); - std::string getPackageMsPluginsDirpath (); - std::string getCallHistoryFilepath (); + std::string getCapturesDirpath (); std::string getConfigFilepath (const QString &config_path = QString()); std::string getFactoryConfigFilepath (); std::string getFriendsListFilepath (); + std::string getLogsDirpath (); std::string getMessageHistoryFilepath (); + std::string getPackageDataDirpath (); + std::string getPackageMsPluginsDirpath (); + std::string getRootCaFilepath (); + std::string getThumbnailsDirpath (); + std::string getUserCertificatesDirpath (); std::string getZrtpDataFilepath (); std::string getZrtpSecretsFilepath (); diff --git a/linphone-desktop/src/components/contacts/ContactsListProxyModel.cpp b/linphone-desktop/src/components/contacts/ContactsListProxyModel.cpp index 51fbe4a10..689f27acc 100644 --- a/linphone-desktop/src/components/contacts/ContactsListProxyModel.cpp +++ b/linphone-desktop/src/components/contacts/ContactsListProxyModel.cpp @@ -146,6 +146,6 @@ float ContactsListProxyModel::computeContactWeight (const ContactModel *contact) void ContactsListProxyModel::setConnectedFilter (bool use_connected_filter) { if (use_connected_filter != m_use_connected_filter) { m_use_connected_filter = use_connected_filter; - invalidateFilter(); + invalidate(); } } diff --git a/linphone-desktop/src/components/core/CoreManager.cpp b/linphone-desktop/src/components/core/CoreManager.cpp index 55c29e343..484a13efc 100644 --- a/linphone-desktop/src/components/core/CoreManager.cpp +++ b/linphone-desktop/src/components/core/CoreManager.cpp @@ -99,6 +99,8 @@ void CoreManager::setOtherPaths () { m_core->setZrtpCacheDatabasePath(Paths::getZrtpDataFilepath()); m_core->setUserCertificatesPath(Paths::getUserCertificatesDirpath()); + + m_core->setRootCa(Paths::getRootCaFilepath()); } void CoreManager::setResourcesPaths () {