change html to xml in funcions names
authorJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Mon, 13 Sep 2010 09:34:13 +0000 (11:34 +0200)
committerJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Mon, 13 Sep 2010 09:34:13 +0000 (11:34 +0200)
15 files changed:
src/include/CommonDictInterface.h
src/include/translation.h
src/mdictionary/backbone/BookmarkTranslations.h
src/mdictionary/backbone/Bookmarks.cpp
src/mdictionary/backbone/Bookmarks.h
src/mdictionary/backbone/backbone.cpp
src/mdictionary/backbone/backbone.h
src/mdictionary/gui/MainWindow.cpp
src/mdictionary/gui/TranslationWidget.h
src/plugins/google/GooglePlugin.h
src/plugins/google/TranslationGoogle.cpp
src/plugins/google/TranslationGoogle.h
src/plugins/xdxf/TranslationXdxf.cpp
src/plugins/xdxf/TranslationXdxf.h
src/plugins/xdxf/xdxfplugin.h

index b9ed0bb..2c7f8b5 100644 (file)
@@ -59,7 +59,7 @@ class CommonDictInterface : public QObject, public AccentsNormalizer {
     //! returns dictionary type (xdxf, google translate, etc)
     virtual QString type() const = 0;
 
-    //! returns information about dictionary in html (name, authors, etc)
+    //! returns information about dictionary (name, authors, etc)
     virtual QString infoNote() const = 0;
 
     /*! returns DictDialog object that creates dialogs
index d6e63c8..f510bfd 100644 (file)
@@ -51,8 +51,8 @@ class Translation {
         return this->key()==translation->key();
     }
 
-    //! \return parsed raw format into html
-    virtual QString toHtml() const = 0;
+    //! \return parsed raw format into xml
+    virtual QString toXml() const = 0;
 
     //! \return whether given translation is taken from bookmarks
     virtual bool isBookmark() const {
index 61cb55e..b5344c4 100644 (file)
@@ -50,8 +50,8 @@ public:
         return _key;
     }
 
-    //! \return parsed raw format into html
-    QString toHtml() const {
+    //! \return parsed raw format into xml
+    QString toXml() const {
         if(!_key.size() || !_bookmarks)
             return "";
 
index a3a0fca..e046157 100644 (file)
@@ -68,7 +68,7 @@ void Bookmarks::add(Translation* translation) {
     cur.prepare("insert into bookmarks values (?,?,?)");
     cur.addBindValue(translation->key());
     cur.addBindValue(removeAccents(translation->key()));
-    cur.addBindValue(translation->toHtml());
+    cur.addBindValue(translation->toXml());
     cur.exec();
     db.close();
 }
index fb4ffd2..74534a5 100644 (file)
@@ -80,7 +80,7 @@ public:
     QList<Translation*> searchWordList(QString word);
 
     /*! Searches for final translation of a given word
-      \return word translation list in text format xml or html to be formatted
+      \return word translation list in text format xml to be formatted
         and displayed
       \param word word to search for
       */
index 62e1e12..4797fb6 100644 (file)
@@ -63,7 +63,7 @@ public:
     /*! \return translation text for corresponding Translation object */
     QString toHtml() const {
         QString trans;
-        trans = _tr->toHtml();
+        trans = _tr->toXml();
         return trans;
 
     }
@@ -91,8 +91,8 @@ void Backbone::init() {
    loadDicts(_configPath);
 
    connect(&_resultWatcher, SIGNAL(finished()), this, SLOT(translationReady()));
-   connect(&_htmlResultWatcher, SIGNAL(finished()), this,
-           SLOT(htmlTranslationReady()));
+   connect(&_xmlResultWatcher, SIGNAL(finished()), this,
+           SLOT(xmlTranslationReady()));
    connect(&_bookmarkWatcher, SIGNAL(finished()), this,
            SLOT(bookmarksListReady()));
    connect(&_bookmarkSearchWatcher, SIGNAL(finished()), this,
@@ -191,7 +191,7 @@ void Backbone::stopSearching() {
     foreach(CommonDictInterface* dict, _dicts.keys())
         dict->stop();
     stopped = true;
-    _innerHtmlResult.cancel();
+    _innerXmlResult.cancel();
     _innerResult.cancel();
     Q_EMIT searchCanceled();
 }
@@ -509,14 +509,14 @@ void Backbone::saveState(QSettings* set, Settings* plugSet, bool active
 
 
 
-QStringList Backbone::htmls() {
-    return _htmlResult;
+QStringList Backbone::xmls() {
+    return _xmlResult;
 }
 
 
 
-void Backbone::searchHtml(QList<Translation *> translations) {
-    _htmlResult.clear();
+void Backbone::searchXml(QList<Translation *> translations) {
+    _xmlResult.clear();
 
     QList<TranslationPtr> dummy;
     stopped = false;
@@ -533,24 +533,24 @@ void Backbone::searchHtml(QList<Translation *> translations) {
         }
     }
 
-   _innerHtmlResult = QtConcurrent::mapped(dummy,
+   _innerXmlResult = QtConcurrent::mapped(dummy,
                                             &TranslationPtr::toHtml);
-   _htmlResultWatcher.setFuture(_innerHtmlResult);
+   _xmlResultWatcher.setFuture(_innerXmlResult);
 }
 
 
 
-void Backbone::htmlTranslationReady() {
+void Backbone::xmlTranslationReady() {
 
-    QFutureIterator<QString> it(_innerHtmlResult);
+    QFutureIterator<QString> it(_innerXmlResult);
     QSet<QString> uniqe;
     while(it.hasNext())
         uniqe.insert(it.next());
-    _htmlResult.clear();
-    _htmlResult = uniqe.toList();
+    _xmlResult.clear();
+    _xmlResult = uniqe.toList();
 
     if(!stopped)
-        Q_EMIT htmlReady();
+        Q_EMIT xmlReady();
 
 }
 
index c87a2f2..a9f05c0 100644 (file)
         - GUI calls result()
 
       Final translation:
-         - GUI calls searchHtml()
-         - Backbone starts toHtml for each translation object in separate threads
-         - Backbone sets FutureWatcher to be notified after last toHtml returns
+         - GUI calls searchXml()
+         - Backbone starts toXml for each translation object in separate threads
+         - Backbone sets FutureWatcher to be notified after last toXml returns
          - Backbone fetches translation from Future<...> objects and calls
-             htmlReady()
-         - Gui calls htmlResult()
+             xmlReady()
+         - Gui calls xmlResult()
 
 */
 class Backbone : public QObject
@@ -130,8 +130,8 @@ public:
     //! \return maximum number of words that plugin could find
     int searchLimit() const;
 
-    //! \return final translation (after searching for html)
-    QStringList htmls();
+    //! \return final translation (after searching for xml)
+    QStringList xmls();
 
     /*! maximum number of translations that each plugin may return; it must be
         public static because of QtConcurent::mapped restrictions about
@@ -173,7 +173,7 @@ public Q_SLOTS:
     /*! Fired by FutureWatcher when search result is ready, fetch Future to
         final result
       */
-    void htmlTranslationReady();
+    void xmlTranslationReady();
 
     /*! Removes given dictionary
         \param dict dictionary to be deleted
@@ -183,10 +183,10 @@ public Q_SLOTS:
     /*! Saves plugins new state/configuration after each change */
     void dictUpdated();
 
-    /*! Performs search for final translation (html/xml) form
+    /*! Performs search for final translation (xml) form
       \param list of Translation* to be searched for
       */
-    void searchHtml(QList<Translation*>);
+    void searchXml(QList<Translation*>);
 
 
     /*! adds bookmarks to given translations (translation object is fetched and
@@ -260,8 +260,8 @@ Q_SIGNALS:
     //! emitted when there are search results ready to fetch
     void ready();
 
-    //! emitted when html result is ready to fetch
-    void htmlReady();
+    //! emitted when xml result is ready to fetch
+    void xmlReady();
 
     //! thrown when searches are stopped
     void searchCanceled();
@@ -286,13 +286,13 @@ private:
 
 
     QFuture<QList<Translation*> > _innerResult; //Res of concurrent word search
-    QFuture<QString> _innerHtmlResult;  // Result of html search
+    QFuture<QString> _innerXmlResult;  // Result of xml search
     QFuture<QList<Translation*> > _innerBookmarks; //Res of search in bookmarks
     QFuture<QList<Translation*> > _innerListBookmarks; //Res of search in bookmarks
-    QFuture<QStringList> _innerHtmlBookmarks; //Html result of bookmarks search
+    QFuture<QStringList> _innerXmlBookmarks; //Xml result of bookmarks search
 
     QMultiHash<QString, Translation*> _result; //Final result of word search
-    QStringList _htmlResult; // Final result of html search
+    QStringList _xmlResult; // Final result of xml search
     QList<Translation*> _bookmarksResult; // Final result of search in bookmarks
 
 
@@ -300,7 +300,7 @@ private:
     QFutureWatcher<QList<Translation*> > _resultWatcher;
     QFutureWatcher<QList<Translation*> > _bookmarkWatcher;
     QFutureWatcher<QList<Translation*> > _bookmarkSearchWatcher;
-    QFutureWatcher<QString> _htmlResultWatcher;
+    QFutureWatcher<QString> _xmlResultWatcher;
 
 
     QString _pluginPath;
index e66482d..f828473 100644 (file)
@@ -253,7 +253,7 @@ void MainWindow::translationsReady() {
         hideWelcomeScreen();
     #endif
 
-    Q_EMIT showTranslation(backbone->htmls());
+    Q_EMIT showTranslation(backbone->xmls());
     #ifdef Q_WS_MAEMO_5
         notifyManager->screenChanged();
     #endif
@@ -415,7 +415,7 @@ void MainWindow::connectBackbone() {
             backbone, SLOT(search(QString)));
 
     connect(this, SIGNAL(searchTranslations(QList<Translation*>)),
-            backbone, SLOT(searchHtml(QList<Translation*>)));
+            backbone, SLOT(searchXml(QList<Translation*>)));
 
     connect(this, SIGNAL(stopSearching()),
             backbone, SLOT(stopSearching()));
@@ -436,14 +436,14 @@ void MainWindow::connectBackbone() {
     connect(backbone, SIGNAL(ready()),
             this, SIGNAL(setIdle()));
 
-    connect(backbone, SIGNAL(htmlReady()),
+    connect(backbone, SIGNAL(xmlReady()),
             this, SIGNAL(setIdle()));
 
 
     connect(backbone, SIGNAL(ready()),
             this, SLOT(wordListReady()));
 
-    connect(backbone, SIGNAL(htmlReady()),
+    connect(backbone, SIGNAL(xmlReady()),
             this, SLOT(translationsReady()));
 
     connect(backbone, SIGNAL(searchCanceled()),
index 4e3352b..b0537d0 100644 (file)
@@ -36,7 +36,7 @@
 
 //! Displays translation of word found in dictionaries
 /*!
-    Displays many translations of word, formatted as html.
+    Displays many translations of word, formatted as xml.
 */
 class TranslationWidget : public QScrollArea {
     Q_OBJECT
index 5050c9e..c6e201f 100644 (file)
@@ -62,7 +62,7 @@ public:
     //! returns dictionary type (xdxf, google translate, etc)
     QString type() const;
 
-    //! returns information about dictionary in html (name, authors, etc)
+    //! returns information about dictionary (name, authors, etc)
     QString infoNote() const;
 
     //! sets the language to which the translation is done
index 2f5db67..2e54ea9 100644 (file)
@@ -47,7 +47,7 @@ QString TranslationGoogle::key() const{
     return _key;
 }
 
-QString TranslationGoogle::toHtml() const {
+QString TranslationGoogle::toXml() const {
     QString result("");
     if(!googlePlugin)
         return result;   
@@ -65,7 +65,7 @@ QString TranslationGoogle::toHtml() const {
     QList<Translation*> translations=googlePlugin->searchWordList(_key);
     qDebug()<<"test: "<<translations.size();
     if(translations.size()>0 && translations.at(0))
-        return translations.at(0)->toHtml();
+        return translations.at(0)->toXml();
     return "";
 
 }
index 92d036c..16d1e29 100644 (file)
@@ -42,8 +42,8 @@ public:
     //! \return word to be translated
     QString key() const;
 
-    //! \return parsed raw format into html
-    QString toHtml() const;
+    //! \return parsed raw format into xml
+    QString toXml() const;
 
     /*! sets the word for which we want to find a translation
         \param word for which we want to find a translation */
index 394ab81..fe228b5 100644 (file)
@@ -43,7 +43,7 @@ QString TranslationXdxf::key() const {
     return _key;
 }
 
-QString TranslationXdxf::toHtml() const { 
+QString TranslationXdxf::toXml() const { 
     QString result("");
     if(!xdxfPlugin)
         return result;
index 0ef545e..4b4a70e 100644 (file)
@@ -38,8 +38,8 @@ public:
     //! \return word to be translated
     QString key() const;
 
-    //! \return parsed raw format into html
-    QString toHtml() const;
+    //! \return parsed raw format into xml
+    QString toXml() const;
 
     /*! sets the word for which we want to find a translation
         \param word for which we want to find a translation */
index bd4b37c..4223c08 100644 (file)
@@ -66,7 +66,7 @@ public:
     //! returns dictionary type (xdxf, google translate, etc)
     QString type() const;
 
-    //! returns information about dictionary in html (name, authors, etc)
+    //! returns information about dictionary in xml (name, authors, etc)
     QString infoNote() const;
 
     /*! returns DictDialog object that creates dialogs