[gtksourceview/wip/regex-search] Remove gtk_source_buffer_disable_search_highlighting()



commit c9b18b6818c2ec24f6a079533d1f8b2630e283aa
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon Aug 12 18:26:00 2013 +0200

    Remove gtk_source_buffer_disable_search_highlighting()
    
    gtk_source_buffer_get_search_contexts() can be used instead.

 docs/reference/gtksourceview-3.0-sections.txt |    1 -
 gtksourceview/gtksourcebuffer.c               |   25 -------------------------
 gtksourceview/gtksourcebuffer.h               |    2 --
 gtksourceview/gtksourcesearchcontext.c        |   18 +++++++-----------
 tests/test-search-context.c                   |   10 ----------
 5 files changed, 7 insertions(+), 49 deletions(-)
---
diff --git a/docs/reference/gtksourceview-3.0-sections.txt b/docs/reference/gtksourceview-3.0-sections.txt
index b28564b..8bffafa 100644
--- a/docs/reference/gtksourceview-3.0-sections.txt
+++ b/docs/reference/gtksourceview-3.0-sections.txt
@@ -27,7 +27,6 @@ gtk_source_buffer_get_context_classes_at_iter
 gtk_source_buffer_iter_forward_to_context_class_toggle
 gtk_source_buffer_iter_backward_to_context_class_toggle
 gtk_source_buffer_get_search_contexts
-gtk_source_buffer_disable_search_highlighting
 <SUBSECTION>
 gtk_source_buffer_get_max_undo_levels
 gtk_source_buffer_set_max_undo_levels
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index f726f1b..cb8f71b 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -2546,31 +2546,6 @@ _gtk_source_buffer_add_search_context (GtkSourceBuffer        *buffer,
 }
 
 /**
- * gtk_source_buffer_disable_search_highlighting:
- * @buffer: a #GtkSourceBuffer.
- *
- * Disables the search occurrences highlighting, for all
- * #GtkSourceSearchContext<!-- -->s attached to @buffer. The search highlighting
- * can be activated again with gtk_source_search_context_set_highlight().
- *
- * Since: 3.10
- */
-void
-gtk_source_buffer_disable_search_highlighting (GtkSourceBuffer *buffer)
-{
-       GList *l;
-
-       g_return_if_fail (GTK_SOURCE_IS_BUFFER (buffer));
-
-       for (l = buffer->priv->search_contexts; l != NULL; l = l->next)
-       {
-               GtkSourceSearchContext *search_context = l->data;
-
-               gtk_source_search_context_set_highlight (search_context, FALSE);
-       }
-}
-
-/**
  * gtk_source_buffer_get_search_contexts:
  * @buffer: a #GtkSourceBuffer.
  *
diff --git a/gtksourceview/gtksourcebuffer.h b/gtksourceview/gtksourcebuffer.h
index bc40587..1ced552 100644
--- a/gtksourceview/gtksourcebuffer.h
+++ b/gtksourceview/gtksourcebuffer.h
@@ -180,8 +180,6 @@ GtkSourceUndoManager        *gtk_source_buffer_get_undo_manager                     
(GtkSourceBuffer        *buf
 void                    gtk_source_buffer_set_undo_manager                     (GtkSourceBuffer        
*buffer,
                                                                                 GtkSourceUndoManager   
*manager);
 
-void                    gtk_source_buffer_disable_search_highlighting          (GtkSourceBuffer        
*buffer);
-
 GList                  *gtk_source_buffer_get_search_contexts                  (GtkSourceBuffer        
*buffer);
 
 G_END_DECLS
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index bab4706..69927b9 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -59,17 +59,13 @@
  * gtk_source_search_context_replace_all().
  *
  * The search occurrences are highlighted by default. To disable it, use
- * gtk_source_search_context_set_highlight(). The
- * gtk_source_buffer_disable_search_highlighting() convenience function permits
- * to disable the search highlighting in a buffer. The
- * #GtkSourceSearchContext:highlight property is in the #GtkSourceSearchContext
- * class. If the property was in #GtkSourceSearchSettings, calling
- * gtk_source_buffer_disable_search_highlighting() might disable the
- * highlighting in other buffers, which would be undesirable. It is therefore
- * better to have the appearance settings in the #GtkSourceSearchContext class.
- * You can enable the search highlighting for several
- * #GtkSourceSearchContext<!-- -->s attached to the same buffer. But, currently,
- * the same highlighting style is applied.
+ * gtk_source_search_context_set_highlight(). You can enable the search
+ * highlighting for several #GtkSourceSearchContext<!-- -->s attached to the
+ * same buffer. But currently, the same highlighting style is applied.
+ * Note that the #GtkSourceSearchContext:highlight property is in the
+ * #GtkSourceSearchContext class, not #GtkSourceSearchSettings. The purpose is
+ * to bind the appearance settings to only one buffer. A
+ * #GtkSourceSearchSettings object can be bound to several buffers.
  *
  * In the GtkSourceView source code, there is an example of how to use the
  * search and replace API: see the tests/test-search.c file. It is a mini
diff --git a/tests/test-search-context.c b/tests/test-search-context.c
index 359913e..8d98f3e 100644
--- a/tests/test-search-context.c
+++ b/tests/test-search-context.c
@@ -744,16 +744,6 @@ test_highlight (void)
        highlight = gtk_source_search_context_get_highlight (context2);
        g_assert (!highlight);
 
-       gtk_source_search_context_set_highlight (context2, TRUE);
-       highlight = gtk_source_search_context_get_highlight (context2);
-       g_assert (highlight);
-
-       gtk_source_buffer_disable_search_highlighting (source_buffer);
-       highlight = gtk_source_search_context_get_highlight (context1);
-       g_assert (!highlight);
-       highlight = gtk_source_search_context_get_highlight (context2);
-       g_assert (!highlight);
-
        g_object_unref (source_buffer);
        g_object_unref (context1);
        g_object_unref (context2);


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