https://bugs.kde.org/show_bug.cgi?id=521504
Bug ID: 521504
Summary: The Sonnet Hunspell backend ignores Hunspell's
configured personal dictionary location and instead
hardcodes the legacy path ~/.hunspell_.
Classification: Frameworks and Libraries
Product: frameworks-sonnet
Version First 6.27.0
Reported In:
Platform: CachyOS
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
DESCRIPTION
Sonnet's Hunspell backend ignores Hunspell's configured personal dictionary
location (WORDLIST) and instead hardcodes the users personal dictionary to
~/.hunspell_<lang>. This creates a non-compliant disconnect between the active
Hunspell configuration and Sonnet's spelling support of KDE apps.
STEPS TO REPRODUCE
1) Move an existing Hunspell personal dictionary (flat-file):
~/.hunspell_en_US
to:
~/.config/hunspell/.hunspell_en_US
2) Configure a systemd host's user XDG compliant path variable:
${HOME}/.config/environment.d/hunspelldict.conf
with:
WORDLIST=$HOME/.config/hunspell/.hunspell_en_US
3) Reload the systemd user's config:
systemctl --user daemon-reload
4) Logout of KDE to SDDM, and then log back in
OBSERVED RESULT
1) Verify that the 'hunspell' CLI is correctly using the relocated dictionary
with one of the added unique words from that dict
echo "MyUniqueWord" | hunspell
Hunspell 1.7.3
*
2) Start Kate, spell check for that same unique word, it won't be found and
displays as a misspelling
3) Choose Kate's "Add to Dictionary" for that new word
4) Kate/Sonnet recreates a new empty ~/.hunspell_en_US file, and adds just that
one word
EXPECTED RESULT
If "WORDLIST=$HOME/.config/hunspell/.hunspell_en_US" is present in the XDG
environment - Eg: ${HOME}/.config/environment.d/*.conf, the Sonnet Hunspell
backend would honor and use the WORDLIST based path/dict (when defined),
matching Hunspell's configured personal dictionary location.
SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1
Hunspell Version: 1.7.3
ADDITIONAL INFORMATION
The current Hunspell backend appears to construct the personal dictionary path
directly using:
QDir::home().filePath(".hunspell_" + lang)
which bypasses Hunspell's WORDLIST configuration.
For backward compatibility:
If "WORDLIST" is defined, use that path. Otherwise continue using the current
~/.hunspell_ fallback.
Eg:
const QByteArray wordlist = qgetenv("WORDLIST");
if (!wordlist.isEmpty()) {
userDic = QFile::decodeName(wordlist);
} else {
userDic = QDir::home().filePath(".hunspell_" + lang);
}
This type of approach would preserve existing behavior while making Sonnet
interoperable with the host/users active configured Hunspell installation(s).
--
You are receiving this mail because:
You are watching all bug changes.