From 97c141d6a86d706007e2928e1ff3ebeafe372b90 Mon Sep 17 00:00:00 2001 From: Jeremy Paul Whiting Date: Tue, 28 Aug 2007 02:06:55 +0000 Subject: [PATCH] change translation class translation method to text() svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=705484 --- keduvocdocument/keduvoccsvwriter.cpp | 2 +- keduvocdocument/keduvocdocument.cpp | 16 +++++++++------- keduvocdocument/keduvockvtml2reader.cpp | 2 +- keduvocdocument/keduvockvtml2writer.cpp | 7 ++----- keduvocdocument/keduvockvtmlwriter.cpp | 4 ++-- keduvocdocument/keduvoctranslation.cpp | 4 ++-- keduvocdocument/keduvoctranslation.h | 5 +++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keduvocdocument/keduvoccsvwriter.cpp b/keduvocdocument/keduvoccsvwriter.cpp index ccfff0c..3f7a08d 100644 --- a/keduvocdocument/keduvoccsvwriter.cpp +++ b/keduvocdocument/keduvoccsvwriter.cpp @@ -63,7 +63,7 @@ bool KEduVocCsvWriter::writeDoc(KEduVocDocument *doc, const QString &generator) else currentRow += separator; - currentRow += expression->translation(i).translation(); + currentRow += expression->translation(i).text(); } if (!currentRow.isEmpty()) diff --git a/keduvocdocument/keduvocdocument.cpp b/keduvocdocument/keduvocdocument.cpp index 92cd842..2d3c9f8 100644 --- a/keduvocdocument/keduvocdocument.cpp +++ b/keduvocdocument/keduvocdocument.cpp @@ -1223,11 +1223,11 @@ int KEduVocDocument::search(const QString &substr, int id, int first, int last, for (int i = first; i < last; i++) { if (word_start) { - if (entry(i)->translation(id).translation().indexOf(substr, 0, Qt::CaseInsensitive) == 0) // case insensitive + if (entry(i)->translation(id).text().indexOf(substr, 0, Qt::CaseInsensitive) == 0) // case insensitive return i; } else { - if (entry(i)->translation(id).translation().indexOf(substr, 0, Qt::CaseInsensitive) > -1) // case insensitive + if (entry(i)->translation(id).text().indexOf(substr, 0, Qt::CaseInsensitive) > -1) // case insensitive return i; } @@ -1265,8 +1265,8 @@ public: int cmp; foreach (int i, exp->translationIndices()) { - s1 = exp->translation(i).translation(); - s2 = y.exp->translation(i).translation(); + s1 = exp->translation(i).text(); + s2 = y.exp->translation(i).text(); cmp = QString::compare(s1.toUpper(), s2.toUpper() ); if (cmp != 0) return cmp < 0; @@ -1287,8 +1287,9 @@ int KEduVocDocument::cleanUp() ExpRefList shadow; QList to_delete; - for (int i = 0; i < d->m_vocabulary.count(); i++) + for (int i = 0; i < d->m_vocabulary.count(); i++) { shadow.append(ExpRef (entry(i), i)); + } qStableSort(shadow.begin(), shadow.end()); int ent_no = 0; @@ -1301,12 +1302,13 @@ int KEduVocDocument::cleanUp() kve2 = shadow[i - 1].exp; ent_no++; - if (ent_percent != 0 && (ent_no % ent_percent) == 0 ) + if (ent_percent != 0 && (ent_no % ent_percent) == 0 ) { emit progressChanged(this, (int)((ent_no / f_ent_percent) / 2.0)); + } bool equal = true; for (int l = 0; equal && l < identifierCount(); l++ ) { - if (kve1->translation(l).translation() != kve2->translation(l).translation()) { + if (kve1->translation(l).text() != kve2->translation(l).text()) { equal = false; } } diff --git a/keduvocdocument/keduvockvtml2reader.cpp b/keduvocdocument/keduvockvtml2reader.cpp index 85ccbc4..2aa5230 100644 --- a/keduvocdocument/keduvockvtml2reader.cpp +++ b/keduvocdocument/keduvockvtml2reader.cpp @@ -368,7 +368,7 @@ bool KEduVocKvtml2Reader::readTranslation(QDomElement &translationElement, QDomElement currentElement = translationElement.firstChildElement(KVTML_TEXT); if (!currentElement.isNull()) { - expr.translation(index).setTranslation(currentElement.text()); + expr.translation(index).setText(currentElement.text()); } currentElement = translationElement.firstChildElement(KVTML_COMMENT); diff --git a/keduvocdocument/keduvockvtml2writer.cpp b/keduvocdocument/keduvockvtml2writer.cpp index ba1d621..3736459 100644 --- a/keduvocdocument/keduvockvtml2writer.cpp +++ b/keduvocdocument/keduvockvtml2writer.cpp @@ -600,7 +600,7 @@ bool KEduVocKvtml2Writer::writeEntries(QDomElement &entriesElement) bool KEduVocKvtml2Writer::writeTranslation(QDomElement &translationElement, KEduVocTranslation &translation) { // Kniebeugen - translationElement.appendChild(newTextElement(KVTML_TEXT, translation.translation())); + translationElement.appendChild(newTextElement(KVTML_TEXT, translation.text())); // if (!translation.type().isEmpty()) @@ -617,10 +617,7 @@ bool KEduVocKvtml2Writer::writeTranslation(QDomElement &translationElement, KEdu } // - if (!translation.comment().isEmpty()) - { - translationElement.appendChild(newTextElement(KVTML_COMMENT, translation.comment())); - } + translationElement.appendChild(newTextElement(KVTML_COMMENT, translation.comment())); // if (!translation.pronunciation().isEmpty()) diff --git a/keduvocdocument/keduvockvtmlwriter.cpp b/keduvocdocument/keduvockvtmlwriter.cpp index ac09d14..7a13c5d 100644 --- a/keduvocdocument/keduvockvtmlwriter.cpp +++ b/keduvocdocument/keduvockvtmlwriter.cpp @@ -189,7 +189,7 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator return false; } - QDomText domTextOriginal = domDoc.createTextNode(entry->translation(0).translation()); + QDomText domTextOriginal = domDoc.createTextNode(entry->translation(0).text()); domElementOriginal.appendChild(domTextOriginal); domElementExpression.appendChild(domElementOriginal); @@ -285,7 +285,7 @@ bool KEduVocKvtmlWriter::writeDoc(KEduVocDocument *doc, const QString &generator return false; } - QDomText domTextTranslation = domDoc.createTextNode(entry->translation(trans).translation()); + QDomText domTextTranslation = domDoc.createTextNode(entry->translation(trans).text()); domElementTranslation.appendChild(domTextTranslation); domElementExpression.appendChild(domElementTranslation); diff --git a/keduvocdocument/keduvoctranslation.cpp b/keduvocdocument/keduvoctranslation.cpp index c9c9f60..67b2a09 100644 --- a/keduvocdocument/keduvoctranslation.cpp +++ b/keduvocdocument/keduvoctranslation.cpp @@ -133,13 +133,13 @@ KEduVocTranslation::~KEduVocTranslation() delete d; } -QString KEduVocTranslation::translation ( ) const +QString KEduVocTranslation::text ( ) const { return d->m_translation; } -void KEduVocTranslation::setTranslation ( const QString & expr ) +void KEduVocTranslation::setText ( const QString & expr ) { d->m_translation = expr.simplified(); } diff --git a/keduvocdocument/keduvoctranslation.h b/keduvocdocument/keduvoctranslation.h index b19704e..921ee7d 100644 --- a/keduvocdocument/keduvoctranslation.h +++ b/keduvocdocument/keduvoctranslation.h @@ -55,12 +55,13 @@ public: * The translation as string (the word itself) * @return the translation */ - QString translation () const; + QString text () const; + /** * Sets the translation * @param expr */ - void setTranslation ( const QString & expr ); + void setText ( const QString & expr ); /** sets the pronunciation of this expression -- 2.47.3