From a376ba3363dc71ca443e7da698795abcd8c8d592 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 31 Aug 2007 11:50:57 +0000 Subject: [PATCH] Somewhat write conjugations. Tags are still mixed up. Rename some QString from type to tense, as that is what it actually contains. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=706830 --- keduvocdocument/keduvocconjugation.cpp | 4 ++-- keduvocdocument/keduvockvtml2writer.cpp | 31 ++++++++++++++----------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/keduvocdocument/keduvocconjugation.cpp b/keduvocdocument/keduvocconjugation.cpp index a833c7e..2d6c0dc 100644 --- a/keduvocdocument/keduvocconjugation.cpp +++ b/keduvocdocument/keduvocconjugation.cpp @@ -65,7 +65,6 @@ KEduVocConjugation::KEduVocConjugation() KEduVocConjugation::KEduVocConjugation( const KEduVocConjugation& rhs ) : d( new Private( *rhs.d ) ) { -///@todo something's missing here!?!? } @@ -85,7 +84,8 @@ KEduVocConjugation& KEduVocConjugation::operator = ( const KEduVocConjugation& a bool KEduVocConjugation::operator == ( const KEduVocConjugation& a ) const { ///@todo conjugations: rewrite operator== - return d->m_conjugations[1].type == a.d->m_conjugations[1].type; +kDebug() <<"Implement KEduVocConjugation::operator=="; + return d->m_conjugations[0].type == a.d->m_conjugations[0].type; } diff --git a/keduvocdocument/keduvockvtml2writer.cpp b/keduvocdocument/keduvockvtml2writer.cpp index cdbd44a..75ac245 100644 --- a/keduvocdocument/keduvockvtml2writer.cpp +++ b/keduvocdocument/keduvockvtml2writer.cpp @@ -431,7 +431,8 @@ bool KEduVocKvtml2Writer::writeTranslation( QDomElement &translationElement, KEd } // conjugation - if ( translation.conjugation().entryCount() <= 0 ) { + if ( translation.conjugation().entryCount() > 0 ) { +kDebug() << "Writing conjugations: " << translation.text(); KEduVocConjugation conjugation = translation.conjugation(); for ( int i = 0; i < conjugation.entryCount(); ++i ) { QDomElement thisElement = m_domDoc.createElement( KVTML_CONJUGATION ); @@ -497,15 +498,17 @@ bool KEduVocKvtml2Writer::writeMultipleChoice( QDomElement &multipleChoiceElemen } bool KEduVocKvtml2Writer::writeConjugation( QDomElement &conjugationElement, - const KEduVocConjugation &conjugation, const QString &type ) + const KEduVocConjugation &conjugation, const QString &tense ) { + +kDebug() << tense << " first person: " << conjugation.pers1Singular( tense ); // first singular conjugations - QString first = conjugation.pers1Singular( type ); - QString second = conjugation.pers2Singular( type ); - bool third_common = conjugation.pers3SingularCommon( type ); - QString third_male = conjugation.pers3MaleSingular( type ); - QString third_female = conjugation.pers3FemaleSingular( type ); - QString third_neutral = conjugation.pers3NaturalSingular( type ); + QString first = conjugation.pers1Singular( tense ); + QString second = conjugation.pers2Singular( tense ); + bool third_common = conjugation.pers3SingularCommon( tense ); + QString third_male = conjugation.pers3MaleSingular( tense ); + QString third_female = conjugation.pers3FemaleSingular( tense ); + QString third_neutral = conjugation.pers3NaturalSingular( tense ); if ( !first.isEmpty() || !second.isEmpty() || !third_female.isEmpty() || !third_male.isEmpty() || !third_neutral.isEmpty() ) { @@ -525,12 +528,12 @@ bool KEduVocKvtml2Writer::writeConjugation( QDomElement &conjugationElement, } // now for plurals - first = conjugation.pers1Plural( type ); - second = conjugation.pers2Plural( type ); - third_common = conjugation.pers3PluralCommon( type ); - third_male = conjugation.pers3MalePlural( type ); - third_female = conjugation.pers3FemalePlural( type ); - third_neutral = conjugation.pers3NaturalPlural( type ); + first = conjugation.pers1Plural( tense ); + second = conjugation.pers2Plural( tense ); + third_common = conjugation.pers3PluralCommon( tense ); + third_male = conjugation.pers3MalePlural( tense ); + third_female = conjugation.pers3FemalePlural( tense ); + third_neutral = conjugation.pers3NaturalPlural( tense ); if ( !first.isEmpty() || !second.isEmpty() || !third_female.isEmpty() || !third_male.isEmpty() || !third_neutral.isEmpty() ) { -- 2.47.3