From 48ce7c4aeb156fb9aea788ce0a16ee7c5f102d26 Mon Sep 17 00:00:00 2001 From: Jakub Jaszczynski Date: Mon, 30 Aug 2010 15:41:17 +0200 Subject: [PATCH] clear and add "tr" --- trunk/src/plugins/google/src/GooglePlugin.cpp | 2 +- .../plugins/google/src/GoogleSettingsDialog.cpp | 4 +- trunk/src/plugins/xdxf/src/xdxfplugin.cpp | 56 ++++++++++---------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/trunk/src/plugins/google/src/GooglePlugin.cpp b/trunk/src/plugins/google/src/GooglePlugin.cpp index d05b1cc..ff2228b 100644 --- a/trunk/src/plugins/google/src/GooglePlugin.cpp +++ b/trunk/src/plugins/google/src/GooglePlugin.cpp @@ -28,7 +28,7 @@ #include "GoogleDictDialog.h" GooglePlugin::GooglePlugin(QObject *parent): CommonDictInterface(parent), - _name(tr("")),_infoNote(tr("")) { + _name(""),_infoNote("") { _settings = new Settings(); _settings->setValue("lang_to",""); _settings->setValue("lang_from",""); diff --git a/trunk/src/plugins/google/src/GoogleSettingsDialog.cpp b/trunk/src/plugins/google/src/GoogleSettingsDialog.cpp index 80b2d53..640937d 100644 --- a/trunk/src/plugins/google/src/GoogleSettingsDialog.cpp +++ b/trunk/src/plugins/google/src/GoogleSettingsDialog.cpp @@ -55,8 +55,8 @@ GoogleSettingsDialog::GoogleSettingsDialog(QWidget *parent, QIcon::fromTheme("object-flip-vertical"),tr("")); #endif - langFromLabel = new QLabel("From:"); - langToLabel = new QLabel(" To: "); + langFromLabel = new QLabel(tr("From:")); + langToLabel = new QLabel(tr(" To: ")); connectInfoLabel = new QLabel(tr("Google plugin make use of internet " "conection, so it may cost You.")); diff --git a/trunk/src/plugins/xdxf/src/xdxfplugin.cpp b/trunk/src/plugins/xdxf/src/xdxfplugin.cpp index a59363b..d814594 100644 --- a/trunk/src/plugins/xdxf/src/xdxfplugin.cpp +++ b/trunk/src/plugins/xdxf/src/xdxfplugin.cpp @@ -93,9 +93,9 @@ QList XdxfPlugin::searchWordListCache(QString word, int limit) { db.setDatabaseName(cacheFilePath); if(!db.open()) { qDebug() << "Database error" << db.lastError().text() << endl; - Q_EMIT notify(Notify::Warning, QString("Cache database cannot be " + Q_EMIT notify(Notify::Warning, QString(tr("Cache database cannot be " "opened for %1 dictionary. Searching in xdxf file. " - "You may want to recache.").arg(name())); + "You may want to recache.").arg(name()))); return searchWordListFile(word, limit); } @@ -149,7 +149,7 @@ QList XdxfPlugin::searchWordListFile(QString word, int limit) { if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) { qDebug()<<"Error: could not open file"; Q_EMIT notify(Notify::Warning, - QString("Xdxf file cannot be read for %1").arg(name())); + QString(tr("Xdxf file cannot be read for %1").arg(name()))); return translations.toList(); } @@ -203,9 +203,9 @@ QString XdxfPlugin::searchCache(QString key) { if(!db.open()) { qDebug() << "Database error" << db.lastError().text() << endl; - Q_EMIT notify(Notify::Warning, QString("Cache database cannot be " + Q_EMIT notify(Notify::Warning, QString(tr("Cache database cannot be " "opened for %1 dictionary. Searching in xdxf file. " - "You may want to recache.").arg(name())); + "You may want to recache.").arg(name()))); return searchFile(key); } @@ -228,7 +228,7 @@ QString XdxfPlugin::searchFile(QString key) { QString resultString(""); if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) { Q_EMIT notify(Notify::Warning, - QString("Xdxf file cannot be read for %1").arg(name())); + QString(tr("Xdxf file cannot be read for %1").arg(name()))); qDebug()<<"Error: could not open file"; return ""; } @@ -251,15 +251,15 @@ QString XdxfPlugin::searchFile(QString key) { while(reader.name()!="ar" && !reader.atEnd()) { if(reader.name()!="" && reader.name()!="k") { if(reader.tokenType()==QXmlStreamReader::EndElement) - temp+=tr(""); + temp= temp + " c=\"" + reader.attributes(). + value("c").toString() + "\""; + temp+=">"; } temp+= reader.text().toString().replace("<","<"). replace(">",">"); @@ -267,8 +267,8 @@ QString XdxfPlugin::searchFile(QString key) { } if(temp.at(0)==QChar('\n')) temp.remove(0,1); - resultString+=tr("") + a +tr(""); - resultString+=tr("") + temp + tr(""); + resultString+="" + a +""; + resultString+="" + temp + ""; match=false; } this->thread()->yieldCurrentThread(); @@ -383,7 +383,7 @@ void XdxfPlugin::getDictionaryInfo() { QFile dictionaryFile(path); if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) { Q_EMIT notify(Notify::Warning, - QString("Xdxf file cannot be read dictionary")); + QString(tr("Xdxf file cannot be read dictionary"))); qDebug()<<"Error: could not open file"; return; } @@ -404,7 +404,7 @@ void XdxfPlugin::getDictionaryInfo() { _infoNote=reader.readElementText(); QString format = "png"; - QString initialPath = QDir::currentPath() + tr("/xdxf.") + format; + QString initialPath = QDir::currentPath() + "/xdxf." + format; _infoNote="path=\""+initialPath+"\"> \n" + _name + " [" + _langFrom + "-" + _langTo + "] (" + _type + ")"; dictionaryFile.close(); @@ -423,8 +423,8 @@ int XdxfPlugin::countWords() { QFile dictionaryFile(path); if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) { Q_EMIT notify(Notify::Warning, - QString("Xdxf file cannot be read for %1 dictionary") - .arg(name())); + QString(tr("Xdxf file cannot be read for %1 dictionary") + .arg(name()))); qDebug()<<"Error: could not open file"; return -1; } @@ -459,8 +459,8 @@ bool XdxfPlugin::makeCache(QString) { if (!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) { Q_EMIT updateCachingProgress(100, 0); Q_EMIT notify(Notify::Warning, - QString("Xdxf file cannot be read for %1 dictionary") - .arg(name())); + QString(tr("Xdxf file cannot be read for %1 dictionary") + .arg(name()))); return 0; } QXmlStreamReader reader(&dictionaryFile); @@ -470,9 +470,9 @@ bool XdxfPlugin::makeCache(QString) { if(!db.open()) { qDebug() << "Database error" << db.lastError().text() << endl; Q_EMIT updateCachingProgress(100, 0); - Q_EMIT notify(Notify::Warning, QString("Cache database cannot be " + Q_EMIT notify(Notify::Warning, QString(tr("Cache database cannot be " "opened for %1 dictionary. Searching in xdxf file. " - "You may want to recache.").arg(name())); + "You may want to recache.").arg(name()))); return false; } QCoreApplication::processEvents(); @@ -480,7 +480,7 @@ bool XdxfPlugin::makeCache(QString) { cur.exec("PRAGMA synchronous = 0"); cur.exec("drop table dict"); QCoreApplication::processEvents(); - cur.exec("create table dict(word text, normalized text ,translation text)"); + cur.exec("create table dict(word text, normalized text ,tanslation text)"); int counter = 0; cur.exec("BEGIN;"); @@ -513,20 +513,20 @@ bool XdxfPlugin::makeCache(QString) { while(reader.name()!="ar" && !reader.atEnd()) { if(reader.name()!="" && reader.name()!="k") { if(reader.tokenType()==QXmlStreamReader::EndElement) - temp+=tr(""); + temp= temp + " c=\"" + reader.attributes().value("c").toString() + "\""; + temp+=">"; } temp+= reader.text().toString().replace("<","<").replace(">",">");; reader.readNext(); } if(temp.at(0)==QChar('\n')) temp.remove(0,1); - temp=tr("") + a + tr("") + tr("") + temp+ tr(""); + temp="" + a + "" + "" + temp+ ""; match=false; cur.prepare("insert into dict values(?,?,?)"); cur.addBindValue(a); @@ -554,7 +554,7 @@ bool XdxfPlugin::makeCache(QString) { { Q_EMIT updateCachingProgress(100, timer.restart()); Q_EMIT notify(Notify::Warning, - QString("Database caching error, please try againg.")); + QString(tr("Database caching error, please try againg."))); db.close(); return false; } -- 1.7.9.5