From c00c4c74fe84fdeda7d02422fe046bc2165b3aa9 Mon Sep 17 00:00:00 2001 From: Avgoustinos Kadis Date: Wed, 30 Jul 2008 07:55:45 +0000 Subject: [PATCH] Added new function indexOfIdentifier() [no const] svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=839513 --- keduvocdocument/keduvocdocument.cpp | 14 +++++++------- keduvocdocument/keduvocdocument.h | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/keduvocdocument/keduvocdocument.cpp b/keduvocdocument/keduvocdocument.cpp index 169a348..7b7f07c 100644 --- a/keduvocdocument/keduvocdocument.cpp +++ b/keduvocdocument/keduvocdocument.cpp @@ -695,13 +695,13 @@ void KEduVocDocument::setTenseDescriptions( const QStringList &names ) } // works if const is removed -// int KEduVocDocument::indexOfIdentifier( const QString &name ) const -// { -// for (int i = 0; i < identifierCount(); i++) -// if (identifier(i).locale() == name) -// return i; -// return -1; -// } +int KEduVocDocument::indexOfIdentifier( const QString &name ) +{ + for (int i = 0; i < identifierCount(); i++) + if (identifier(i).locale() == name) + return i; + return -1; +} void KEduVocDocument::removeIdentifier( int index ) diff --git a/keduvocdocument/keduvocdocument.h b/keduvocdocument/keduvocdocument.h index 063c0f1..01da28c 100644 --- a/keduvocdocument/keduvocdocument.h +++ b/keduvocdocument/keduvocdocument.h @@ -251,6 +251,8 @@ public: */ int indexOfIdentifier( const QString &name ) const; + int indexOfIdentifier( const QString &name ); + // *** tense methods *** /** -- 2.47.3