Here's the commit that broke finding the dictionaries when installed as qtwebengine_dictionaries as a child directory under the directory where the dooble binary resides.
I can't quickly see the problem, have to sleep on it. I do notice that dooble.sh, the Linux wrapper script has various export QTWEBENGINE_DICTIONARIES_PATH= added. Perhaps we should just do similar rather then getting further from upstream by reverting this commit or otherwise changing things.
From 02958934b6771efdebbb9dfdc8d77e3d7018c2c2 Mon Sep 17 00:00:00 2001
From: textbrowser <textbrowser@gmail.com>
Date: Fri, 26 Apr 2024 18:35:35 -0400
Subject: [PATCH] Improved error messages.
---
Source/dooble_settings.cc | 22 ++++++++++++++--------
dooble.sh | 4 ++++
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/Source/dooble_settings.cc b/Source/dooble_settings.cc
index a84e9f76..0ff17f49 100644
--- a/Source/dooble_settings.cc
+++ b/Source/dooble_settings.cc
@@ -2304,21 +2304,22 @@ void dooble_settings::show_panel(dooble_settings::Panels panel)
void dooble_settings::show_qtwebengine_dictionaries_warning_label(void)
{
- m_ui.qtwebengine_dictionaries_warning_label->setText
- (tr("<b>Warning!</b> "
- "The directory qtwebengine_dictionaries cannot be accessed. "
- "Dooble searched QTWEBENGINE_DICTIONARIES_PATH and the relative "
- "qtwebengine_dictionaries directories. "
- "Please read %1, line %2.").arg(__FILE__).arg(__LINE__));
m_ui.qtwebengine_dictionaries_warning_label->setVisible(false);
auto bytes(qgetenv("QTWEBENGINE_DICTIONARIES_PATH"));
if(bytes.trimmed().isEmpty())
{
- bytes = "qtwebengine_dictionaries";
+ auto directory
+ (QDir::currentPath() + QDir::separator() + "qtwebengine_dictionaries");
- if(!QFileInfo(bytes).isReadable())
+ m_ui.qtwebengine_dictionaries_warning_label->setText
+ (tr("<b>Warning!</b> "
+ "The directory qtwebengine_dictionaries cannot be accessed. "
+ "Dooble searched %1. Please read %2, line %3.").
+ arg(directory).arg(__FILE__).arg(__LINE__));
+
+ if(!QFileInfo(directory).isReadable())
{
m_ui.qtwebengine_dictionaries_warning_label->setVisible(true);
return;
@@ -2326,6 +2327,11 @@ void dooble_settings::show_qtwebengine_dictionaries_warning_label(void)
}
else if(!QFileInfo(bytes).isReadable())
{
+ m_ui.qtwebengine_dictionaries_warning_label->setText
+ (tr("<b>Warning!</b> "
+ "The directory qtwebengine_dictionaries cannot be accessed. "
+ "Dooble searched %1. Please read %2, line %3.").
+ arg(bytes.constData()).arg(__FILE__).arg(__LINE__));
m_ui.qtwebengine_dictionaries_warning_label->setVisible(true);
return;
}
diff --git a/dooble.sh b/dooble.sh
index dd7f8d02..ac5d06a8 100755
--- a/dooble.sh
+++ b/dooble.sh
@@ -28,6 +28,7 @@ export QT_X11_NO_MITSHM=1
if [ -r ./Dooble ] && [ -x ./Dooble ]
then
echo "Launching a local Dooble."
+ export QTWEBENGINE_DICTIONARIES_PATH=qtwebengine_dictionaries
if [ -r ./Lib ]
then
@@ -46,6 +47,7 @@ then
echo "Launching an official Dooble."
export DOOBLE_TRANSLATIONS_PATH=/opt/dooble/Translations
export LD_LIBRARY_PATH=/opt/dooble/Lib
+ export QTWEBENGINE_DICTIONARIES_PATH=/opt/dooble/qtwebengine_dictionaries
export QT_PLUGIN_PATH=/opt/dooble/plugins
cd /opt/dooble && exec ./Dooble "$@"
exit $?
@@ -54,6 +56,8 @@ then
echo "Launching an official Dooble."
export DOOBLE_TRANSLATIONS_PATH=/usr/local/dooble/Translations
export LD_LIBRARY_PATH=/usr/local/dooble/Lib
+ export QTWEBENGINE_DICTIONARIES_PATH=/usr/local/dooble/\
+ qtwebengine_dictionaries
export QT_PLUGIN_PATH=/usr/local/dooble/plugins
cd /usr/local/dooble && exec ./Dooble "$@"
exit $?
--
2.30.2