mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
update download folder after settings created #LINQT-2402
This commit is contained in:
parent
c4602541f4
commit
0da2bbbadf
3 changed files with 14 additions and 7 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue