]> Git trees. - libqmvoc.git/commitdiff
Nice catch Avgoustinos! v4.0.83
authorFrederik Gladhorn <gladhorn@kde.org>
Tue, 17 Jun 2008 20:21:24 +0000 (20:21 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Tue, 17 Jun 2008 20:21:24 +0000 (20:21 +0000)
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@kde.org

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

keduvocdocument/keduvocexpression.cpp

index 987b7b3073d3c61905406d55229ec27cb5e27bed..5d48a17dcb57cda1b3468b24bee62b221d4ef77f 100644 (file)
@@ -117,12 +117,13 @@ KEduVocExpression::~KEduVocExpression()
 
 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);
 }