From af368b433ee9cde1e21cf796dd37c140b1c1f628 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Sun, 21 Oct 2007 19:00:37 +0000 Subject: [PATCH] clean up conjugation and add a grade to it svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=727788 --- keduvocdocument/keduvocconjugation.cpp | 31 +++++++++----------------- keduvocdocument/keduvocconjugation.h | 3 +++ 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/keduvocdocument/keduvocconjugation.cpp b/keduvocdocument/keduvocconjugation.cpp index bc1996f..e387f51 100644 --- a/keduvocdocument/keduvocconjugation.cpp +++ b/keduvocdocument/keduvocconjugation.cpp @@ -29,22 +29,11 @@ class KEduVocConjugation::Private { public: - Private(); - - bool m_thirdCommonSingular; - bool m_thirdCommonDual; - bool m_thirdCommonPlural; + KEduVocGrade m_grade; QMap m_conjugations; }; -KEduVocConjugation::Private::Private() -{ - m_thirdCommonSingular = false; - m_thirdCommonDual = false; - m_thirdCommonPlural = false; -} - KEduVocConjugation::KEduVocConjugation() : d( new Private ) {} @@ -53,9 +42,7 @@ KEduVocConjugation::KEduVocConjugation() KEduVocConjugation::KEduVocConjugation( const KEduVocConjugation& other ) : d( new Private ) { - d->m_thirdCommonSingular = other.d->m_thirdCommonSingular; - d->m_thirdCommonDual = other.d->m_thirdCommonDual; - d->m_thirdCommonPlural = other.d->m_thirdCommonPlural; + d->m_grade = other.d->m_grade; d->m_conjugations = other.d->m_conjugations; } @@ -68,9 +55,7 @@ KEduVocConjugation::~KEduVocConjugation() KEduVocConjugation& KEduVocConjugation::operator = ( const KEduVocConjugation& other ) { - d->m_thirdCommonSingular = other.d->m_thirdCommonSingular; - d->m_thirdCommonDual = other.d->m_thirdCommonDual; - d->m_thirdCommonPlural = other.d->m_thirdCommonPlural; + d->m_grade = other.d->m_grade; d->m_conjugations = other.d->m_conjugations; return *this; } @@ -78,9 +63,7 @@ KEduVocConjugation& KEduVocConjugation::operator = ( const KEduVocConjugation& o bool KEduVocConjugation::operator ==(const KEduVocConjugation& other) const { return d->m_conjugations == other.d->m_conjugations && - d->m_thirdCommonSingular == other.d->m_thirdCommonSingular && - d->m_thirdCommonDual == other.d->m_thirdCommonDual && - d->m_thirdCommonPlural == other.d->m_thirdCommonPlural; + d->m_grade == other.d->m_grade; } @@ -122,3 +105,9 @@ bool KEduVocConjugation::isEmpty() return d->m_conjugations.count() == 0; } + +KEduVocGrade & KEduVocConjugation::grade() +{ + return d->m_grade; +} + diff --git a/keduvocdocument/keduvocconjugation.h b/keduvocdocument/keduvocconjugation.h index 2fabf9f..a0f1dfb 100644 --- a/keduvocdocument/keduvocconjugation.h +++ b/keduvocdocument/keduvocconjugation.h @@ -26,6 +26,7 @@ #define KEDUVOCCONJUGATION_H #include "libkeduvocdocument_export.h" +#include "keduvocgrade.h" #include @@ -72,6 +73,8 @@ public: bool isEmpty(); + KEduVocGrade &grade(); + static int indexOf(ConjugationPerson person, ConjugationNumber number); private: -- 2.47.3