QTranslator *translator = new QTranslator(this);
- if(!translator->load(":/xdxf/translations/" + locale)) {
- translator->load(":/xdxf/translations/en_US");
+ if(!translator->load(":/stardict/translations/" + locale)) {
+ translator->load(":/stardict/translations/en_US");
}
QCoreApplication::installTranslator(translator);
}
int counter = 0;
int counterLimit = 0;
- while(counter < wordcount && (counterLimit<limit || limit==0)) {
+ stopped=false;
+ while(counter < wordcount && (counterLimit<limit || limit==0) && !stopped) {
counter++;
fkey = reader->readKeyword();
if(is32b)
QString StarDictPlugin::interpret(QByteArray::iterator it,
QByteArray::iterator end, QChar mode,QString key, bool last) {
QString result;
+ qDebug()<<"****** mode: "<<mode;
if(mode == 'm'){
result += "<key>" + key + "</key>";
result += QString::fromUtf8(read(it++, end));
else if(mode == 'g'){
result += "<key>" + key + "</key>";
result += QString::fromUtf8(read(it++, end));
+
+ /* delete "small" tag from translation*/
+ int indexOfSmall=result.indexOf("<small>");
+ while(indexOfSmall!=-1){
+ int indexOfEndSmall= result.indexOf("</small>");
+ if(indexOfEndSmall!=-1)
+ result.remove(indexOfSmall,indexOfEndSmall-indexOfSmall+8);
+ indexOfSmall=result.indexOf("<small>");
+ }
}
else if(mode == 't'){
result += "<key>" + key + "</key>";
else if(mode == 'r'){
result += "<key>" + key + "</key>";
result += QString::fromUtf8(read(it++, end));
- }
+ }
// Dont know whether mDictionary would ever handle binary stardict format
// to be honest dont see any kind of adventages (can't find any binary dict)
} else
result += read(it++, end);
} */
+
+ qDebug()<<"wynik "<<result;
return result;
}
void StarDictPlugin::stop() {
+ qDebug()<<"zatrzymanie programu";
stopped=true;
}
((StarDictDialog*)plugin->dictDialog())->
setLastDialogParent(_dictDialog->lastDialogParent());
-
-
if(settings && plugin->setSettings(settings)) {
-
disconnect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
this, SIGNAL(notify(Notify::NotifyType,QString)));
plugin->getDictionaryInfo();