From: Soren Stoutner <soren@stoutner.com>
Date: Thu, 30 Jan 2025 21:42:11 +0000 (-0700)
Subject: Hardcode the dictionary path if the environment variable is not set.  https://redmine... 
X-Git-Tag: v0.8~1
X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=12678f7f9664b10ce199eeb7e51bf6628d47371c;p=PrivacyBrowserPC.git

Hardcode the dictionary path if the environment variable is not set.  https://redmine.stoutner.com/issues/1269
---

diff --git a/src/dialogs/SettingsDialog.cpp b/src/dialogs/SettingsDialog.cpp
index 701d5e2..b9f1832 100644
--- a/src/dialogs/SettingsDialog.cpp
+++ b/src/dialogs/SettingsDialog.cpp
@@ -82,8 +82,8 @@ SettingsDialog::SettingsDialog(QWidget *parentWidgetPointer, KCoreConfigSkeleton
     // 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"));
+    // Create a dictionaries QDir from the `QTWEBENGINE_DICTIONARIES_PATH` environment variable, defaulting to `/usr/share/hunspell-bdic` if no environment variable is set.
+    QDir dictionariesDir = QDir(qEnvironmentVariable("QTWEBENGINE_DICTIONARIES_PATH", QLatin1String("/usr/share/hunspell-bdic")));
 
     // Get a dictionaries string list.
     QStringList dictionariesStringList = dictionariesDir.entryList(QStringList(QLatin1String("*.bdic")), QDir::Files | QDir::NoSymLinks);