From ceb0ccfad1a495873bd738a46529391536b14212 Mon Sep 17 00:00:00 2001 From: Jakub Jaszczynski Date: Thu, 19 Aug 2010 12:44:10 +0200 Subject: [PATCH] fixed characters coding problem --- data/dicts/eng-us.xdxf | 2 +- trunk/src/base/gui/TranslationWidget.cpp | 6 +++--- trunk/src/base/xsl.xsl | 3 ++- trunk/src/plugins/xdxf/src/xdxfplugin.cpp | 19 +++++++++++++++---- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/data/dicts/eng-us.xdxf b/data/dicts/eng-us.xdxf index c45be96..5b1a879 100644 --- a/data/dicts/eng-us.xdxf +++ b/data/dicts/eng-us.xdxf @@ -10,7 +10,7 @@ Medium Wave Airplane Aeroplane Aluminum -Aluminium to text text wiecej tekstu to text text wiecej tekstuto text text wiecej tekstuto text text wiecej tekstuto text text wiecej tekstuto text text wiecej tekstuto text text wiecej tekstuto text text wiecej tekstu +Aluminium wymowa przyklad test koloru i pogrobienia Apartment Flatlane Appetizer diff --git a/trunk/src/base/gui/TranslationWidget.cpp b/trunk/src/base/gui/TranslationWidget.cpp index f8d8e27..d7d2b5c 100644 --- a/trunk/src/base/gui/TranslationWidget.cpp +++ b/trunk/src/base/gui/TranslationWidget.cpp @@ -55,12 +55,12 @@ void TranslationWidget::show(QStringList translations) { trans += t + "\n"; } - // qDebug()<") + tr("\n ") + trans + tr("\n "); + // qDebug()<") + tr("\n ") + trans + tr("\n "); trans=XslConversion(trans); textEdit->insertHtml(trans); - // textEdit->setPlainText(trans); + // textEdit->setPlainText(trans); textEdit->repaint(this->rect()); diff --git a/trunk/src/base/xsl.xsl b/trunk/src/base/xsl.xsl index d937301..ce50c46 100644 --- a/trunk/src/base/xsl.xsl +++ b/trunk/src/base/xsl.xsl @@ -9,8 +9,9 @@ + - + diff --git a/trunk/src/plugins/xdxf/src/xdxfplugin.cpp b/trunk/src/plugins/xdxf/src/xdxfplugin.cpp index 663fafb..b4fdb5a 100644 --- a/trunk/src/plugins/xdxf/src/xdxfplugin.cpp +++ b/trunk/src/plugins/xdxf/src/xdxfplugin.cpp @@ -239,7 +239,9 @@ QString XdxfPlugin::searchFile(QString key) { temp+= reader.text().toString(); reader.readNext(); } - resultString+=tr("") + temp.replace("\n","") + tr(""); + if(temp.at(0)==QChar('\n')) + temp.remove(0,1); + resultString+=tr("") + temp + tr(""); //.replace("\n","") match=false; } this->thread()->yieldCurrentThread(); @@ -276,7 +278,7 @@ CommonDictInterface* XdxfPlugin::getNew(const Settings *settings) const { plugin->db_name = plugin->_settings->value("type") + plugin->_settings->value("path"); - // if(!plugin->db.connectionName().isEmpty() || settings->value("generateCache")=="true") + // if(!plugin->db.connectionName().isEmpty() || settings->value("generateCache")=="true") plugin->db = QSqlDatabase::addDatabase("QSQLITE", plugin->db_name); if(settings->value("cached").isEmpty() && @@ -352,7 +354,14 @@ void XdxfPlugin::getDictionaryInfo() { if(reader.name()=="description") _infoNote=reader.readElementText(); - _infoNote=""+"\n" + _name + "(" + _type + ")" + ""; + QString format = "png"; + QString initialPath = QDir::currentPath() + tr("/xdxf.") + format; +// qDebug()<"+"\n" + _name + "(" + _type + ")" + ""; + + dictionaryFile.close(); } @@ -474,7 +483,9 @@ bool XdxfPlugin::makeCache(QString dir) { temp+= reader.text().toString(); reader.readNext(); } - temp=tr("") + temp.replace("\n","") + tr(""); + if(temp.at(0)==QChar('\n')) + temp.remove(0,1); + temp=tr("") + temp+ tr(""); //.replace("\n","") match=false; cur.prepare("insert into dict values(?,?)"); cur.addBindValue(a); -- 1.7.9.5