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

List:       kde-edu-devel
Subject:    [kde-edu]: [Patch] Kiten - Pending 'n' in search
From:       Andreas Ramm <psychobrain () gmx ! net>
Date:       2004-12-11 9:13:16
Message-ID: 41BABA2C.4090608 () gmx ! net
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi all,

the attached patch takes care of a problem when entering hiragana or 
katakana in the search box.

If you try searching for "ken" and type it in hiragana mode you get 
"?n". When pressing 'Enter' the following search finds nothing. This 
patch transforms the string "?n" to the proper "??" upon pressing 
'Enter' so the search actually finds results.

The problem still exists though when clicking the search button. In 
order to get this working too, a (proposed) KRomajiEdit::kanaText might 
have to be written which does this on the fly. Comments?

Best Regards
Andreas

[Attachment #5 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
Hi all,<br>
<br>
the attached patch takes care of a problem when entering hiragana or
katakana in the search box.<br>
<br>
If you try searching for "ken" and type it in hiragana mode you get
"&#12369;n". When pressing 'Enter' the following search finds nothing. This
patch transforms the string "&#12369;n" to the proper "&#12369;&#12435;" upon pressing
'Enter' so the search actually finds results.<br>
<br>
The problem still exists though when clicking the search button. In
order to get this working too, a (proposed) KRomajiEdit::kanaText might
have to be
written which does this on the fly. Comments?<br>
<br>
Best Regards<br>
Andreas<br>
</body>
</html>

["kromajiedit.cpp.patch" (text/x-patch)]

Index: kromajiedit.cpp
===================================================================
RCS file: /home/kde/kdeedu/kiten/kromajiedit.cpp,v
retrieving revision 1.12
diff -U2 -r1.12 kromajiedit.cpp
--- kromajiedit.cpp	21 Aug 2004 03:39:40 -0000	1.12
+++ kromajiedit.cpp	11 Dec 2004 09:08:46 -0000
@@ -235,4 +235,22 @@
 		}
 	}
+	if ( e->key() == Key_Return || e->key() == Key_Enter ) // take care of pending n
+	{
+//		kdDebug() << "taking care of pending n\n";
+		if (kana == "hiragana")
+		{
+			if (_text[len-1] == 'n')
+			{
+				setText(curKana + hiragana["n'"]);
+			}
+		}
+		else
+		{
+			if (_text[len-1] == 'N')
+			{
+				setText(curKana + katakana["n'"]);
+			}
+		}
+	}
 
 	KLineEdit::keyPressEvent(e); // don't think we'll get here :)


_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu


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

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