]> Git trees. - libqmvoc.git/commitdiff
Start a container class.
authorFrederik Gladhorn <gladhorn@kde.org>
Tue, 27 Nov 2007 18:01:18 +0000 (18:01 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Tue, 27 Nov 2007 18:01:18 +0000 (18:01 +0000)
Move lesson specific stuff out of there.
Next: Start the word type class.

svn path=/branches/work/kdeedu_parley/libkdeedu/; revision=742271

keduvocdocument/CMakeLists.txt
keduvocdocument/keduvoccontainer.cpp [new file with mode: 0644]
keduvocdocument/keduvoccontainer.h [new file with mode: 0644]
keduvocdocument/keduvoccsvreader.cpp
keduvocdocument/keduvocexpression.h
keduvocdocument/keduvockvtml2reader.cpp
keduvocdocument/keduvockvtml2writer.cpp
keduvocdocument/keduvoclesson.cpp
keduvocdocument/keduvoclesson.h
keduvocdocument/keduvocpaukerreader.cpp
keduvocdocument/tests/keduvocdocumentvalidatortest.cpp

index 966dc735a884671fb722355f87ac348226096b8d..46c3050a4ecf70741790f3a9de0e6ad8a98ddc22 100644 (file)
@@ -7,6 +7,7 @@ keduvocdocument.cpp
    keduvocidentifier.cpp
    keduvocexpression.cpp
    keduvoctranslation.cpp
+   keduvoccontainer.cpp
    keduvoclesson.cpp
    keduvocgrade.cpp
    keduvocgrammar.cpp
diff --git a/keduvocdocument/keduvoccontainer.cpp b/keduvocdocument/keduvoccontainer.cpp
new file mode 100644 (file)
index 0000000..5086fb8
--- /dev/null
@@ -0,0 +1,191 @@
+/***************************************************************************
+
+    Copyright 2007 Jeremy Whiting <jeremywhiting@scitools.com>
+    Copyright 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
+
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "keduvoccontainer.h"
+
+#include "keduvocexpression.h"
+
+#include <QList>
+
+/** private class to store information about a lesson */
+class KEduVocContainer::Private
+{
+public:
+    ~Private();
+
+    // properties for this lesson
+    QString m_name;
+    bool m_inPractice;
+
+    // other lessons in the tree
+    KEduVocContainer *m_parentContainer;
+    QList<KEduVocContainer*> m_childContainers;
+
+    EnumContainerType m_type;
+
+    /// Image url
+    KUrl m_imageUrl;
+};
+
+KEduVocContainer::Private::~ Private()
+{
+    qDeleteAll(m_childContainers);
+}
+
+KEduVocContainer::KEduVocContainer(const QString& name, EnumContainerType type, KEduVocContainer *parent)
+        : d( new Private )
+{
+    d->m_parentContainer = parent;
+    d->m_name = name;
+    d->m_inPractice = false;
+    d->m_type = type;
+}
+
+KEduVocContainer::KEduVocContainer( const KEduVocContainer &other )
+        : d( new Private )
+{
+    d->m_name = other.d->m_name;
+    d->m_inPractice = other.d->m_inPractice;
+}
+
+KEduVocContainer::~KEduVocContainer()
+{
+    delete d;
+}
+
+void KEduVocContainer::appendChildContainer(KEduVocContainer * child)
+{
+    d->m_childContainers.append(child);
+}
+
+KEduVocContainer * KEduVocContainer::childContainer(int row)
+{
+    return d->m_childContainers.value(row);
+}
+
+int KEduVocContainer::childContainerCount() const
+{
+    return d->m_childContainers.count();
+}
+
+int KEduVocContainer::row() const
+{
+    if (d->m_parentContainer) {
+        return d->m_parentContainer->d->m_childContainers.indexOf(const_cast<KEduVocContainer*>(this));
+    }
+    return 0;
+}
+
+
+KEduVocContainer& KEduVocContainer::operator= ( const KEduVocContainer &other )
+{
+    d->m_name = other.d->m_name;
+    d->m_inPractice = other.d->m_inPractice;
+    return *this;
+}
+
+bool KEduVocContainer::operator==(const KEduVocContainer &other)
+{
+    return  d->m_name == other.d->m_name &&
+            d->m_inPractice == other.d->m_inPractice;;
+}
+
+void KEduVocContainer::setName( const QString &name )
+{
+    d->m_name = name;
+}
+
+QString KEduVocContainer::name()
+{
+    return d->m_name;
+}
+
+bool KEduVocContainer::inPractice()
+{
+    return d->m_inPractice;
+}
+
+void KEduVocContainer::setInPractice(bool inPractice)
+{
+    d->m_inPractice = inPractice;
+}
+
+void KEduVocContainer::removeTranslation(int translation)
+{
+    foreach(KEduVocContainer *childContainer, d->m_childContainers) {
+        childContainer->removeTranslation(translation);
+    }
+
+    foreach(KEduVocExpression *entry, entries() ) {
+        entry->removeTranslation( translation );
+    }
+}
+
+QList< KEduVocExpression * > KEduVocContainer::entriesRecursive()
+{
+    QList< KEduVocExpression * > entryList = entries();
+    foreach(KEduVocContainer *childContainer, d->m_childContainers) {
+        foreach(KEduVocExpression *childEntry, childContainer->entriesRecursive()) {
+            if(!entryList.contains(childEntry)) {
+                entryList.append(childEntry);
+            }
+        }
+    }
+    return entryList;
+}
+
+QList< KEduVocContainer * > KEduVocContainer::childContainers()
+{
+    return d->m_childContainers;
+}
+
+KEduVocContainer * KEduVocContainer::parent()
+{
+    return d->m_parentContainer;
+}
+
+// KEduVocContainer * KEduVocContainer::childContainer(const QString & name)
+// {
+//     for(int i = 0; i<d->m_childContainers.count(); i++){
+//         if(d->m_childContainers.value(i)->name() == name) {
+//             return d->m_childContainers[i];
+//         }
+//     }
+//     return 0;
+// }
+
+void KEduVocContainer::setContainerType(KEduVocContainer::EnumContainerType type)
+{
+    d->m_type = type;
+}
+
+KEduVocContainer::EnumContainerType KEduVocContainer::containerType()
+{
+    return d->m_type;
+}
+
+
+KUrl KEduVocContainer::imageUrl()
+{
+    return d->m_imageUrl;
+}
+
+void KEduVocContainer::setImageUrl(const KUrl &url)
+{
+    d->m_imageUrl = url;
+}
+
+
diff --git a/keduvocdocument/keduvoccontainer.h b/keduvocdocument/keduvoccontainer.h
new file mode 100644 (file)
index 0000000..377bdcb
--- /dev/null
@@ -0,0 +1,128 @@
+/***************************************************************************
+
+    Copyright 2007 Jeremy Whiting <jeremywhiting@scitools.com>
+    Copyright 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
+
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef KEDUVOCCONTAINER_H
+#define KEDUVOCCONTAINER_H
+
+#include "libkeduvocdocument_export.h"
+
+#include <KDE/KUrl>
+
+#include <QtCore/QList>
+#include <QtCore/QString>
+
+class KEduVocExpression;
+
+/** class to store information about a lesson */
+class KEDUVOCDOCUMENT_EXPORT KEduVocContainer
+{
+public:
+    enum EnumContainerType{
+        LessonContainer,
+        LeitnerContainer,
+        WordTypeContainer,
+        WordTypeNounContainer,
+        WordTypeNounMaleContainer,
+        WordTypeNounFemaleContainer,
+        WordTypeNounNeutralContainer,
+        WordTypeVerbContainer,
+        WordTypeAdjectiveContainer,
+        WordTypeAdverbContainer
+    };
+
+    /** default constructor */
+    explicit KEduVocContainer(const QString& name, EnumContainerType type = LessonContainer, KEduVocContainer *parent = 0);
+
+    void appendChildContainer(KEduVocContainer *child);
+
+    QList<KEduVocContainer *> childContainers();
+
+    KEduVocContainer *childContainer(int row);
+
+    /**
+     * Find a child container
+     * @param name 
+     * @return 
+     */
+//     KEduVocContainer *childContainer(const QString& name);
+
+    int childContainerCount() const;
+
+    int row() const;
+    KEduVocContainer *parent();
+
+    /** copy constructor for d-pointer safe copying */
+    KEduVocContainer( const KEduVocContainer &other );
+
+    /** destructor */
+    ~KEduVocContainer();
+
+    /** assignment operator */
+    KEduVocContainer& operator= ( const KEduVocContainer& );
+
+    /** set the container name
+     * @param name text to set for the name
+     */
+    void setName( const QString &name );
+
+    /** get the container name */
+    QString name();
+
+    /** get a list of all entries in the container */
+    virtual QList < KEduVocExpression* > entries() =0;
+
+    /** get a list of all entries in the container and its child containers */
+    QList < KEduVocExpression* > entriesRecursive();
+
+    /**
+     * Removes a translation. This has to be called when a language is removed from a document.
+     * @param translation 
+     */
+    void removeTranslation(int translation);
+
+    bool inPractice();
+    void setInPractice( bool inPractice );
+
+    /** equality operator */
+    bool operator==(const KEduVocContainer &other);
+
+    /**
+     * The type of this container. @see EnumContainerType
+     * @return 
+     */
+    KEduVocContainer::EnumContainerType containerType();
+
+    /**
+     * Set the type of container.
+     * For convenience by default this is taken over from the parent, so no need to set.
+     * @param type the new type
+     */
+    void setContainerType(KEduVocContainer::EnumContainerType type);
+
+    /** get the image url for this container if it exists */
+    KUrl imageUrl();
+
+    /** set the image url for this container
+     * @param url               url of the image
+     */
+    void setImageUrl(const KUrl &url);
+
+private:
+    class Private;
+    Private * const d;
+};
+
+#endif
index 4afd7e530dadfcca285b3c657eb5255b0ab672d6..9ab5913508e1430d547eb6a3f8658e599dafeddd 100644 (file)
@@ -56,7 +56,7 @@ bool KEduVocCsvReader::readDoc( KEduVocDocument *doc )
     int languageCount = 0;
 
     KEduVocLesson* lesson = new KEduVocLesson( i18n("Vocabulary"), m_doc->lesson());
-    m_doc->lesson()->appendChildLesson(lesson);
+    m_doc->lesson()->appendChildContainer(lesson);
 
     while ( !inputStream.atEnd() ) {
         QString s = inputStream.readLine();
index 6781df1e2b9913bc426904ecdfaa67939fbba9ad..56762d3e5f68eb0dc661f29ce8c769e2d26b71cf 100644 (file)
@@ -116,6 +116,7 @@ private:
      */
     void addLesson( KEduVocLesson * l );
     void removeLesson( KEduVocLesson * l );
+
     friend class KEduVocLesson;
 };
 
index 0e3e8d304fd1f63e17782997f35dbc9e57eeacd9..dd685a58faec5e4a64676d1cd398f4c3cc29efde 100644 (file)
@@ -200,7 +200,7 @@ bool KEduVocKvtml2Reader::readGroups( QDomElement &domElementParent )
 
     if (defaultLesson->entryCount() > 0)
     {
-        m_doc->lesson()->appendChildLesson(defaultLesson);
+        m_doc->lesson()->appendChildContainer(defaultLesson);
     } else {
         delete defaultLesson;
     }
@@ -423,7 +423,7 @@ bool KEduVocKvtml2Reader::readLesson( KEduVocLesson* parentLesson, QDomElement &
     //<name>Lesson name</name>
     QDomElement currentElement = lessonElement.firstChildElement( KVTML_NAME );
     KEduVocLesson * lesson = new KEduVocLesson(currentElement.text(), parentLesson);
-    parentLesson->appendChildLesson( lesson );
+    parentLesson->appendChildContainer( lesson );
 
     readChildLessons( lesson, lessonElement );
 
@@ -528,7 +528,7 @@ bool KEduVocKvtml2Reader::readWordType( KEduVocLesson* parentContainer, QDomElem
         typeElement.firstChildElement( KVTML_NAME ).text();
 
     KEduVocLesson * wordTypeContainer = new KEduVocLesson(typeName, parentContainer);
-    parentContainer->appendChildLesson(wordTypeContainer);
+    parentContainer->appendChildContainer(wordTypeContainer);
 
     QString specialType = typeElement.firstChildElement( KVTML_SPECIALWORDTYPE ).text();
     if ( !specialType.isEmpty() ) {
index 43cfd20f1dd6db52fdcaf68a3e815d01afd9557b..b877b570c42031c01049c8b9c6b90467f5bf16cc 100644 (file)
@@ -169,8 +169,8 @@ bool KEduVocKvtml2Writer::writeLessons( KEduVocLesson *parentLesson, QDomElement
 {
     // iterate over child lessons.
     // the first time this is called with the root lesson which does not have a <lesson> entry.
-    for( int i = 0; i < parentLesson->childLessonCount(); i++ ) {
-        KEduVocLesson *lesson = parentLesson->childLesson(i);
+    for( int i = 0; i < parentLesson->childContainerCount(); i++ ) {
+        KEduVocLesson *lesson = static_cast<KEduVocLesson*>(parentLesson->childContainer(i));
         // make lesson element
         QDomElement thisLessonElement = m_domDoc.createElement( KVTML_CONTAINER );
 
@@ -267,7 +267,9 @@ bool KEduVocKvtml2Writer::writeArticle( QDomElement &articleElement, int article
 
 bool KEduVocKvtml2Writer::writeWordTypes( QDomElement &typesElement, KEduVocLesson* parentContainer )
 {
-    foreach( KEduVocLesson* wordType, parentContainer->childLessons() ) {
+    foreach( KEduVocContainer* container, parentContainer->childContainers() ) {
+        KEduVocLesson* wordType = static_cast<KEduVocLesson*>(container);
+
         kDebug() << "Writing type: " << wordType->name();
 
         QDomElement typeDefinitionElement = m_domDoc.createElement( KVTML_CONTAINER );
index 0742664336f1960dbe69156efb43aa9419796566..f50da4aea19ab7c6dac690b51210a4f9b680911f 100644 (file)
@@ -1,12 +1,8 @@
 /***************************************************************************
-              manage lessons
-    -----------------------------------------------------------------------
 
-    begin        : August 11, 2007
+    Copyright 2007 Jeremy Whiting <jeremywhiting@scitools.com>
+    Copyright 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
 
-    copyright    : (C) 2007 Jeremy Whiting <jeremywhiting@scitools.com>
-
-    -----------------------------------------------------------------------
  ***************************************************************************/
 
 /***************************************************************************
@@ -30,47 +26,25 @@ class KEduVocLesson::Private
 public:
     ~Private();
 
-    // properties for this lesson
-    QString m_name;
-    bool m_inPractice;
-
-    // other lessons in the tree
-    KEduVocLesson *m_parentLesson;
-    QList<KEduVocLesson*> m_childLessons;
-
     // entries
     QList<KEduVocExpression*> m_entries;
-
-    EnumContainerType m_type;
 };
 
 KEduVocLesson::Private::~ Private()
 {
-    qDeleteAll(m_childLessons);
-
     ///@todo delete children here???? is this a 1:1 mapping?
     qDeleteAll(m_entries);
 }
 
 KEduVocLesson::KEduVocLesson(const QString& name, KEduVocLesson *parent)
-        : d( new Private )
+        : d( new Private ), KEduVocContainer(name, LessonContainer, parent)
 {
-    d->m_parentLesson = parent;
-    d->m_name = name;
-    d->m_inPractice = false;
-    if(parent) {
-        d->m_type = parent->containerType();
-    } else {
-        d->m_type = LessonContainer;
-    }
 }
 
 KEduVocLesson::KEduVocLesson( const KEduVocLesson &other )
-        : d( new Private )
+        : d( new Private ), KEduVocContainer(other)
 {
     d->m_entries = other.d->m_entries;
-    d->m_name = other.d->m_name;
-    d->m_inPractice = other.d->m_inPractice;
 }
 
 KEduVocLesson::~KEduVocLesson()
@@ -78,54 +52,6 @@ KEduVocLesson::~KEduVocLesson()
     delete d;
 }
 
-void KEduVocLesson::appendChildLesson(KEduVocLesson * child)
-{
-    d->m_childLessons.append(child);
-}
-
-KEduVocLesson * KEduVocLesson::childLesson(int row)
-{
-    return d->m_childLessons.value(row);
-}
-
-int KEduVocLesson::childLessonCount() const
-{
-    return d->m_childLessons.count();
-}
-
-int KEduVocLesson::row() const
-{
-    if (d->m_parentLesson) {
-        return d->m_parentLesson->d->m_childLessons.indexOf(const_cast<KEduVocLesson*>(this));
-    }
-    return 0;
-}
-
-
-KEduVocLesson& KEduVocLesson::operator= ( const KEduVocLesson &other )
-{
-    d->m_entries = other.d->m_entries;
-    d->m_name = other.d->m_name;
-    d->m_inPractice = other.d->m_inPractice;
-    return *this;
-}
-
-bool KEduVocLesson::operator==(const KEduVocLesson &other)
-{
-    return d->m_entries == other.d->m_entries &&
-        d->m_name == other.d->m_name &&
-        d->m_inPractice == other.d->m_inPractice;;
-}
-
-void KEduVocLesson::setName( const QString &name )
-{
-    d->m_name = name;
-}
-
-QString KEduVocLesson::name()
-{
-    return d->m_name;
-}
 
 QList<KEduVocExpression*> KEduVocLesson::entries()
 {
@@ -140,9 +66,7 @@ int KEduVocLesson::entryCount()
 void KEduVocLesson::addEntry(KEduVocExpression* entry)
 {
     d->m_entries.append( entry );
-    if(d->m_type == LessonContainer) {
-        entry->addLesson(this);
-    }
+    entry->addLesson(this);
 }
 
 void KEduVocLesson::removeEntry(KEduVocExpression* entry)
@@ -151,76 +75,8 @@ void KEduVocLesson::removeEntry(KEduVocExpression* entry)
     entry->removeLesson(this);
 }
 
-
-bool KEduVocLesson::inPractice()
-{
-    return d->m_inPractice;
-}
-
-void KEduVocLesson::setInPractice(bool inPractice)
-{
-    d->m_inPractice = inPractice;
-}
-
-void KEduVocLesson::removeTranslation(int translation)
-{
-    foreach(KEduVocLesson *childLesson, d->m_childLessons) {
-        childLesson->removeTranslation(translation);
-    }
-
-    foreach(KEduVocExpression *entry, d->m_entries ) {
-        entry->removeTranslation( translation );
-    }
-}
-
-QList< KEduVocExpression * > KEduVocLesson::entriesRecursive()
-{
-    QList< KEduVocExpression * > entryList = entries();
-    foreach(KEduVocLesson *childLesson, d->m_childLessons) {
-        foreach(KEduVocExpression *childEntry, childLesson->entriesRecursive()) {
-            if(!entryList.contains(childEntry)) {
-                entryList.append(childEntry);
-            }
-        }
-    }
-    return entryList;
-}
-
-QList< KEduVocLesson * > KEduVocLesson::childLessons()
-{
-    return d->m_childLessons;
-}
-
 KEduVocExpression * KEduVocLesson::entry(int row)
 {
     return d->m_entries.value(row);
 }
 
-KEduVocLesson * KEduVocLesson::parent()
-{
-    return d->m_parentLesson;
-}
-
-KEduVocLesson * KEduVocLesson::childLesson(const QString & name)
-{
-    for(int i = 0; i<d->m_childLessons.count(); i++){
-        if(d->m_childLessons.value(i)->name() == name) {
-            return d->m_childLessons[i];
-        }
-    }
-
-    KEduVocLesson* newLesson = new KEduVocLesson(name, this);
-    appendChildLesson(newLesson);
-    return newLesson;
-}
-
-void KEduVocLesson::setContainerType(KEduVocLesson::EnumContainerType type)
-{
-    d->m_type = type;
-}
-
-KEduVocLesson::EnumContainerType KEduVocLesson::containerType()
-{
-    return d->m_type;
-}
-
index f3d2525b6fcfee212a9903d74863cd167f12122d..b9a8b262c28e53be59536d5d50e80fded2ffd2be 100644 (file)
@@ -1,12 +1,8 @@
 /***************************************************************************
-              manage lessons
-    -----------------------------------------------------------------------
 
-    begin        : August 11, 2007
+    Copyright 2007 Jeremy Whiting <jeremywhiting@scitools.com>
+    Copyright 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
 
-    copyright    : (C) 2007 Jeremy Whiting <jeremywhiting@scitools.com>
-
-    -----------------------------------------------------------------------
  ***************************************************************************/
 
 /***************************************************************************
 
 #include "libkeduvocdocument_export.h"
 
+#include "keduvoccontainer.h"
+
 #include <QtCore/QList>
 #include <QtCore/QString>
 
 class KEduVocExpression;
 
 /** class to store information about a lesson */
-class KEDUVOCDOCUMENT_EXPORT KEduVocLesson
+class KEDUVOCDOCUMENT_EXPORT KEduVocLesson :public KEduVocContainer
 {
 public:
-    enum EnumContainerType{
-        LessonContainer,
-        LeitnerContainer,
-        WordTypeContainer,
-        WordTypeNounContainer,
-        WordTypeNounMaleContainer,
-        WordTypeNounFemaleContainer,
-        WordTypeNounNeutralContainer,
-        WordTypeVerbContainer,
-        WordTypeAdjectiveContainer,
-        WordTypeAdverbContainer
-    };
-
     /** default constructor */
     explicit KEduVocLesson(const QString& name, KEduVocLesson *parent = 0);
 
-    void appendChildLesson(KEduVocLesson *child);
+//     void appendChildLesson(KEduVocLesson *child);
 
-    QList<KEduVocLesson *> childLessons();
-    KEduVocLesson *childLesson(int row);
-    /**
-     * Find a child lesson, creates a new lesson it if it does not exist!
-     * @param name 
-     * @return 
-     */
-    KEduVocLesson *childLesson(const QString& name);
-    int childLessonCount() const;
+//     QList<KEduVocLesson *> childLessons();
+//     KEduVocLesson *childLesson(int row);
+
+//     int childLessonCount() const;
 
-    int row() const;
-    KEduVocLesson *parent();
+//     int row() const;
+//     KEduVocLesson *parent();
 
     /** copy constructor for d-pointer safe copying */
     KEduVocLesson( const KEduVocLesson &other );
@@ -72,22 +52,12 @@ public:
     /** assignment operator */
     KEduVocLesson& operator= ( const KEduVocLesson& );
 
-    /** set the lesson name
-     * @param name text to set for the name
-     */
-    void setName( const QString &name );
-
-    /** get the lesson name */
-    QString name();
 
     KEduVocExpression* entry(int row);
 
     /** get a list of all entries in the lesson */
     QList < KEduVocExpression* > entries();
 
-    /** get a list of all entries in the lesson and its child lessons */
-    QList < KEduVocExpression* > entriesRecursive();
-
     /** get the number of entries in the lesson */
     int entryCount();
 
@@ -101,31 +71,6 @@ public:
      */
     void removeEntry(KEduVocExpression* entry);
 
-
-    void removeTranslation(int translation);
-
-    //void resetGrades()?
-
-    bool inPractice();
-    void setInPractice( bool inPractice );
-
-    /** equality operator */
-    bool operator==(const KEduVocLesson &other);
-
-
-    /**
-     * The type of this container. @see EnumContainerType
-     * @return 
-     */
-    KEduVocLesson::EnumContainerType containerType();
-
-    /**
-     * Set the type of container.
-     * For convenience by default this is taken over from the parent, so no need to set.
-     * @param type the new type
-     */
-    void setContainerType(KEduVocLesson::EnumContainerType type);
-
 private:
     class Private;
     Private * const d;
index 51c8ce46c46e59b971febcbd73d687088a8750d8..9f9de2493a87d12a4dc201c86792805710935b5e 100644 (file)
@@ -128,7 +128,7 @@ void KEduVocPaukerReader::readCard()
     }
 
     KEduVocLesson* lesson = new KEduVocLesson(i18n("Vocabulary"), m_doc->lesson());
-    m_doc->lesson()->appendChildLesson(lesson);
+    m_doc->lesson()->appendChildContainer(lesson);
 
     KEduVocExpression* expr = new KEduVocExpression( QStringList() << front << back);
     lesson->addEntry( expr );
index 34a64216f75e66bad8355511e10d0dd9c16176af..9494bec5b6e72d7218bb6d6449fee016137fac78 100644 (file)
@@ -85,8 +85,8 @@ void KEduVocDocumentValidatorTest::testLessons()
     QString lesson3 = QString::fromLatin1( "Lesson 3" );
 
     KEduVocDocument doc;
-    doc.lesson()->appendChildLesson(new KEduVocLesson(lesson1, doc.lesson()));
-    QCOMPARE(doc.lesson()->childLessonCount(), 1);
+    doc.lesson()->appendChildContainer(new KEduVocLesson(lesson1, doc.lesson()));
+    QCOMPARE(doc.lesson()->childContainerCount(), 1);
 
     /*
     QCOMPARE(doc.lesson(indexLesson1).name(), lesson1);