mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Import old deprecated friends.db
This commit is contained in:
parent
e79af38bb2
commit
30b8134016
5 changed files with 17 additions and 0 deletions
|
|
@ -154,6 +154,10 @@ static inline QString getAppFactoryConfigFilePath() {
|
|||
return getAppPackageDataDirPath() + Constants::PathFactoryConfig;
|
||||
}
|
||||
|
||||
static inline QString getAppFriendsFilePath() {
|
||||
return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + Constants::PathFriendsList;
|
||||
}
|
||||
|
||||
static inline QString getAppRootCaFilePath() {
|
||||
QString rootca = getAppPackageDataDirPath() + Constants::PathRootCa;
|
||||
if (Paths::filePathExists(rootca)) { // Packaged
|
||||
|
|
@ -244,6 +248,10 @@ QString Paths::getFactoryConfigFilePath() {
|
|||
return getReadableFilePath(getAppFactoryConfigFilePath());
|
||||
}
|
||||
|
||||
QString Paths::getFriendsListFilePath() {
|
||||
return getReadableFilePath(getAppFriendsFilePath());
|
||||
}
|
||||
|
||||
QString Paths::getDownloadDirPath() {
|
||||
return getWritableDirPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + QDir::separator());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ QString getConfigFilePath(const QString &configPath = QString(), bool writable =
|
|||
QString getDatabaseFilePath();
|
||||
QString getDownloadDirPath();
|
||||
QString getFactoryConfigFilePath();
|
||||
QString getFriendsListFilePath();
|
||||
QString getLimeDatabasePath();
|
||||
QString getLogsDirPath();
|
||||
QString getMessageHistoryFilePath();
|
||||
|
|
|
|||
|
|
@ -160,6 +160,12 @@ void CoreModel::setPathBeforeCreation() {
|
|||
}
|
||||
|
||||
void CoreModel::setPathsAfterCreation() {
|
||||
auto friendsPath = Paths::getFriendsListFilePath();
|
||||
if (!friendsPath.isEmpty() && QFileInfo(friendsPath).exists()) {
|
||||
lInfo() << log().arg("Using old friends database at %1").arg(friendsPath);
|
||||
std::shared_ptr<linphone::Config> config = mCore->getConfig();
|
||||
config->setString("storage", "friends_db_uri", Utils::appStringToCoreString(friendsPath));
|
||||
}
|
||||
}
|
||||
|
||||
void CoreModel::setPathAfterStart() {
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ constexpr char Constants::PathCallHistoryList[];
|
|||
constexpr char Constants::PathConfig[];
|
||||
constexpr char Constants::PathDatabase[];
|
||||
constexpr char Constants::PathFactoryConfig[];
|
||||
constexpr char Constants::PathFriendsList[];
|
||||
constexpr char Constants::PathRootCa[];
|
||||
constexpr char Constants::PathLimeDatabase[];
|
||||
constexpr char Constants::PathMessageHistoryList[];
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ public:
|
|||
static constexpr char PathConfig[] = "/linphonerc";
|
||||
static constexpr char PathDatabase[] = "/linphone.db";
|
||||
static constexpr char PathFactoryConfig[] = "/" EXECUTABLE_NAME "/linphonerc-factory";
|
||||
static constexpr char PathFriendsList[] = "/friends.db";
|
||||
static constexpr char PathRootCa[] = "/" EXECUTABLE_NAME "/rootca.pem";
|
||||
static constexpr char PathLimeDatabase[] = "/x3dh.c25519.sqlite3";
|
||||
static constexpr char PathMessageHistoryList[] = "/message-history.db";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue