]> Git trees. - libqmvoc.git/commitdiff
Reset grades would now work when passed -1 (for all translations).
authorFrederik Gladhorn <gladhorn@kde.org>
Tue, 11 Dec 2007 17:20:22 +0000 (17:20 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Tue, 11 Dec 2007 17:20:22 +0000 (17:20 +0000)
BUG:153826
Thanks, Falk
:)

svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=747308

keduvocdocument/keduvocdocument.cpp
keduvocdocument/keduvocexpression.cpp

index 31e623e75a9d94e32235325d388e290e2b99480b..677663fc6c759310f7138d24b673d05fc8b91da3 100644 (file)
@@ -803,11 +803,9 @@ int KEduVocDocument::entryCount() const
 
 void KEduVocDocument::resetEntry( int index, int lesson )
 {
-    for ( int i = 0; i < d->m_vocabulary.count(); i++ )
-        if ( /*lesson == 0 ||*/ lesson == d->m_vocabulary[i].lesson() ) {
-            // index is the translation number whose grades are reset
-            d->m_vocabulary[i].resetGrades( index );
-        }
+    foreach(int entry, this->lesson(lesson).entries()) {
+        d->m_vocabulary[entry].resetGrades( index );
+    }
 }
 
 
index edf3bc1e1d18f6dd7cb2b4859b98a1590cf1be63..05655558177a60999a28ca1ae72b2364243cd4df 100644 (file)
@@ -147,8 +147,8 @@ void KEduVocExpression::setSizeHint( int sizeHint )
 void KEduVocExpression::resetGrades( int index )
 {
     if ( index == -1 ) { // clear grades for all languages
-        foreach( KEduVocTranslation trans, d->m_translations ) {
-            trans.resetGrades();
+        foreach( int trans, d->m_translations.keys() ) {
+            d->m_translations[trans].resetGrades();
         }
         return;
     }