[gedit/wip/use-gsv-search: 1/2] Deprecate gedit_utils_escape_search_text() and unescape()



commit 161dd8c168e9f3bdb41ff2272b36dbac20d9c1e1
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Jul 13 11:04:31 2013 +0200

    Deprecate gedit_utils_escape_search_text() and unescape()
    
    Moved to GtkSourceView.

 gedit/gedit-replace-dialog.c |   10 +++++-----
 gedit/gedit-utils.c          |   14 ++++++++++++++
 gedit/gedit-utils.h          |    2 ++
 gedit/gedit-view-frame.c     |    2 +-
 4 files changed, 22 insertions(+), 6 deletions(-)
---
diff --git a/gedit/gedit-replace-dialog.c b/gedit/gedit-replace-dialog.c
index f945fa0..09506ed 100644
--- a/gedit/gedit-replace-dialog.c
+++ b/gedit/gedit-replace-dialog.c
@@ -88,7 +88,7 @@ gedit_replace_dialog_response (GtkDialog *dialog,
                        {
                                gchar *text;
 
-                               text = gedit_utils_unescape_search_text (str);
+                               text = gtk_source_utils_unescape_search_text (str);
                                gedit_history_entry_prepend_text
                                                (GEDIT_HISTORY_ENTRY (dlg->priv->replace_entry),
                                                 text);
@@ -102,7 +102,7 @@ gedit_replace_dialog_response (GtkDialog *dialog,
                        {
                                gchar *text;
 
-                               text = gedit_utils_unescape_search_text (str);
+                               text = gtk_source_utils_unescape_search_text (str);
                                gedit_history_entry_prepend_text
                                                (GEDIT_HISTORY_ENTRY (dlg->priv->search_entry),
                                                 text);
@@ -151,7 +151,7 @@ insert_text_handler (GtkEditable *editable,
        if (insert_text)
                return;
 
-       escaped_text = gedit_utils_escape_search_text (text);
+       escaped_text = gtk_source_utils_escape_search_text (text);
 
        new_len = strlen (escaped_text);
 
@@ -209,7 +209,7 @@ gedit_replace_dialog_init (GeditReplaceDialog *dlg)
        dlg->priv->search_entry = gedit_history_entry_new ("search-for-entry", TRUE);
        gtk_widget_set_size_request (dlg->priv->search_entry, 300, -1);
        gedit_history_entry_set_escape_func (GEDIT_HISTORY_ENTRY (dlg->priv->search_entry),
-                                            (GeditHistoryEntryEscapeFunc) gedit_utils_escape_search_text);
+                                            (GeditHistoryEntryEscapeFunc) 
gtk_source_utils_escape_search_text);
        gtk_widget_set_hexpand (GTK_WIDGET (dlg->priv->search_entry), TRUE);
        dlg->priv->search_text_entry = gedit_history_entry_get_entry (GEDIT_HISTORY_ENTRY 
(dlg->priv->search_entry));
        gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->search_text_entry), TRUE);
@@ -220,7 +220,7 @@ gedit_replace_dialog_init (GeditReplaceDialog *dlg)
 
        dlg->priv->replace_entry = gedit_history_entry_new ("replace-with-entry", TRUE);
        gedit_history_entry_set_escape_func (GEDIT_HISTORY_ENTRY (dlg->priv->replace_entry),
-                                            (GeditHistoryEntryEscapeFunc) gedit_utils_escape_search_text);
+                                            (GeditHistoryEntryEscapeFunc) 
gtk_source_utils_escape_search_text);
        gtk_widget_set_hexpand (GTK_WIDGET (dlg->priv->replace_entry), TRUE);
        dlg->priv->replace_text_entry = gedit_history_entry_get_entry (GEDIT_HISTORY_ENTRY 
(dlg->priv->replace_entry));
        gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->replace_text_entry), TRUE);
diff --git a/gedit/gedit-utils.c b/gedit/gedit-utils.c
index 7a0692a..0a587ac 100644
--- a/gedit/gedit-utils.c
+++ b/gedit/gedit-utils.c
@@ -277,12 +277,26 @@ gedit_utils_set_atk_relation (GtkWidget       *obj1,
        g_object_unref (G_OBJECT (relation));
 }
 
+/**
+ * gedit_utils_escape_search_text:
+ * @text:
+ *
+ * Returns:
+ * Deprecated: 3.10: Use gtk_source_utils_escape_search_text() instead.
+ */
 gchar *
 gedit_utils_escape_search_text (const gchar* text)
 {
        return gtk_source_utils_escape_search_text (text);
 }
 
+/**
+ * gedit_utils_unescape_search_text:
+ * @text:
+ *
+ * Returns:
+ * Deprecated: 3.10: Use gtk_source_utils_unescape_search_text() instead.
+ */
 gchar *
 gedit_utils_unescape_search_text (const gchar *text)
 {
diff --git a/gedit/gedit-utils.h b/gedit/gedit-utils.h
index 6423d24..f568be6 100644
--- a/gedit/gedit-utils.h
+++ b/gedit/gedit-utils.h
@@ -88,8 +88,10 @@ void          gedit_utils_set_atk_relation           (GtkWidget        *obj1,
                                                         GtkWidget        *obj2,
                                                         AtkRelationType   rel_type);
 
+G_DEPRECATED_FOR (gtk_source_utils_escape_search_text)
 gchar          *gedit_utils_escape_search_text         (const gchar      *text);
 
+G_DEPRECATED_FOR (gtk_source_utils_unescape_search_text)
 gchar          *gedit_utils_unescape_search_text       (const gchar      *text);
 
 void            gedit_warning                          (GtkWindow        *parent,
diff --git a/gedit/gedit-view-frame.c b/gedit/gedit-view-frame.c
index e7bb09e..172623e 100644
--- a/gedit/gedit-view-frame.c
+++ b/gedit/gedit-view-frame.c
@@ -799,7 +799,7 @@ search_entry_insert_text (GtkEditable    *editable,
                        return;
                }
 
-               escaped_text = gedit_utils_escape_search_text (text);
+               escaped_text = gtk_source_utils_escape_search_text (text);
 
                gedit_debug_message (DEBUG_SEARCH, "Escaped Text: %s", escaped_text);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]