[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kwordquiz/src
From: Peter Hedlund <peter () peterandlinda ! com>
Date: 2005-07-21 1:24:21
Message-ID: 1121909061.257883.6545.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 437131 by hedlund:
Remove unused parameter
M +32 -38 keduvocdocument.cpp
M +1 -2 keduvocdocument.h
--- branches/work/kwordquiz/src/keduvocdocument.cpp #437130:437131
@@ -949,48 +949,42 @@
}
-int KEduVocDocument::search(QString substr, int id,
- int first, int last,
- bool word_start,
- bool)
+int KEduVocDocument::search(QString substr, int id, int first, int last, bool \
word_start) {
- if (last >= numEntries()
- || last < 0 )
- last = numEntries();
+ if (last >= numEntries() || last < 0)
+ last = numEntries();
- if (first < 0)
- first = 0;
+ if (first < 0)
+ first = 0;
- if (id >= numIdentifiers()
- || last < first
- )
- return -1;
+ if (id >= numIdentifiers() || last < first)
+ return -1;
- if (id == 0) {
- for (int i = first; i < last; i++) {
- if (word_start) {
- if (entry(i)->original().find (substr, 0, false) == 0) // case insensitive
- return i;
- }
- else {
- if (entry(i)->original().find (substr, 0, false) > -1) // case insensitive
- return i;
- }
- }
- }
- else {
- for (int i = first; i < last; i++) {
- if (word_start) {
- if (entry(i)->translation(id).find (substr, 0, false) == 0) // case \
insensitive
- return i;
- }
- else {
- if (entry(i)->translation(id).find (substr, 0, false) > -1) // case \
insensitive
- return i;
- }
- }
- }
- return -1;
+ if (id == 0) {
+ for (int i = first; i < last; i++) {
+ if (word_start) {
+ if (entry(i)->original().find(substr, 0, false) == 0) // case insensitive
+ return i;
+ }
+ else {
+ if (entry(i)->original().find(substr, 0, false) > -1) // case insensitive
+ return i;
+ }
+ }
+ }
+ else {
+ for (int i = first; i < last; i++) {
+ if (word_start) {
+ if (entry(i)->translation(id).find(substr, 0, false) == 0) // case \
insensitive + return i;
+ }
+ else {
+ if (entry(i)->translation(id).find(substr, 0, false) > -1) // case \
insensitive + return i;
+ }
+ }
+ }
+ return -1;
}
--- branches/work/kwordquiz/src/keduvocdocument.h #437130:437131
@@ -484,10 +484,9 @@
* @param last index of last entry, -1 goes till end
* @param word_start false: search partial string,
* true:always from beginning of word
- * @param tolerant
* @result index of found entry, -1 if none
*/
- int search(QString substr, int id, int first=0, int last=-1, bool word_start = \
false, bool tolerant=false); + int search(QString substr, int id, int first=0, int \
last=-1, bool word_start = false);
/** returns url of xml file */
inline KURL URL() const {return m_url; }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic