]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/windows/BrowserWindow.cpp
Add option to auto update the download directory. https://redmine.stoutner.com/issue...
[PrivacyBrowserPC.git] / src / windows / BrowserWindow.cpp
index 394340bb9ba56c996e9b2f90c4bcc159cf1e287a..1513d1af30e7eb31ccd3435ff22a1524cd6a8867 100644 (file)
@@ -1446,28 +1446,29 @@ void BrowserWindow::showCookiesDialog()
     connect(cookiesDialogPointer, SIGNAL(deleteCookie(QNetworkCookie)), tabWidgetPointer, SLOT(deleteCookieFromStore(QNetworkCookie)));
 }
 
-void BrowserWindow::showDownloadLocationBrowseDialog() const
+void BrowserWindow::showDownloadDirectoryBrowseDialog() const
 {
-    // Get the current download location.
-    QString currentDownloadLocation = downloadLocationComboBoxPointer->currentText();
+    // Get the current download directory.
+    QString currentDownloadDirectory = downloadDirectoryComboBoxPointer->currentText();
 
     // Resolve the system download directory if specified.
-    if (currentDownloadLocation == QStringLiteral("System Download Directory"))
-        currentDownloadLocation = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
+    if (currentDownloadDirectory == QStringLiteral("System Download Directory"))
+        currentDownloadDirectory = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
 
-    // Get the new download location.
-    QString newDownloadLocation = QFileDialog::getExistingDirectory(configDialogPointer, i18nc("Select download location dialog caption", "Select Download Location"), currentDownloadLocation);
+    // Get the new download directory.
+    QString newDownloadDirectory = QFileDialog::getExistingDirectory(configDialogPointer, i18nc("Select download directory dialog caption", "Select Download Directory"),
+                                                                     currentDownloadDirectory);
 
-    // Populate the download location combo box according to the new download location.
-    if (newDownloadLocation == QStandardPaths::writableLocation(QStandardPaths::DownloadLocation))  // The default download location was selected.
+    // Populate the download directory combo box according to the new download location.
+    if (newDownloadDirectory == QStandardPaths::writableLocation(QStandardPaths::DownloadLocation))  // The default download location was selected.
     {
         // Populate the download location with the default text.
-        downloadLocationComboBoxPointer->setCurrentText("System Download Directory");
+        downloadDirectoryComboBoxPointer->setCurrentText("System Download Directory");
     }
-    else if (newDownloadLocation != QStringLiteral(""))  // A different directory was selected.
+    else if (newDownloadDirectory != QStringLiteral(""))  // A different directory was selected.
     {
         // Populate the download location.
-        downloadLocationComboBoxPointer->setCurrentText(newDownloadLocation);
+        downloadDirectoryComboBoxPointer->setCurrentText(newDownloadDirectory);
     }
 }
 
@@ -1542,7 +1543,7 @@ void BrowserWindow::showSettingsDialog()
     userAgentLabelPointer = privacySettingsUi.userAgentLabel;
     QComboBox *searchEngineComboBoxPointer = generalSettingsUi.kcfg_searchEngine;
     searchEngineLabelPointer = generalSettingsUi.searchEngineLabel;
-    downloadLocationComboBoxPointer = generalSettingsUi.kcfg_downloadLocation;
+    downloadDirectoryComboBoxPointer = generalSettingsUi.kcfg_downloadDirectory;
     QPushButton *browseButtonPointer = generalSettingsUi.browseButton;
     QListWidget *spellCheckListWidgetPointer = spellCheckSettingsUi.spellCheckListWidget;
 
@@ -1554,8 +1555,8 @@ void BrowserWindow::showSettingsDialog()
     connect(userAgentComboBoxPointer, SIGNAL(currentTextChanged(const QString)), this, SLOT(updateUserAgentLabel(const QString)));
     connect(searchEngineComboBoxPointer, SIGNAL(currentTextChanged(const QString)), this, SLOT(updateSearchEngineLabel(const QString)));
 
-    // Connect the download location directory browse button.
-    connect(browseButtonPointer, SIGNAL(clicked()), this, SLOT(showDownloadLocationBrowseDialog()));
+    // Connect the download directory directory browse button.
+    connect(browseButtonPointer, SIGNAL(clicked()), this, SLOT(showDownloadDirectoryBrowseDialog()));
 
     // Create a dictionaries QDir from the `QTWEBENGINE_DICTIONARIES_PATH` environment variable.
     QDir dictionariesDir = QDir(qEnvironmentVariable("QTWEBENGINE_DICTIONARIES_PATH"));