Commit 625521e1 authored by Isa's avatar Isa Committed by Andreas Traczyk

ux: set default download folder if not user-selected

Change-Id: If48532c1293de43ffb78113f53dc5a0e0befb3ac
parent 62b08ac1
......@@ -287,8 +287,10 @@ MainWindow::readSettingsFromRegistry()
QSettings settings;
restoreGeometry(settings.value(SettingsKey::geometry).toByteArray());
restoreState(settings.value(SettingsKey::windowState).toByteArray());
LRCInstance::editableDataTransferModel()->downloadDirectory = settings.
value(SettingsKey::downloadPath, "Downloads").toString().toStdString() + "/";
LRCInstance::editableDataTransferModel()->downloadDirectory = settings.value(SettingsKey::downloadPath,
QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).toString().toStdString() + "/";
if (not settings.contains(SettingsKey::enableNotifications)) {
settings.setValue(SettingsKey::enableNotifications, true);
}
......
......@@ -284,10 +284,8 @@ PrivateBridging::acceptFile(const QString& arg)
auto convUid = LRCInstance::getSelectedConvUid();
LRCInstance::getCurrentConversationModel()->getTransferInfo(interactionUid, info);
auto downloadsFolder = QSettings().value(SettingsKey::downloadPath, "Downloads").toString().toStdString() + "/";
// get full path
std::string filename = downloadsFolder.c_str();
std::string filename = LRCInstance::dataTransferModel().downloadDirectory.c_str();
if (!filename.empty() && filename.back() != '/')
filename += "/";
auto wantedFilename = filename + info.displayName;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment