void BrowserView::showSaveFilePickerDialog(QUrl &downloadUrl, QString &suggestedFileName)
{
+ // Get the download location.
+ QString downloadDirectory = Settings::downloadLocation();
+
+ // Resolve the system download directory if specified.
+ if (downloadDirectory == QStringLiteral("System Download Directory"))
+ downloadDirectory = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
+
// Create a save file dialog.
- QFileDialog *saveFileDialogPointer = new QFileDialog(this, i18nc("Save file dialog caption", "Save File"), QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
+ QFileDialog *saveFileDialogPointer = new QFileDialog(this, i18nc("Save file dialog caption", "Save File"), downloadDirectory);
// Tell the dialog to use a save button.
saveFileDialogPointer->setAcceptMode(QFileDialog::AcceptSave);
// Populate the file name from the download item pointer.
saveFileDialogPointer->selectFile(suggestedFileName);
- // Prevent interaction with the parent windows while the dialog is open.
+ // Prevent interaction with the parent window while the dialog is open.
saveFileDialogPointer->setWindowModality(Qt::WindowModal);
// Process the saving of the file. The save file dialog pointer must be captured directly instead of by reference or nasty crashes occur.