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

List:       kde-commits
Subject:    KDE/kdeedu/kiten
From:       Harald Hvaal <harald.hvaal () gmail ! com>
Date:       2008-04-21 14:37:39
Message-ID: 1208788659.426433.2677.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 799430 by metellius:

Made Search Anywhere work for words, not only kanji. Updated match anywhere action


 M  +1 -1      app/searchStringInput.cpp  
 M  +3 -2      lib/Entry.cpp  
 M  +0 -3      lib/dictEdict/dictFileEdict.cpp  


--- trunk/KDE/kdeedu/kiten/app/searchStringInput.cpp #799429:799430
@@ -49,7 +49,7 @@
 	actionSearchSection->setText(i18n("Match Type"));
 	actionSearchSection->addAction(i18n("Exact Match"));
 	actionSearchSection->addAction(i18n("Match Beginning"));
-	actionSearchSection->addAction(i18n("Match Anywhere (Kanji Only)"));
+	actionSearchSection->addAction(i18n("Match Anywhere"));
 
 	actionSelectWordType = parent->actionCollection()->add<KSelectAction>("search_wordType");
 	actionSelectWordType->setText(i18n("Word Type"));
--- trunk/KDE/kdeedu/kiten/lib/Entry.cpp #799429:799430
@@ -146,6 +146,7 @@
 }
 
 bool Entry::matchesQuery(const DictQuery &query) const {
+
 	if(!query.getWord().isEmpty()) {
 		if(query.getMatchType() == DictQuery::matchExact &&
 				this->getWord() != query.getWord())
@@ -154,11 +155,11 @@
 				!this->getWord().startsWith(query.getWord()))
 				return false;
 		if(query.getMatchType() == DictQuery::matchAnywhere &&
-				!this->getWord().contains(query.getWord()))
+				!this->getWord().contains(query.toString()))
 				return false;
 	}
 
-	if(!query.getPronunciation().isEmpty())
+	if(!query.getPronunciation().isEmpty() && !Readings.isEmpty())
 		if(!listMatch(Readings, query.getPronunciation().split(DictQuery::mainDelimiter),
 					query.getMatchType() ) )
 			return false;
--- trunk/KDE/kdeedu/kiten/lib/dictEdict/dictFileEdict.cpp #799429:799430
@@ -127,9 +127,6 @@
 
 	QString firstChoice = query.getWord();
 	if(firstChoice.length() == 0) {
-		//If we don't have a kanji to search on, matchanywhere devolves to matchbeginning
-		if(query.getMatchType() == DictQuery::matchAnywhere)
-			query.setMatchType(DictQuery::matchBeginning);
 		firstChoice = query.getPronunciation();
 		if(firstChoice.length() == 0) {
 			firstChoice = query.getMeaning().split(" ").first().toLower();
[prev in list] [next in list] [prev in thread] [next in thread] 

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