]> Git trees. - libqmvoc.git/commitdiff
Fix adding vocabulary to wrong lessons when reading old documents.
authorFrederik Gladhorn <gladhorn@kde.org>
Mon, 17 Sep 2007 14:11:24 +0000 (14:11 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Mon, 17 Sep 2007 14:11:24 +0000 (14:11 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=713424

keduvocdocument/keduvocdocument.cpp
keduvocdocument/keduvockvtmlreader.cpp

index 682225db1db138ff9c89c8b35e480dc312c5e7cf..65bcc5baa159177dc051634ff317cbb4e8f0a832 100644 (file)
@@ -155,8 +155,7 @@ void KEduVocDocument::setModified( bool dirty )
 
 void KEduVocDocument::appendEntry( KEduVocExpression *expression )
 {
-    d->m_vocabulary.append( *expression );
-    setModified();
+    insertEntry(expression, d->m_vocabulary.count());
 }
 
 
index 637d3423b8e7c841cc8c4b356fcb14496cdbcf04..68c82b2baa664dc6405f88accc856bf6dfb5bd31 100644 (file)
@@ -1003,11 +1003,7 @@ bool KEduVocKvtmlReader::readExpression( QDomElement &domElementParent )
         textstr = currentElement.lastChild().toText().data();
 
         if ( i == 0 ) {
-            expr = KEduVocExpression( textstr );
-            expr.setLesson( lesson );
-
-///@todo inquery is old and no longer used. get rid of reading it.
-//             expr.setInQuery( inquery );
+            expr = KEduVocExpression( textstr, lesson );
             expr.setActive( active );
         } else {
             expr.setTranslation( i, textstr );
@@ -1077,11 +1073,6 @@ bool KEduVocKvtmlReader::readExpression( QDomElement &domElementParent )
 //     }
     m_doc->appendEntry( &expr );
 
-    // also add this entryid to the lesson it's part of
-    if ( lesson >= 0 ) {
-        m_doc->lesson( lesson ).addEntry( m_doc->entryCount() );
-    }
-
     return true;
 }