From: Frederik Gladhorn Date: Tue, 11 Dec 2007 17:20:22 +0000 (+0000) Subject: Reset grades would now work when passed -1 (for all translations). X-Git-Tag: v4.0.0~1 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=d5bd10d39a68304020f890f7cabd13e7e71f3623;p=libqmvoc.git Reset grades would now work when passed -1 (for all translations). BUG:153826 Thanks, Falk :) svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=747308 --- diff --git a/keduvocdocument/keduvocdocument.cpp b/keduvocdocument/keduvocdocument.cpp index 31e623e..677663f 100644 --- a/keduvocdocument/keduvocdocument.cpp +++ b/keduvocdocument/keduvocdocument.cpp @@ -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 ); + } } diff --git a/keduvocdocument/keduvocexpression.cpp b/keduvocdocument/keduvocexpression.cpp index edf3bc1..0565555 100644 --- a/keduvocdocument/keduvocexpression.cpp +++ b/keduvocdocument/keduvocexpression.cpp @@ -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; }