summaryrefslogtreecommitdiffstats
path: root/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
diff options
context:
space:
mode:
authorcraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-06-07 20:01:10 +0000
committercraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-06-07 20:01:10 +0000
commit1ae91cf9fdb1dc8292404bf2d6c58384f0557eda (patch)
tree93f0ed17416cd4e6aca7803f3a7efbffb476b317 /scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
parent1b786f099b838cf42237bf7b18b9615f858673b3 (diff)
downloadscribus-1ae91cf9fdb1dc8292404bf2d6c58384f0557eda.tar.gz
scribus-1ae91cf9fdb1dc8292404bf2d6c58384f0557eda.tar.xz
scribus-1ae91cf9fdb1dc8292404bf2d6c58384f0557eda.zip
Add in dictionary downloader code, updates to downloader threading and add in GUI to hyphenator preferences for downloading
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17542 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp')
-rw-r--r--scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp40
1 files changed, 6 insertions, 34 deletions
diff --git a/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp b/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
index be5cfda..2ff9493 100644
--- a/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
+++ b/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
@@ -32,7 +32,7 @@ for which a new license (GPL+exception) is in place.
HunspellPluginImpl::HunspellPluginImpl() : QObject(0)
{
//hspellers=NULL;
- numDicts=0;
+// numDicts=0;
m_runningForSE=false;
m_SE=NULL;
}
@@ -45,7 +45,7 @@ HunspellPluginImpl::~HunspellPluginImpl()
h = NULL;
}
hspellerMap.clear();
- numDicts = 0;
+// numDicts = 0;
}
bool HunspellPluginImpl::run(const QString & target, ScribusDoc* doc)
@@ -62,45 +62,17 @@ bool HunspellPluginImpl::run(const QString & target, ScribusDoc* doc)
return spellCheckOk;
}
-bool HunspellPluginImpl::findDictionaries()
-{
- dictionaryPaths=ScPaths::instance().spellDirs();
- if (dictionaryPaths.count()==0)
- return false;
- return true;
-}
-
bool HunspellPluginImpl::initHunspell()
{
- bool dictPathFound=findDictionaries();
+ bool dictPathFound=LanguageManager::instance()->findDictionaries(dictionaryPaths);
if (!dictPathFound)
{
qDebug()<<"No preinstalled dictonary paths found";
return false;
}
- for (int i=0; i<dictionaryPaths.count(); ++i)
- {
- // Find the dic and aff files in the location
- QDir dictLocation(dictionaryPaths.at(i));
- QStringList dictFilters("*.dic");
- QStringList dictList(dictLocation.entryList(dictFilters, QDir::Files, QDir::Name));
- dictList.replaceInStrings(".dic","");
-
- //Ensure we have aff+dic file pairs, remove any hyphenation dictionaries from the list
- QString dictName;
- foreach(dictName, dictList)
- {
- if (!QFile::exists(dictionaryPaths.at(i)+dictName+".aff"))
- dictList.removeAll(dictName);
- else
- {
- if (!dictionaryMap.contains(dictName))
- dictionaryMap.insert(dictName, dictionaryPaths.at(i)+dictName);
- }
- }
- qDebug()<<"Number of dictionaries/AFFs found in"<<dictionaryPaths.at(i)<<":"<<dictList.count();
- }
- numDicts=dictionaryMap.count();
+ dictionaryMap.clear();
+ LanguageManager::instance()->findDictionarySets(dictionaryPaths, dictionaryMap);
+// numDicts=dictionaryMap.count();
if (dictionaryMap.count()==0)
return false;