1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

SpellCheck: Fix loading dictionaries after user saves the spellcheck dialog

This commit is contained in:
David Rosca 2014-11-15 11:54:33 +01:00
parent 1e3556696c
commit d0aafd78c0

View File

@ -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;
}