From: Jakub Jaszczynski Date: Thu, 26 Aug 2010 10:36:15 +0000 (+0200) Subject: change googleTranslationFor() in google X-Git-Tag: 0.4~2^2~8 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=acd62253016aea79536ebd212841257e720f847b;p=mdictionary change googleTranslationFor() in google --- diff --git a/trunk/src/plugins/google/src/GooglePlugin.cpp b/trunk/src/plugins/google/src/GooglePlugin.cpp index d947107..8faa307 100644 --- a/trunk/src/plugins/google/src/GooglePlugin.cpp +++ b/trunk/src/plugins/google/src/GooglePlugin.cpp @@ -149,8 +149,7 @@ void GooglePlugin::setSettings(Settings* settings) { } Translation* GooglePlugin::getTranslationFor(QString key) { - QList translations; - return translations<<(new TranslationGoogle(key,"",_infoNote,this)); + return (new TranslationGoogle(key,"",_infoNote,this)); } QList GooglePlugin::searchWordList(QString word, int limit) { diff --git a/trunk/src/plugins/google/src/TranslationGoogle.cpp b/trunk/src/plugins/google/src/TranslationGoogle.cpp index 448f8fb..4a0ea9e 100644 --- a/trunk/src/plugins/google/src/TranslationGoogle.cpp +++ b/trunk/src/plugins/google/src/TranslationGoogle.cpp @@ -56,9 +56,11 @@ QString TranslationGoogle::toHtml() const { else result+="bookmark=\"false\" >"; if(_trans!="") - result+=_dictionaryInfo+ ""+_trans +""; - return - result+=_dictionaryInfo+ ""+googlePlugin->searchWordList(_key) +""; + return result+=_dictionaryInfo+ ""+_trans +""; + + QList translations=googlePlugin->searchWordList(_key); + if(translations.size()>0) + return translations.at(0)->toHtml(); } void TranslationGoogle::setKey(QString) {