return;
if (idx <= numTranslations())
- m_translations.remove(m_translations.at(idx - 1));
+ m_translations.removeAll(m_translations.at(idx - 1));
if (idx < (int)m_remarks.size() )
- m_remarks.remove(m_remarks.at(idx - 1));
+ m_remarks.removeAll(m_remarks.at(idx - 1));
if (idx < (int)m_conjugations.size() )
- m_conjugations.remove(m_conjugations.at(idx -1));
+ m_conjugations.removeAll(m_conjugations.at(idx -1));
if (idx < (int)m_comparisons.size() )
- m_comparisons.remove(m_comparisons.at(idx - 1));
+ m_comparisons.removeAll(m_comparisons.at(idx - 1));
if (idx < (int)m_fauxAmi.size() )
- m_fauxAmi.remove(m_fauxAmi.at(idx - 1));
+ m_fauxAmi.removeAll(m_fauxAmi.at(idx - 1));
if (idx < (int)m_reverseFauxAmi.size() )
- m_reverseFauxAmi.remove(m_reverseFauxAmi.at(idx - 1));
+ m_reverseFauxAmi.removeAll(m_reverseFauxAmi.at(idx - 1));
if (idx < (int)m_synonym.size() )
- m_synonym.remove(m_synonym.at(idx - 1));
+ m_synonym.removeAll(m_synonym.at(idx - 1));
if (idx < (int)m_example.size() )
- m_example.remove(m_example.at(idx - 1));
+ m_example.removeAll(m_example.at(idx - 1));
if (idx < (int)m_usageLabels.size() )
- m_usageLabels.remove(m_usageLabels.at(idx - 1));
+ m_usageLabels.removeAll(m_usageLabels.at(idx - 1));
if (idx < (int)m_paraphrases.size() )
- m_paraphrases.remove(m_paraphrases.at(idx - 1));
+ m_paraphrases.removeAll(m_paraphrases.at(idx - 1));
if (idx < (int)m_antonym.size() )
- m_antonym.remove(m_antonym.at(idx - 1));
+ m_antonym.removeAll(m_antonym.at(idx - 1));
if (idx < (int)m_expressionTypes.size() )
- m_expressionTypes.remove(m_expressionTypes.at(idx - 1));
+ m_expressionTypes.removeAll(m_expressionTypes.at(idx - 1));
if (idx < (int)m_pronounciations.size() )
- m_pronounciations.remove(m_pronounciations.at(idx - 1));
+ m_pronounciations.removeAll(m_pronounciations.at(idx - 1));
if (idx < (int)m_grades.size() )
- m_grades.remove(m_grades.at(idx - 1));
+ m_grades.removeAll(m_grades.at(idx - 1));
if (idx < (int)m_reverseGrades.size() )
- m_reverseGrades.remove(m_reverseGrades.at(idx - 1));
+ m_reverseGrades.removeAll(m_reverseGrades.at(idx - 1));
if (idx < (int)m_queryCounts.size() )
- m_queryCounts.remove(m_queryCounts.at(idx - 1));
+ m_queryCounts.removeAll(m_queryCounts.at(idx - 1));
if (idx < (int)m_reverseQueryCounts.size() )
- m_reverseQueryCounts.remove(m_reverseQueryCounts.at(idx - 1));
+ m_reverseQueryCounts.removeAll(m_reverseQueryCounts.at(idx - 1));
if (idx < (int)m_badCounts.size() )
- m_badCounts.remove(m_badCounts.at(idx - 1));
+ m_badCounts.removeAll(m_badCounts.at(idx - 1));
if (idx < (int)m_reverseBadCounts.size() )
- m_reverseBadCounts.remove(m_reverseBadCounts.at(idx - 1));
+ m_reverseBadCounts.removeAll(m_reverseBadCounts.at(idx - 1));
if (idx < (int)m_queryDates.size() )
- m_queryDates.remove(m_queryDates.at(idx - 1));
+ m_queryDates.removeAll(m_queryDates.at(idx - 1));
if (idx < (int)m_reverseQueryDates.size() )
- m_reverseQueryDates.remove(m_reverseQueryDates.at(idx - 1));
+ m_reverseQueryDates.removeAll(m_reverseQueryDates.at(idx - 1));
}
#define KV_LEV7_GRADE 7
#define KV_LEV7_TEXT I18N_NOOP("Level 7")
-#include <q3valuelist.h>
-#include <qstringlist.h>
-#include <qdatetime.h>
+#include <QList>
+#include <QStringList>
+#include <QDateTime>
#include "keduvocgrammar.h"
#include "keduvocmultiplechoice.h"
QStringList m_example;
QStringList m_antonym;
QStringList m_pronounciations;
- Q3ValueList<grade_t> m_grades;
- Q3ValueList<grade_t> m_reverseGrades;
- Q3ValueList<count_t> m_queryCounts;
- Q3ValueList<count_t> m_reverseQueryCounts;
- Q3ValueList<count_t> m_badCounts;
- Q3ValueList<count_t> m_reverseBadCounts;
- Q3ValueList<QDateTime> m_queryDates;
- Q3ValueList<QDateTime> m_reverseQueryDates;
- Q3ValueList<KEduVocConjugation> m_conjugations;
- Q3ValueList<KEduVocComparison> m_comparisons;
- Q3ValueList<KEduVocMultipleChoice> m_multipleChoices;
+ QList<grade_t> m_grades;
+ QList<grade_t> m_reverseGrades;
+ QList<count_t> m_queryCounts;
+ QList<count_t> m_reverseQueryCounts;
+ QList<count_t> m_badCounts;
+ QList<count_t> m_reverseBadCounts;
+ QList<QDateTime> m_queryDates;
+ QList<QDateTime> m_reverseQueryDates;
+ QList<KEduVocConjugation> m_conjugations;
+ QList<KEduVocComparison> m_comparisons;
+ QList<KEduVocMultipleChoice> m_multipleChoices;
QString m_leitnerBox;
int m_lesson;
#include "keduvocgrammar.h"
#include <klocale.h>
-//Added by qt3to4:
-#include <Q3ValueList>
KEduVocConjugation::conjug_name_t
KEduVocConjugation::names [] =
ls3 = "";
}
+bool KEduVocComparison::operator ==( const KEduVocComparison& a ) const
+{
+ if ( ls1 == a.l1() && ls2 == a.l2() && ls3 == a.l3() )
+ return true;
+ else
+ return false;
+}
+
//=================================================================
//==============================================================
+bool KEduVocConjugation::operator ==( const KEduVocConjugation& a ) const
+{
+ if ( verbName == a.getVerbName() )
+ return true;
+ else
+ return false;
+}
+
+
+const QString& KEduVocConjugation::getVerbName() const
+{
+ return verbName;
+}
+
int KEduVocConjugation::numEntries() const
{
return conjugations.size();
}
-Q3ValueList<KEduVocTenseRelation> KEduVocConjugation::getRelation ()
+QList<KEduVocTenseRelation> KEduVocConjugation::getRelation ()
{
- Q3ValueList<KEduVocTenseRelation> vec;
+ QList<KEduVocTenseRelation> vec;
for (int i = 0; i < numInternalNames(); i++) {
vec.append(KEduVocTenseRelation(names[i].abbrev, i18n(names[i].name)));
&& ctp->pers3_f_plur.stripWhiteSpace().isEmpty()
&& ctp->pers3_n_plur.stripWhiteSpace().isEmpty()
)
- conjugations.erase(conjugations.at(i));
+ conjugations.removeAt( i );
}
}
#define grammarmanager_included
#include <QString>
-#include <q3valuelist.h>
+#include <QList>
#include <QStringList>
#define CONJ_SIMPLE_PRESENT "PrSi" // I live at home what you frequently do
#define UL_USER_TENSE "#" // designates number of user tense
+
+/**
+ * Class representing the articles of a language
+ * It contains all available articles of the language as QString
+ */
+
class KEduVocArticle
{
public:
+ /**
+ * The constructor without arguments
+ */
KEduVocArticle() {}
- KEduVocArticle (
- const QString &fem_def, const QString &fem_indef,
- const QString &mal_def, const QString &mal_indef,
- const QString &nat_def, const QString &nat_indef
- );
-
+ /**
+ * The constructor with arguments
+ * @param fem_def reference to a QString with the definite female article
+ * @param fem_indef reference to a QString with the indefinite female article
+ * @param mal_def reference to a QString with the definite male article
+ * @param mal_indef reference to a QString with the indefinite male article
+ * @param nat_def reference to a QString with the definite neutral article
+ * @param nat_indef reference to a QString with the indefinite neutral article
+ */
+ KEduVocArticle ( const QString &fem_def, const QString &fem_indef, const QString &mal_def, const QString &mal_indef,
+ const QString &nat_def, const QString &nat_indef );
+
+ /**
+ * Sets the female articles
+ * @param def const reference to a QString with the definite female article
+ * @param indef const reference to a QString with the indefinite female article
+ */
void setFemale (const QString &def, const QString &indef);
+
+ /**
+ * Sets the male articles
+ * @param def const reference to a QString with the definite male article
+ * @param indef const reference to a QString with the indefinite male article
+ */
void setMale (const QString &def, const QString &indef);
+
+ /**
+ * Sets the neutral articles
+ * @param def const reference to a QString with the definite neutral article
+ * @param indef const reference to a QString with the indefinite neutral article
+ */
void setNatural (const QString &def, const QString &indef);
void female (QString &def, QString &indef) const;
public:
+ /**
+ * The constructor without arguments
+ */
KEduVocComparison() {}
- KEduVocComparison (
- const QString &l1,
- const QString &l2,
- const QString &l3
- );
+ /**
+ * The constructor with arguments
+ * @param l1
+ * @param l2
+ * @param l3
+ */
+ KEduVocComparison ( const QString &l1, const QString &l2, const QString &l3 );
void setL1 (const QString &s) { ls1 = s; }
void setL2 (const QString &s) { ls2 = s; }
bool isEmpty() const;
void clear();
+ bool operator == ( const KEduVocComparison& a ) const;
+
protected:
QString ls1, ls2, ls3;
QString shortId, longId;
};
+/**
+ * The conjugation of a verb
+ */
class KEduVocConjugation
{
public:
+ /**
+ * The constructor
+ */
KEduVocConjugation () {}
+ /**
+ * @return
+ */
int numEntries() const;
- static Q3ValueList<KEduVocTenseRelation> getRelation ();
+ /**
+ * @return
+ */
+ static QList<KEduVocTenseRelation> getRelation ();
+
+ /**
+ * @param names
+ */
static void setTenseNames (QStringList names);
static QString getName (const QString &abbrev);
static int numInternalNames();
static int numTenses();
+ const QString& getVerbName() const;
+
QString getType (int index);
void setType (int index, const QString & type);
void cleanUp();
void setPers3MalePlural(const QString &type, const QString &str);
void setPers3NaturalPlural(const QString &type, const QString &str);
+ bool operator == ( const KEduVocConjugation& a ) const;
+
private:
+ QString verbName; // added to have something to compare in operator ==, assumes that there is always only one
+ // KEduVocConjugation per verb
- struct conjug_name_t {
+ struct conjug_name_t
+ {
const char *abbrev;
const char *name;
};
-struct conjug_t
-{
- conjug_t() {
- p3common = false;
- s3common = false;
- }
-
- QString type;
- bool p3common,
- s3common;
- QString pers1_sing,
- pers2_sing,
- pers3_m_sing,
- pers3_f_sing,
- pers3_n_sing,
- pers1_plur,
- pers2_plur,
- pers3_m_plur,
- pers3_f_plur,
- pers3_n_plur;
-};
+
+ struct conjug_t
+ {
+ conjug_t() {
+ p3common = false;
+ s3common = false;
+ }
+
+ QString type;
+ bool p3common,
+ s3common;
+ QString pers1_sing,
+ pers2_sing,
+ pers3_m_sing,
+ pers3_f_sing,
+ pers3_n_sing,
+ pers1_plur,
+ pers2_plur,
+ pers3_m_plur,
+ pers3_f_plur,
+ pers3_n_plur;
+ };
protected:
- typedef Q3ValueList<conjug_t> conjug_tList;
+ typedef QList<conjug_t> conjug_tList;
conjug_tList conjugations;
static conjug_name_t names [];
#include <QString>
/**
-@author Martin Pfeiffer
-*/
+ * A box in a LeitnerSystem - a LeitnerBox
+ * This box has a name and a certain number of vocabulars in it. This number changes continuosly
+ * as the vocab cards increase or decrease in box position. There is a determined order of LeitnerBoxes
+ * in a LeitnerSystem, therefore each LeitnerBox helds pointers to the LeitnerBox for wrong and correct
+ * cards of this LeitnerBox
+ * @author Martin Pfeiffer
+ */
class LeitnerBox
{
public:
+ /**
+ * The constructor
+ */
LeitnerBox();
~LeitnerBox();
- void setCorrectWordBox( LeitnerBox* ); //sets the correct word box
- void setWrongWordBox( LeitnerBox* ); //sets the wrong word box
+ /**
+ * Sets the LeitnerBox's pointer to the correct word LeitnerBox
+ * @param correctWordBox a pointer to the LeitnerBox to be set
+ */
+ void setCorrectWordBox( LeitnerBox* correctWordBox );
+
+ /**
+ * Sets the LeitnerBox's pointer to the wrong word LeitnerBox
+ * @param wrongWordBox a pointer to the LeitnerBox to be set
+ */
+ void setWrongWordBox( LeitnerBox* wrongWordBox );
void setBoxName( const QString& ); //sets the boxes name
void setVocabCount( int count );