]> Git trees. - libqmvoc.git/commitdiff
not only pretend to read grades but do it ;)
authorFrederik Gladhorn <gladhorn@kde.org>
Sun, 2 Mar 2008 21:08:56 +0000 (21:08 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Sun, 2 Mar 2008 21:08:56 +0000 (21:08 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=781433

keduvocdocument/keduvockvtml2reader.h
keduvocdocument/keduvoctext.cpp

index b5140fd3a3a901c6f3e49a10cb39bceb4532e07e..75be924033064d2252a5a46b2e2bc4007f06a91a 100644 (file)
@@ -131,13 +131,6 @@ private:
      */
     bool readMultipleChoice( QDomElement &multipleChoiceElement, KEduVocTranslation* translation );
 
-    /** read a grade
-     * @param gradeElement element to read from
-     * @param expr expression element to add grades to
-     * @param index index of the current translation
-     */
-    bool readGrade( QDomElement &gradeElement, KEduVocExpression *expr, int index );
-
     /**
      * Read <lesson> tags.
      * @param parentLesson 
index 6a4f4105384ca800b0b0c53e5f8042712dda1268..1c60a1cadf84520170c78fe62d9c0955244b40f7 100644 (file)
@@ -14,6 +14,8 @@
 #include "keduvoctext.h"
 #include "kvtml2defs.h"
 #include "keduvockvtml2writer.h"
+
+#include <KDE/KDebug>
 #include <QtXml/QDomDocument>
 
 class KEduVocText::KEduVocTextPrivate
@@ -205,16 +207,16 @@ void KEduVocText::fromKVTML2(QDomElement & parent)
     setText( parent.firstChildElement( KVTML_TEXT ).text() );
 
     // grade element
-    parent.firstChildElement() = parent.firstChildElement( KVTML_GRADE );
-    if ( !parent.firstChildElement().isNull() ) {
+    const QDomElement& gradeElement = parent.firstChildElement( KVTML_GRADE );
+    if ( !gradeElement.isNull() ) {
 
-        setGrade( parent.firstChildElement(KVTML_CURRENTGRADE).text().toInt() );
+        setGrade( gradeElement.firstChildElement(KVTML_CURRENTGRADE).text().toInt() );
 
-        setPracticeCount( parent.firstChildElement(KVTML_COUNT).text().toInt() );
+        setPracticeCount( gradeElement.firstChildElement(KVTML_COUNT).text().toInt() );
 
-        setBadCount( parent.firstChildElement(KVTML_ERRORCOUNT).text().toInt() );
+        setBadCount( gradeElement.firstChildElement(KVTML_ERRORCOUNT).text().toInt() );
 
-        QString dateString = parent.firstChildElement(KVTML_DATE).text();
+        QString dateString = gradeElement.firstChildElement(KVTML_DATE).text();
         if ( !dateString.isEmpty() ) {
             QDateTime value = QDateTime::fromString( dateString, Qt::ISODate );
             setPracticeDate( value );