Skip to content
Permalink
Browse files

More work with dev/0001-psi-fix-hunspell-cpu-usage.diff. Do not add u…

…ndetected dictionaries
  • Loading branch information...
Vitozz committed Oct 3, 2017
1 parent d2ee1ab commit 9b4a9f58f6a98abd81e7f993d31306d4ae51be33
Showing with 13 additions and 2 deletions.
  1. +13 −2 patches/dev/0001-psi-fix-hunspell-cpu-usage.diff
@@ -18,15 +18,26 @@
}

HunspellChecker::~HunspellChecker()
@@ -180,7 +178,6 @@ bool HunspellChecker::isCorrect(const QS
@@ -116,7 +114,9 @@ void HunspellChecker::getSupportedLangua
}
foreach (const QFileInfo &fi, dir.entryInfoList(QStringList() << "*.dic", QDir::Files)) {
QLocale locale(fi.baseName());
- if (locale != QLocale::c()) {
+ if (locale != QLocale::c()
+ && !locale.nativeLanguageName().isEmpty()
+ && !locale.nativeCountryName().isEmpty()) {
retHash.insert(locale.nativeLanguageName()+locale.nativeCountryName(), locale);
}
}
@@ -180,7 +180,6 @@ bool HunspellChecker::isCorrect(const QS
return true;
}
}
-
return false;
}
bool HunspellChecker::add(const QString& word)
@@ -208,3 +205,51 @@ bool HunspellChecker::writable() const
@@ -208,3 +207,51 @@ bool HunspellChecker::writable() const
{
return false;
}

0 comments on commit 9b4a9f5

Please sign in to comment.
You can’t perform that action at this time.