[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdeedu/kvoctrain/kvoctrain/kvt-core
From:       Frederik Gladhorn <frederik.gladhorn () gmx ! de>
Date:       2007-09-26 20:53:00
Message-ID: 1190839980.807811.10208.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 717408 by gladhorn:

Make search search in all columns.
In KDE4 this has been fixed for quite some time and search is overall much improved.
BUG: 93449


 M  +22 -22    kvoctraindoc.cpp  


--- branches/KDE/3.5/kdeedu/kvoctrain/kvoctrain/kvt-core/kvoctraindoc.cpp #717407:717408
@@ -841,35 +841,35 @@
    if (first < 0)
      first = 0;
 
-   if (id >= numLangs()
-      || last < first
-      )
-     return -1;
-
-   if (id == 0) {
      for (int i = first; i < last; i++) {
        if (word_start) {
-         if (getEntry(i)->getOriginal().find (substr, 0, false) == 0)  // case insensitive
-           return i;
+
+	for (id = 0; id <= numLangs(); id++)
+	{
+	 if (id == 0)
+	 {
+         	if (getEntry(i)->getOriginal().find (substr, 0, false) == 0)  // case insensitive
+           	return i;
+         } else {
+	 	if (getEntry(i)->getTranslation(id).find (substr, 0, false) == 0) // case insensitive
+           	return i;
+	}
+	}	
        }
        else {
-         if (getEntry(i)->getOriginal().find (substr, 0, false) > -1)  // case insensitive
-           return i;
+	for (id = 0; id <= numLangs(); id++){
+
+	 if (id == 0)
+	 {
+         	if (getEntry(i)->getOriginal().find (substr, 0, false) > -1)  // case insensitive
+           	return i;
+         } else {
+	 	if (getEntry(i)->getTranslation(id).find (substr, 0, false) > -1) // case insensitive
+           	return i;
+	}
        }
-     }
-   }
-   else {
-     for (int i = first; i < last; i++) {
-       if (word_start) {
-         if (getEntry(i)->getTranslation(id).find (substr, 0, false) == 0) // case insensitive
-           return i;
        }
-       else {
-         if (getEntry(i)->getTranslation(id).find (substr, 0, false) > -1) // case insensitive
-           return i;
-       }
      }
-   }
    return -1;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic