From 2992bb04da2b9f72e595df21ba9e8206af7c1816 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Tue, 18 Nov 2014 08:56:23 +0100 Subject: [PATCH] Add lookup for standard location of hunspell dictionaries of Debian packages --- src/HunspellChecker.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/HunspellChecker.cpp b/src/HunspellChecker.cpp index ea4b88c5c0..67c7e27cc4 100644 --- a/src/HunspellChecker.cpp +++ b/src/HunspellChecker.cpp @@ -83,15 +83,18 @@ struct HunspellChecker::Private /// the location below system/user directory /// there the aff+dic files lookup will happen const string dictDirectory(void) const { return "dicts"; } - int maxLookupSelector(void) const { return 4; } + int maxLookupSelector(void) const { return 5; } const string HunspellDictionaryName(Language const * lang) { return lang->variety().empty() ? lang->code() : lang->code() + "-" + lang->variety(); } - const string osPackageDictDirectory(void) { + const string myspellPackageDictDirectory(void) { return "/usr/share/myspell"; } + const string hunspellPackageDictDirectory(void) { + return "/usr/share/hunspell"; + } }; @@ -150,15 +153,14 @@ bool HunspellChecker::Private::haveLanguageFiles(string const & hpath) const string HunspellChecker::Private::dictPath(int selector) { switch (selector) { + case 4: + return addName(hunspellPackageDictDirectory(),dictDirectory()); case 3: - return addName(osPackageDictDirectory(),dictDirectory()); - break; + return addName(myspellPackageDictDirectory(),dictDirectory()); case 2: return addName(package().system_support().absFileName(),dictDirectory()); - break; case 1: return addName(package().user_support().absFileName(),dictDirectory()); - break; default: return user_path_; }