From: Frederik Gladhorn Date: Tue, 17 Jun 2008 20:21:24 +0000 (+0000) Subject: Nice catch Avgoustinos! X-Git-Tag: v4.0.83^0 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=a823dd0527b2199a3a756bacde7a70ee0f470e7b;p=libqmvoc.git 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@kde.org svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=821561 --- diff --git a/keduvocdocument/keduvocexpression.cpp b/keduvocdocument/keduvocexpression.cpp index 987b7b3..5d48a17 100644 --- a/keduvocdocument/keduvocexpression.cpp +++ b/keduvocdocument/keduvocexpression.cpp @@ -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); }