googlePlugin remove bookmark
[mdictionary] / trunk / src / plugins / google / src / GooglePlugin.cpp
index 20cb496..b07c48f 100644 (file)
@@ -139,6 +139,8 @@ Translation* GooglePlugin::getTranslationFor(QString key) {
 
 QList<Translation*> GooglePlugin::searchWordList(QString word, int limit) {
     QList<Translation*> translations;
+    word.replace("*","");
+    word.replace("?","");
     QString url = QString("/translate_a/t?client=t&sl=%1&tl=%2").arg(_langFrom,
                                                                      _langTo);
     QHttpRequestHeader head = QHttpRequestHeader("POST", url, 1,1);
@@ -157,7 +159,6 @@ QList<Translation*> GooglePlugin::searchWordList(QString word, int limit) {
 
     QString text = QString::fromUtf8(http->readAll());
     text=jsonParse(text);
-
     if(text!="") {
         text=tr("<key>") + word + tr("</key>") + tr("<t>") + text + tr("</t>");
         translations<<(new TranslationGoogle(word,text,_infoNote,this));
@@ -169,6 +170,7 @@ QString GooglePlugin::jsonParse(QString result) {
     int pos=0,pos2=0;
     int index=0;
     int size=0;
+    qDebug()<<result;
     QString returnLang;
     QString translation;
     QString original;