From ab2da0f92a2e5d66bf382af6a85e306668ceeb97 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 28 Aug 2007 20:19:17 +0000 Subject: [PATCH] Added comments to the conjugation reading function in the desperate attempt to understand the functioning of the conjugation class. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=705886 --- keduvocdocument/keduvocconjugation.cpp | 37 ++++++++++++++------------ keduvocdocument/keduvocconjugation.h | 2 +- keduvocdocument/keduvocgrammar.h | 4 --- keduvocdocument/keduvockvtmlreader.cpp | 25 +++++++++++++---- 4 files changed, 41 insertions(+), 27 deletions(-) diff --git a/keduvocdocument/keduvocconjugation.cpp b/keduvocdocument/keduvocconjugation.cpp index 0cc9a8c..39ec0f2 100644 --- a/keduvocdocument/keduvocconjugation.cpp +++ b/keduvocdocument/keduvocconjugation.cpp @@ -24,6 +24,7 @@ #include "keduvocconjugation.h" #include "keduvoccommon_p.h" #include +#include class KEduVocConjugation::Private { @@ -133,23 +134,23 @@ int KEduVocConjugation::entryCount() const } -QList KEduVocConjugation::getRelation () -{ - QList vec; - - for (int i = 0; i < numInternalNames(); i++) { - vec.append(KEduVocTenseRelation(Private::names[i].abbrev, i18n(Private::names[i].name))); - } - - for (int i = 0; i < Private::userTenses.count(); i++) { - QString s; - s.setNum(i + 1); - s.prepend(UL_USER_TENSE); - vec.append(KEduVocTenseRelation(s, Private::userTenses[i])); - } - - return vec; -} +// QList KEduVocConjugation::getRelation () +// { +// QList vec; +// +// for (int i = 0; i < numInternalNames(); i++) { +// vec.append(KEduVocTenseRelation(Private::names[i].abbrev, i18n(Private::names[i].name))); +// } +// +// for (int i = 0; i < Private::userTenses.count(); i++) { +// QString s; +// s.setNum(i + 1); +// s.prepend(UL_USER_TENSE); +// vec.append(KEduVocTenseRelation(s, Private::userTenses[i])); +// } +// +// return vec; +// } void KEduVocConjugation::setTenseNames(const QStringList& names) @@ -241,6 +242,8 @@ int KEduVocConjugation::tenseCount() QString KEduVocConjugation::getType(int idx) { + +kDebug() << "KEduVocConjugation::getType()" << idx; if (idx >= d->conjugations.count()) return ""; diff --git a/keduvocdocument/keduvocconjugation.h b/keduvocdocument/keduvocconjugation.h index 957f9f9..b4490ad 100644 --- a/keduvocdocument/keduvocconjugation.h +++ b/keduvocdocument/keduvocconjugation.h @@ -80,7 +80,7 @@ public: /** * @return */ - static QList getRelation(); +// static QList getRelation(); /** * @param names diff --git a/keduvocdocument/keduvocgrammar.h b/keduvocdocument/keduvocgrammar.h index 64b8ccc..c2c7046 100644 --- a/keduvocdocument/keduvocgrammar.h +++ b/keduvocdocument/keduvocgrammar.h @@ -31,10 +31,6 @@ #include -// #define CONJ_PREFIX "--" // definition of prefixes (I, you, ..) -// -// #define UL_USER_TENSE "#" // designates number of user tense - /** * Class representing the articles of a language * diff --git a/keduvocdocument/keduvockvtmlreader.cpp b/keduvocdocument/keduvockvtmlreader.cpp index 66927e7..9afd3b9 100644 --- a/keduvocdocument/keduvockvtmlreader.cpp +++ b/keduvocdocument/keduvockvtmlreader.cpp @@ -417,21 +417,24 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, QListidentifierCount() <= count) { @@ -453,15 +456,17 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, QListtraigotraestrae + // traemostraéistraen + // until no elements are left in that soup. + + if (domElementConjugChild.tagName() == KV_CON_ENTRY) while (count + 1 > (int) curr_conjug.size() ) curr_conjug.append(KEduVocConjugation()); + // now set the data: [count] - number of conjug? + // type - the tense? + // finally the person curr_conjug[count].setPers3SingularCommon(type, s3_common); curr_conjug[count].setPers3PluralCommon(type, p3_common); curr_conjug[count].setPers1Singular(type, pers1_sing); @@ -594,7 +609,7 @@ bool KEduVocKvtmlReader::readConjug(QDomElement &domElementParent, QList next type, count++ return true; } -- 2.47.3