From acd62253016aea79536ebd212841257e720f847b Mon Sep 17 00:00:00 2001 From: Jakub Jaszczynski Date: Thu, 26 Aug 2010 12:36:15 +0200 Subject: [PATCH] change googleTranslationFor() in google --- trunk/src/plugins/google/src/GooglePlugin.cpp | 3 +-- trunk/src/plugins/google/src/TranslationGoogle.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) 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) { -- 1.7.9.5