]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-theme-adium.c
Updated Polish translation
[empathy.git] / libempathy-gtk / empathy-theme-adium.c
index 0a505eb579a924c7a6ce3d85d353baafc771176c..7736be27070bb2e783fc545502aafaff94d0c0a4 100644 (file)
@@ -40,6 +40,7 @@
 #include "empathy-conf.h"
 #include "empathy-ui-utils.h"
 #include "empathy-plist.h"
+#include "empathy-string-parser.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CHAT
 #include <libempathy/empathy-debug.h>
@@ -220,30 +221,6 @@ theme_adium_match_newline (const gchar *text,
                                      sub_parsers, user_data);
 }
 
-static void
-theme_adium_replace_link (const gchar *text,
-                         gssize len,
-                         gpointer match_data,
-                         gpointer user_data)
-{
-       GString *string = user_data;
-       gchar *real_url;
-       gchar *escaped;
-
-       real_url = empathy_make_absolute_url_len (text, len);
-
-       /* The thing we are making a link of may contain
-        * characters which need escaping */
-       escaped = g_markup_escape_text (text, len);
-
-       /* Append the link inside <a href=""></a> tag */
-       g_string_append_printf (string, "<a href=\"%s\">%s</a>",
-                               real_url, escaped);
-
-       g_free (real_url);
-       g_free (escaped);
-}
-
 static void
 theme_adium_replace_smiley (const gchar *text,
                            gssize len,
@@ -259,32 +236,18 @@ theme_adium_replace_smiley (const gchar *text,
                                hit->path, (int)len, text, (int)len, text);
 }
 
-static void
-theme_adium_replace_escaped (const gchar *text,
-                            gssize len,
-                            gpointer match_data,
-                            gpointer user_data)
-{
-       GString *string = user_data;
-       gchar *escaped;
-
-       escaped = g_markup_escape_text (text, len);
-       g_string_append (string, escaped);
-       g_free (escaped);
-}
-
 static EmpathyStringParser string_parsers[] = {
-       {empathy_string_match_link, theme_adium_replace_link},
+       {empathy_string_match_link, empathy_string_replace_link},
        {theme_adium_match_newline, NULL},
-       {empathy_string_match_all, theme_adium_replace_escaped},
+       {empathy_string_match_all, empathy_string_replace_escaped},
        {NULL, NULL}
 };
 
 static EmpathyStringParser string_parsers_with_smiley[] = {
-       {empathy_string_match_link, theme_adium_replace_link},
+       {empathy_string_match_link, empathy_string_replace_link},
        {empathy_string_match_smiley, theme_adium_replace_smiley},
        {theme_adium_match_newline, NULL},
-       {empathy_string_match_all, theme_adium_replace_escaped},
+       {empathy_string_match_all, empathy_string_replace_escaped},
        {NULL, NULL}
 };
 
@@ -706,26 +669,31 @@ theme_adium_clear (EmpathyChatView *view)
 static gboolean
 theme_adium_find_previous (EmpathyChatView *view,
                           const gchar     *search_criteria,
-                          gboolean         new_search)
+                          gboolean         new_search,
+                          gboolean         match_case)
 {
+       /* FIXME: Doesn't respect new_search */
        return webkit_web_view_search_text (WEBKIT_WEB_VIEW (view),
-                                           search_criteria, FALSE,
+                                           search_criteria, match_case,
                                            FALSE, TRUE);
 }
 
 static gboolean
 theme_adium_find_next (EmpathyChatView *view,
                       const gchar     *search_criteria,
-                      gboolean         new_search)
+                      gboolean         new_search,
+                      gboolean         match_case)
 {
+       /* FIXME: Doesn't respect new_search */
        return webkit_web_view_search_text (WEBKIT_WEB_VIEW (view),
-                                           search_criteria, FALSE,
+                                           search_criteria, match_case,
                                            TRUE, TRUE);
 }
 
 static void
 theme_adium_find_abilities (EmpathyChatView *view,
                            const gchar    *search_criteria,
+                            gboolean        match_case,
                            gboolean       *can_do_previous,
                            gboolean       *can_do_next)
 {
@@ -837,6 +805,8 @@ theme_adium_context_menu_for_event (EmpathyThemeAdium *theme, GdkEventButton *ev
        gtk_widget_show_all (menu);
        gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
                        event->button, event->time);
+       g_object_ref_sink (menu);
+       g_object_unref (menu);
 }
 
 static gboolean