remove from stardict translation's tag "small" when interpret='g'
authorJakub Jaszczyński <jakub@jakub-desktop.(none)>
Fri, 5 Nov 2010 11:57:50 +0000 (12:57 +0100)
committerJakub Jaszczyński <jakub@jakub-desktop.(none)>
Fri, 5 Nov 2010 11:57:50 +0000 (12:57 +0100)
src/plugins/stardict/StarDictPlugin.cpp

index 227cc25..d6df778 100644 (file)
@@ -172,6 +172,17 @@ QString StarDictPlugin::interpret(QByteArray::iterator it,
     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){
+            qDebug()<<"przed"<<result;
+            int indexOfEndSmall= result.indexOf("</small>");
+            if(indexOfEndSmall!=-1)
+                result.remove(indexOfSmall,indexOfEndSmall-indexOfSmall+8);
+            indexOfSmall=result.indexOf("<small>");
+            qDebug()<<"po"<<result;
+        }
     }
     else if(mode == 't'){
         result += "<key>" + key + "</key>";
@@ -206,7 +217,7 @@ QString StarDictPlugin::interpret(QByteArray::iterator it,
     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)
@@ -235,6 +246,8 @@ QString StarDictPlugin::interpret(QByteArray::iterator it,
         } else
             result += read(it++, end);
     } */
+
+    qDebug()<<"wynik  "<<result;
     return result;
 }
 
@@ -288,10 +301,7 @@ CommonDictInterface* StarDictPlugin::getNew(const Settings *settings) const {
     ((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();