From d0aafd78c02ddcd3ba3e016e53082b6376a5270d Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 15 Nov 2014 11:54:33 +0100 Subject: [PATCH] SpellCheck: Fix loading dictionaries after user saves the spellcheck dialog --- src/lib/plugins/qtwebkit/spellcheck/speller.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib/plugins/qtwebkit/spellcheck/speller.cpp b/src/lib/plugins/qtwebkit/spellcheck/speller.cpp index e3b059919..d39ee5407 100644 --- a/src/lib/plugins/qtwebkit/spellcheck/speller.cpp +++ b/src/lib/plugins/qtwebkit/spellcheck/speller.cpp @@ -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; }