google translation can be added to bookmark
[mdictionary] / src / plugins / google / TranslationGoogle.cpp
index f0355e7..fa6e35d 100644 (file)
@@ -53,19 +53,18 @@ QString TranslationGoogle::toXml() const {
         return result;   
     result="<dict> <info path=\"/usr/share/mdictionary/google.png\" ";
     if(isBookmark())
-        result+="bookmark=\"true\" >";
+        result+=" bookmark=\"true\" > \n";
     else
-        result+="bookmark=\"false\" >";
-
-    //qDebug()<<"trans: "<<_trans;
+        result+=" bookmark=\"false\" > \n";
 
     if(_trans!="")
         return result+=_dictionaryInfo+ "</info>"+_trans +"</dict>";
-
     QList<Translation*> translations=googlePlugin->searchWordList(_key);
-    //qDebug()<<"test: "<<translations.size();
-    if(translations.size()>0 && translations.at(0))
+    if(translations.size()>0 && translations.at(0)){
+        if(isBookmark())
+            translations.at(0)->setBookmark(true);
         return translations.at(0)->toXml();
+    }
     return "";
 
 }