From 594dc3110de542108054f0c3f9066b5ceefd8592 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 23 Nov 2010 12:43:39 +0100 Subject: [PATCH] fix bug (duplication of dictionarys in xdxf downloader) --- src/plugins/stardict/StarDictPlugin.cpp | 27 +++++++++++++++------------ src/plugins/xdxf/XdxfDictDownloader.cpp | 2 +- src/plugins/xdxf/xdxfplugin.cpp | 1 + 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/plugins/stardict/StarDictPlugin.cpp b/src/plugins/stardict/StarDictPlugin.cpp index e9036ef..4c78fe3 100644 --- a/src/plugins/stardict/StarDictPlugin.cpp +++ b/src/plugins/stardict/StarDictPlugin.cpp @@ -43,7 +43,10 @@ StarDictPlugin::StarDictPlugin(QObject *parent) : CommonDictInterface(parent), _icon = QIcon("/usr/share/mdictionary/stardict.png"); stopped = false; + _settings->setValue("strip_accents","true"); + initAccents(); + } @@ -124,9 +127,9 @@ QList StarDictPlugin::searchWordList(QString word, int limit) { offset = reader->readInt64BigEndian(); len = reader->readInt32BigEndian(); - if(keyword.exactMatch(fkey)) { + if(keyword.exactMatch(fkey) ) { TranslationStarDict tran(fkey, infoNote(), this); - // qDebug() << "off/len" << offset << len; + // qDebug() << "off/len" << offset << len; int id = translations.indexOf(tran); if(id == -1) { tran.add(offset, len); @@ -160,18 +163,18 @@ QByteArray StarDictPlugin::read(QByteArray::iterator it, QString StarDictPlugin::interpret(QByteArray::iterator it, - QByteArray::iterator end, QChar mode,QString key, bool last) { + QByteArray::iterator end, QChar mode,QString key, bool) { QString result; // qDebug()<<"****** mode: "<"; result += "" + QString::fromUtf8(read(it++, end)) + ""; } diff --git a/src/plugins/xdxf/XdxfDictDownloader.cpp b/src/plugins/xdxf/XdxfDictDownloader.cpp index 2e3517c..f212d71 100644 --- a/src/plugins/xdxf/XdxfDictDownloader.cpp +++ b/src/plugins/xdxf/XdxfDictDownloader.cpp @@ -161,7 +161,7 @@ void XdxfDictDownloader::dictListReceived(QNetworkReply *reply) { QRegExp regInner(".*"); regInner.setMinimal(true); int pos = 0; - + dicts.clear(); while ((pos = regInner.indexIn(page, pos)) != -1) { DownloadDict temp = DownloadDict(regInner.cap(0)); if(!temp.fromLang().isEmpty()) diff --git a/src/plugins/xdxf/xdxfplugin.cpp b/src/plugins/xdxf/xdxfplugin.cpp index d571d9e..e0ca9de 100644 --- a/src/plugins/xdxf/xdxfplugin.cpp +++ b/src/plugins/xdxf/xdxfplugin.cpp @@ -124,6 +124,7 @@ QList XdxfPlugin::searchWordListCache(QString word, int limit) { _settings->setValue("cached","false"); return searchWordListFile(word, limit); } + stopped = false; word = word.toLower(); word = word.replace("*", "%"); -- 1.7.9.5