QRegExp keyword(word, Qt::CaseInsensitive, QRegExp::Wildcard);
int counter = 0;
- while(counter < wordcount) {
+ while(counter < wordcount && counter<limit) {
counter++;
fkey = reader->readKeyword();
if(is32b)
return "";
QByteArray raw = dictReader->readString(offset, len);
-
return format(raw, settings()->value("sametypesequence"));
}
}
QString TranslationStarDict::toXml() const {
- qDebug() << "asdf" << _dictionaryInfo;
+
QString result("");
if(!starDictPlugin)
return result;
- qDebug() << "asdf";
for(int i = 0; i < offsets.size(); i++) {
result=result + "<dict> <info path=\"/usr/share/mdictionary/stardict.png\" ";
if(isBookmark())
result+= " bookmark=\"true\" > \n";
else
result+= " bookmark=\"false\" > \n";
- qDebug() << "!!asdf";
- result+= _dictionaryInfo + "</info>" +
- starDictPlugin->search(_key, offsets.at(i), lengths.at(i))
- + "</dict>";
- qDebug() << "!!!!asdf";
+ if(_dictionaryInfo.isEmpty())
+ result+= "starDict dictionary </info>";
+ else
+ result+= _dictionaryInfo +"</info>";
+
+ /*przeformatowanie zwracanego stringu na oczekiwany format*/
+ QString text =starDictPlugin->search(_key, offsets.at(i), lengths.at(i));
+ text.replace("</k>","</key><t>");
+ text.replace("<k>","</t><key>");
+ int pos=text.indexOf("</t>");
+ if(pos!=-1)
+ text.remove(pos,4);
+
+ result+= text;
+ result+= "</t> </dict>";
+ qDebug()<<"trans"<<result;
}
- return result.replace("&","&");
+ return result;
}
void TranslationStarDict::setKey(QString _key) {