mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
SpellCheck: Fix loading dictionaries after user saves the spellcheck dialog
This commit is contained in:
parent
1e3556696c
commit
d0aafd78c0
@ -81,7 +81,7 @@ void Speller::initialize()
|
||||
return;
|
||||
}
|
||||
|
||||
QString dictionary = m_dictionaryPath + m_language.code;
|
||||
QString dictionary = m_dictionaryPath + QLatin1Char('/') + m_language.code;
|
||||
|
||||
if (!dictionaryExists(dictionary)) {
|
||||
qWarning() << "SpellCheck: Dictionaries for" << dictionary << "doesn't exists!";
|
||||
@ -392,16 +392,12 @@ bool Speller::dictionaryExists(const QString &path) const
|
||||
QString Speller::getDictionaryPath() const
|
||||
{
|
||||
#ifdef Q_OS_UNIX
|
||||
const QString defaultDicPath = "/usr/share/hunspell/";
|
||||
const QString defaultDicPath = "/usr/share/hunspell";
|
||||
#else
|
||||
const QString defaultDicPath = DataPaths::path(DataPaths::AppData) + "/hunspell/";
|
||||
const QString defaultDicPath = DataPaths::path(DataPaths::AppData) + "/hunspell";
|
||||
#endif
|
||||
|
||||
QString dicPath = QString::fromLocal8Bit(qgetenv("DICPATH")).trimmed();
|
||||
if (!dicPath.isEmpty() && !dicPath.endsWith(QLatin1Char('/'))) {
|
||||
dicPath.append(QLatin1Char('/'));
|
||||
}
|
||||
|
||||
const QString dicPath = QString::fromLocal8Bit(qgetenv("DICPATH")).trimmed();
|
||||
return dicPath.isEmpty() ? defaultDicPath : dicPath;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user