From 963ec86283c929faabcabd6287cb28658e57b246 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 29 Aug 2007 17:06:48 +0000 Subject: [PATCH] Remove very old search method. Never got used. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=706187 --- keduvocdocument/keduvocdocument.cpp | 25 ------------------------- keduvocdocument/keduvocdocument.h | 12 ------------ 2 files changed, 37 deletions(-) diff --git a/keduvocdocument/keduvocdocument.cpp b/keduvocdocument/keduvocdocument.cpp index d5a2671..4345abd 100644 --- a/keduvocdocument/keduvocdocument.cpp +++ b/keduvocdocument/keduvocdocument.cpp @@ -1156,31 +1156,6 @@ bool KEduVocDocument::deleteLesson( int lessonIndex, int deleteMode ) // } //} -int KEduVocDocument::search( const QString &substr, int id, int first, int last, bool word_start ) -{ - if ( last >= entryCount() || last < 0 ) - last = entryCount(); - - if ( first < 0 ) - first = 0; - - if ( id >= identifierCount() || last < first ) - return -1; - - - for ( int i = first; i < last; i++ ) { - if ( word_start ) { - if ( entry( i )->translation( id ).text().indexOf( substr, 0, Qt::CaseInsensitive ) == 0 ) // case insensitive - return i; - } else { - if ( entry( i )->translation( id ).text().indexOf( substr, 0, Qt::CaseInsensitive ) > -1 ) // case insensitive - return i; - } - - } - return -1; -} - QString KEduVocDocument::csvDelimiter() const { diff --git a/keduvocdocument/keduvocdocument.h b/keduvocdocument/keduvocdocument.h index abd8183..94cfd76 100644 --- a/keduvocdocument/keduvocdocument.h +++ b/keduvocdocument/keduvocdocument.h @@ -355,18 +355,6 @@ public: */ KEduVocExpression *entry( int index ); - /** - * Search substring in vocabulary (case insensitive always) - * - * @param substr partial string to search - * @param id which language to search: 0=org, 1..x=translation - * @param first index from where to start - * @param last index of last entry, -1 goes till end - * @param word_start false: search partial string, - * true:always from beginning of word - * @returns the index of found entry, -1 if none - */ - int search( const QString &substr, int id, int first=0, int last=-1, bool word_start = false ); /** * Retrieves the identifiers for the current query -- 2.47.3