[Parley-devel] KDE/kdeedu

Frederik Gladhorn frederik.gladhorn at gmx.de
Tue Jun 17 22:21:25 CEST 2008


SVN commit 821561 by gladhorn:

Nice catch Avgoustinos!
And in time for 4.1.
Editing languages should work now.
 - after adding and then immediately removing a language one of the existing languages would be blown away
 - reload the languages after they have been changed
CCMAIL: parley-devel at kde.org


 M  +5 -4      libkdeedu/keduvocdocument/keduvocexpression.cpp  
 M  +2 -2      parley/src/vocabulary/vocabularymodel.cpp  


--- trunk/KDE/kdeedu/libkdeedu/keduvocdocument/keduvocexpression.cpp #821560:821561
@@ -117,12 +117,13 @@
 
 void KEduVocExpression::removeTranslation( int index )
 {
-    delete d->m_translations.take(index);
+    // remove the index we delete
+    d->m_translations.remove(index);
 
-    for ( int j = index; j < d->m_translations.count(); j++ ) {
-        d->m_translations[j] = d->m_translations.value(j+1);
+    // shift all other indexes
+    for ( int j = index; j < d->m_translations.count() - 1; j++ ) {
+        d->m_translations[j] = d->m_translations.take(j+1);
     }
-    d->m_translations.remove(d->m_translations.count() - 1);
 }
 
 
--- trunk/KDE/kdeedu/parley/src/vocabulary/vocabularymodel.cpp #821560:821561
@@ -426,11 +426,11 @@
 
 void VocabularyModel::resetLanguages()
 {
-    reset();
+    // play it save - this happens seldom enough to warrant a reload
+    setDocument(m_document);
 }
 
 
-
 #include "vocabularymodel.moc"
 
 


More information about the Parley-devel mailing list