X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fviews%2FBrowserView.cpp;fp=src%2Fviews%2FBrowserView.cpp;h=f17a237d6d33d962db9315eb3a9602504f79bddc;hp=2a23d8126ca54b80aa8afdf7747c79be853cacf0;hb=e28b208d6f953d24bd05927a16775d103714fd36;hpb=fbcbf16ba69e2049ab8b023ce3ecd5ae94392e09 diff --git a/src/views/BrowserView.cpp b/src/views/BrowserView.cpp index 2a23d81..f17a237 100644 --- a/src/views/BrowserView.cpp +++ b/src/views/BrowserView.cpp @@ -663,8 +663,15 @@ void BrowserView::showSaveDialog(QWebEngineDownloadItem *downloadItemPointer) co 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); @@ -672,7 +679,7 @@ void BrowserView::showSaveFilePickerDialog(QUrl &downloadUrl, QString &suggested // 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.