Description: Hard code the dictionary path on Debian.
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1092726
From: Soren Stoutner <soren@debian.org>
Forwarded: not-needed
Last-Update: 2025-01-22


--- a/src/dialogs/SettingsDialog.cpp
+++ b/src/dialogs/SettingsDialog.cpp
@@ -82,8 +82,8 @@ SettingsDialog::SettingsDialog(QWidget *
     // 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, falling back to "/usr/share/hunspell-bdic/" if the environment variable is not 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);
