]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-chat-text-view.c
Updated Polish translation
[empathy.git] / libempathy-gtk / empathy-chat-text-view.c
index 8d00bf577f984c6cad9c6fcfdd645990c105c008..7f16ab9a325a9f4e5693d9e96bf4a0daf5ca0fd0 100644 (file)
@@ -42,6 +42,7 @@
 #include "empathy-conf.h"
 #include "empathy-ui-utils.h"
 #include "empathy-smiley-manager.h"
+#include "empathy-string-parser.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CHAT
 #include <libempathy/empathy-debug.h>
@@ -1096,6 +1097,7 @@ chat_text_view_find_next (EmpathyChatView *view,
 static void
 chat_text_view_find_abilities (EmpathyChatView *view,
                                 const gchar    *search_criteria,
+                                gboolean        match_case,
                                 gboolean       *can_do_previous,
                                 gboolean       *can_do_next)
 {
@@ -1122,11 +1124,20 @@ chat_text_view_find_abilities (EmpathyChatView *view,
                        gtk_text_buffer_get_start_iter (buffer, &iter_at_mark);
                }
 
-               *can_do_previous = empathy_text_iter_backward_search (&iter_at_mark,
-                                                                     search_criteria,
-                                                                     &iter_match_start,
-                                                                     &iter_match_end,
-                                                                     NULL);
+               if (match_case) {
+                       *can_do_previous = gtk_text_iter_backward_search (&iter_at_mark,
+                                                                         search_criteria,
+                                                                         0,
+                                                                         &iter_match_start,
+                                                                         &iter_match_end,
+                                                                         NULL);
+               } else {
+                       *can_do_previous = empathy_text_iter_backward_search (&iter_at_mark,
+                                                                             search_criteria,
+                                                                             &iter_match_start,
+                                                                             &iter_match_end,
+                                                                             NULL);
+               }
        }
 
        if (can_do_next) {
@@ -1138,11 +1149,20 @@ chat_text_view_find_abilities (EmpathyChatView *view,
                        gtk_text_buffer_get_start_iter (buffer, &iter_at_mark);
                }
 
-               *can_do_next = empathy_text_iter_forward_search (&iter_at_mark,
-                                                                search_criteria,
-                                                                &iter_match_start,
-                                                                &iter_match_end,
-                                                                NULL);
+               if (match_case) {
+                       *can_do_next = gtk_text_iter_forward_search (&iter_at_mark,
+                                                                    search_criteria,
+                                                                    0,
+                                                                    &iter_match_start,
+                                                                    &iter_match_end,
+                                                                    NULL);
+               } else {
+                       *can_do_next = empathy_text_iter_forward_search (&iter_at_mark,
+                                                                        search_criteria,
+                                                                        &iter_match_start,
+                                                                        &iter_match_end,
+                                                                        NULL);
+               }
        }
 }
 
@@ -1151,7 +1171,6 @@ chat_text_view_highlight (EmpathyChatView *view,
                            const gchar     *text,
                            gboolean         match_case)
 {
-       // TODO: do something useful with the match_case var
        GtkTextBuffer *buffer;
        GtkTextIter    iter;
        GtkTextIter    iter_start;
@@ -1176,12 +1195,20 @@ chat_text_view_highlight (EmpathyChatView *view,
        }
 
        while (1) {
-               found = empathy_text_iter_forward_search (&iter,
-                                                         text,
-                                                         &iter_match_start,
-                                                         &iter_match_end,
-                                                         NULL);
-
+               if (match_case) {
+                       found = gtk_text_iter_forward_search (&iter,
+                                                             text,
+                                                             0,
+                                                             &iter_match_start,
+                                                             &iter_match_end,
+                                                             NULL);
+               } else {
+                       found = empathy_text_iter_forward_search (&iter,
+                                                                 text,
+                                                                 &iter_match_start,
+                                                                 &iter_match_end,
+                                                                 NULL);
+               }
                if (!found) {
                        break;
                }