Merge branch 'cache' of ssh://drop.maemo.org/git/mdictionary into cache
[mdictionary] / trunk / src / base / gui / TranslationWidget.cpp
index f62ffda..cacfebf 100644 (file)
@@ -46,6 +46,11 @@ TranslationWidget::TranslationWidget(QWidget *parent):
     connect(textEdit, SIGNAL(search()),
            this, SLOT(searchSelected()));
 
+    QFile file(":/xsl/xsl.xsl");
+    if(!file.open(QFile::ReadOnly))
+        qDebug()<<"can't open a xslt file";
+    else
+        xslt=file.readAll();
 }
 
 
@@ -85,21 +90,13 @@ void TranslationWidget::show(QStringList translations) {
     textEdit->repaint(this->rect());
     update(this->rect());
 
-    emit updateSize();
+    Q_EMIT updateSize();
 }
 
 QString TranslationWidget::XslConversion(QString translation)
 {
     QXmlQuery myQuery(QXmlQuery::XSLT20);
     myQuery.setFocus(translation);
-
-    QFile file(":/xsl/xsl.xsl");
-    if(!file.open(QFile::ReadOnly)){
-        qDebug()<<"can't open a xslt file";
-        return translation;
-    }
-    QString xslt;
-    xslt=file.readAll();
     myQuery.setQuery(xslt);
     QString result("");
     myQuery.evaluateTo(&result);
@@ -275,7 +272,7 @@ void TranslationWidget::searchSelected() {
     #ifdef Q_WS_MAEMO_5
         hide();
     #endif
-    emit search(textEdit->textCursor().selectedText());
+    Q_EMIT search(textEdit->textCursor().selectedText());
 }
 
 #ifdef Q_WS_MAEMO_5