]> Git trees. - libqmvoc.git/commitdiff
cleanup conjugation class and kvtml2reader conjugations
authorFrederik Gladhorn <gladhorn@kde.org>
Sat, 1 Sep 2007 13:50:12 +0000 (13:50 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Sat, 1 Sep 2007 13:50:12 +0000 (13:50 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=707302

keduvocdocument/keduvocconjugation.cpp
keduvocdocument/keduvocconjugation.h
keduvocdocument/keduvockvtml2reader.cpp

index d834017ff7a960960b7f4794aeea90c8a7df366b..66f7889d5207e5d127c7ca8ad2a1a7b5b418073c 100644 (file)
@@ -106,6 +106,8 @@ QString KEduVocConjugation::getType( int idx )
 }
 
 
+
+
 bool KEduVocConjugation::pers3SingularCommon( const QString &type ) const
 {
     return d->m_conjugations.value(type).s3common;
@@ -266,4 +268,9 @@ bool KEduVocConjugation::Private::conjug_t::operator ==(const conjug_t & other)
         pers3_n_plur == other.pers3_n_plur;
 }
 
+QStringList KEduVocConjugation::tenses() const
+{
+    return d->m_conjugations.keys();
+}
+
 
index b3f887d5128b682b67cd80d418a5512eee1c649a..ed7dc049f47a8d27bb22eafd9ea5ed5d7025444b 100644 (file)
 #define CONJ_PREFIX            "--"   // definition of prefixes (I, you, ..)
 
 
-class KEDUVOCDOCUMENT_EXPORT KEduVocTenseRelation
-{
-public:
-    /** default constructor */
-    KEduVocTenseRelation();
-    KEduVocTenseRelation( const QString & _short, const QString & _long );
-
-    /** default destructor, deletes the d-pointer */
-    ~KEduVocTenseRelation();
-
-    QString shortStr() const;
-    QString longStr()  const;
-
-    KEduVocTenseRelation &operator= ( const KEduVocTenseRelation &other );
-
-private:
-    class Private;
-    Private * const d;
-};
-
-
 /**
  * The conjugation of a verb
  */
@@ -73,6 +52,7 @@ public:
     int entryCount() const;
 
     QString getType( int index );
+    QStringList tenses() const;
 
     QString pers1Singular( const QString &type ) const;
     QString pers2Singular( const QString &type ) const;
index 0392ce3ef1345d2d5f98c9fdb29da6a4ad3f6b4b..902525ba25d63f9a6f20f35385f7f466e7e847bb 100644 (file)
@@ -550,18 +550,18 @@ bool KEduVocKvtml2Reader::readConjugation( QDomElement &conjugElement, KEduVocCo
  <conjugation>
   <tense>Futurepastperfekt:)</tense>
   <singular>
-    <first person></first person>
-    <second person></second person>
-    <third person>
+    <firstperson></firstperson>
+    <secondperson></secondperson>
+    <thirdperson>
       <male></male>
       <female></female>
       <neutral></neutral>
-    </third person>
+    </thirdperson>
   </singular>
   <plural>
-    <first person></first person>
-    <second person></second person>
-    <third person>
+    <firstperson></firstperson>
+    <secondperson></secondperson>
+    <thirdsperson>
       <common></common>
     </third person>
   </plural>
@@ -584,19 +584,14 @@ bool KEduVocKvtml2Reader::readConjugation( QDomElement &conjugElement, KEduVocCo
 
     QDomElement tenseElement = conjugElement.firstChildElement( KVTML_TENSE );
     tense = tenseElement.text();
-kDebug() << "Reading conjugation for tense: " << tense;
     QDomElement currentGroup = conjugElement.firstChildElement( KVTML_SINGULAR );
     if ( !currentGroup.isNull() )
     {
         QDomElement currentElement = currentGroup.firstChildElement( KVTML_1STPERSON );
-        if ( !currentElement.isNull() ) {
-            singfirst = currentElement.text();
-        }
+        singfirst = currentElement.text();
 
         currentElement = currentGroup.firstChildElement( KVTML_2NDPERSON );
-        if ( !currentElement.isNull() ) {
-            singsecond = currentElement.text();
-        }
+        singsecond = currentElement.text();
 
         currentGroup = currentGroup.firstChildElement( KVTML_3RDPERSON );
         if ( !currentGroup.isNull() ) {
@@ -604,26 +599,17 @@ kDebug() << "Reading conjugation for tense: " << tense;
             if ( !currentElement.isNull() ) {
                 s3_common = true;
                 singthirdmale = currentElement.text();
-kDebug() << " Reading common: " << tense << " first sing: " << singfirst << " sing third: " << singthirdmale;
                 singthirdfemale = singthirdmale;
                 singthirdneutral = singthirdmale;
             } else {
                 s3_common = false;
                 currentElement = currentGroup.firstChildElement( KVTML_MALE );
-                if ( !currentElement.isNull() ) {
-                    singthirdmale = currentElement.text();
-                }
-kDebug() << " Reading NOT common: " << tense << " first sing: " << singfirst << " sing third: " << singthirdmale;
+                singthirdmale = currentElement.text();
 
                 currentElement = currentGroup.firstChildElement( KVTML_FEMALE );
-                if ( !currentElement.isNull() ) {
-                    singthirdfemale = currentElement.text();
-                }
-
+                singthirdfemale = currentElement.text();
                 currentElement = currentGroup.firstChildElement( KVTML_NEUTRAL );
-                if ( !currentElement.isNull() ) {
-                    singthirdneutral = currentElement.text();
-                }
+                singthirdneutral = currentElement.text();
             }
 
         }
@@ -633,14 +619,10 @@ kDebug() << " Reading NOT common: " << tense << " first sing: " << singfirst <<
     if ( !currentGroup.isNull() )
     {
         QDomElement currentElement = currentGroup.firstChildElement( KVTML_1STPERSON );
-        if ( !currentElement.isNull() ) {
-            plurfirst = currentElement.text();
-        }
+        plurfirst = currentElement.text();
 
         currentElement = currentGroup.firstChildElement( KVTML_2NDPERSON );
-        if ( !currentElement.isNull() ) {
-            plursecond = currentElement.text();
-        }
+        plursecond = currentElement.text();
 
         currentGroup = currentGroup.firstChildElement( KVTML_3RDPERSON );
         if ( !currentGroup.isNull() ) {
@@ -653,19 +635,11 @@ kDebug() << " Reading NOT common: " << tense << " first sing: " << singfirst <<
             } else {
                 p3_common = false;
                 currentElement = currentGroup.firstChildElement( KVTML_MALE );
-                if ( !currentElement.isNull() ) {
-                    plurthirdmale = currentElement.text();
-                }
-
+                plurthirdmale = currentElement.text();
                 currentElement = currentGroup.firstChildElement( KVTML_FEMALE );
-                if ( !currentElement.isNull() ) {
-                    plurthirdfemale = currentElement.text();
-                }
-
+                plurthirdfemale = currentElement.text();
                 currentElement = currentGroup.firstChildElement( KVTML_NEUTRAL );
-                if ( !currentElement.isNull() ) {
-                    plurthirdneutral = currentElement.text();
-                }
+                plurthirdneutral = currentElement.text();
             }
 
         }