aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat-text-view.c
diff options
context:
space:
mode:
authorThomas Meire <blackskad@gmail.com>2010-01-19 22:26:56 +0800
committerThomas Meire <blackskad@gmail.com>2010-01-21 08:20:08 +0800
commita60052ef99b114614a598bc6fd623ae4bd6b4d52 (patch)
treec9ec3d672c389b04304eb304b39ffe475474b83f /libempathy-gtk/empathy-chat-text-view.c
parent20941452d76810e181d91510168a7204c986edbd (diff)
downloadgsoc2013-empathy-a60052ef99b114614a598bc6fd623ae4bd6b4d52.tar
gsoc2013-empathy-a60052ef99b114614a598bc6fd623ae4bd6b4d52.tar.gz
gsoc2013-empathy-a60052ef99b114614a598bc6fd623ae4bd6b4d52.tar.bz2
gsoc2013-empathy-a60052ef99b114614a598bc6fd623ae4bd6b4d52.tar.lz
gsoc2013-empathy-a60052ef99b114614a598bc6fd623ae4bd6b4d52.tar.xz
gsoc2013-empathy-a60052ef99b114614a598bc6fd623ae4bd6b4d52.tar.zst
gsoc2013-empathy-a60052ef99b114614a598bc6fd623ae4bd6b4d52.zip
Use gtk_text_iter_[backward/forward]_search for case sensitive searches, keep
the custom version for case insensitive searches
Diffstat (limited to 'libempathy-gtk/empathy-chat-text-view.c')
-rw-r--r--libempathy-gtk/empathy-chat-text-view.c46
1 files changed, 34 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-chat-text-view.c b/libempathy-gtk/empathy-chat-text-view.c
index 14c78ce25..8d00bf577 100644
--- a/libempathy-gtk/empathy-chat-text-view.c
+++ b/libempathy-gtk/empathy-chat-text-view.c
@@ -892,12 +892,23 @@ chat_text_view_find_previous (EmpathyChatView *view,
priv->find_last_direction = FALSE;
- /* FIXME: doesn't respect match_case */
- found = empathy_text_iter_backward_search (&iter_at_mark,
- search_criteria,
- &iter_match_start,
- &iter_match_end,
- NULL);
+ /* Use the standard GTK+ method for case sensitive searches. It can't do
+ * case insensitive searches (see bug #61852), so keep the custom method
+ * around for case insensitive searches. */
+ if (match_case) {
+ found = gtk_text_iter_backward_search (&iter_at_mark,
+ search_criteria,
+ 0, /* no text search flags, we want exact matches */
+ &iter_match_start,
+ &iter_match_end,
+ NULL);
+ } else {
+ found = empathy_text_iter_backward_search (&iter_at_mark,
+ search_criteria,
+ &iter_match_start,
+ &iter_match_end,
+ NULL);
+ }
if (!found) {
gboolean result = FALSE;
@@ -1010,12 +1021,23 @@ chat_text_view_find_next (EmpathyChatView *view,
priv->find_last_direction = TRUE;
- /* FIXME: doesn't respect match_case */
- found = empathy_text_iter_forward_search (&iter_at_mark,
- search_criteria,
- &iter_match_start,
- &iter_match_end,
- NULL);
+ /* Use the standard GTK+ method for case sensitive searches. It can't do
+ * case insensitive searches (see bug #61852), so keep the custom method
+ * around for case insensitive searches. */
+ if (match_case) {
+ found = gtk_text_iter_forward_search (&iter_at_mark,
+ search_criteria,
+ 0,
+ &iter_match_start,
+ &iter_match_end,
+ NULL);
+ } else {
+ found = empathy_text_iter_forward_search (&iter_at_mark,
+ search_criteria,
+ &iter_match_start,
+ &iter_match_end,
+ NULL);
+ }
if (!found) {
gboolean result = FALSE;