update download folder after settings created #LINQT-2402

This commit is contained in:
Gaelle Braud 2026-02-04 16:35:40 +01:00
parent c4602541f4
commit 0da2bbbadf
3 changed files with 14 additions and 7 deletions

View file

@ -647,6 +647,8 @@ void App::initCore() {
SettingsModel::create();
lDebug() << log().arg("Creating SettingsCore");
settings = SettingsCore::create();
// Update the download folder if set in the configuration file
CoreModel::getInstance()->setPathsAfterCreation();
lDebug() << log().arg("Checking downloaded codecs updates");
Utils::checkDownloadedCodecsUpdates();
lDebug() << log().arg("Setting Video Codec Priority Policy");

View file

@ -172,12 +172,17 @@ 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));
}
// 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));
// }
std::shared_ptr<linphone::Factory> factory = linphone::Factory::get();
QString downloadFolder = SettingsModel::getInstance()->getDownloadFolder();
if (downloadFolder.isEmpty()) downloadFolder = Paths::getDownloadDirPath();
if (!downloadFolder.endsWith(QDir::separator())) downloadFolder.append(QDir::separator());
SET_FACTORY_PATH(Download, (downloadFolder));
}
void CoreModel::setPathAfterStart() {

View file

@ -60,6 +60,7 @@ public:
void start();
void setConfigPath(QString path);
void setPathsAfterCreation();
void refreshOidcRemainingTime();
@ -112,7 +113,6 @@ private:
bool mCheckVersionRequestedByUser = false;
void setPathBeforeCreation();
void setPathsAfterCreation();
void setPathAfterStart();
static std::shared_ptr<CoreModel> gCoreModel;