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



commit 402d5dfbc124c366af8ef22530ab1e98c62ba38b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon Aug 12 18:08:56 2013 +0200

    Remove gtk_source_buffer_disable_search_highlighting()
    
    Not really useful in gedit.

 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 a063ba9..cde933e 100644
--- a/docs/reference/gtksourceview-3.0-sections.txt
+++ b/docs/reference/gtksourceview-3.0-sections.txt
@@ -26,7 +26,6 @@ gtk_source_buffer_iter_has_context_class
 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_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 1178dcd..f7ff04a 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -2544,28 +2544,3 @@ _gtk_source_buffer_add_search_context (GtkSourceBuffer        *buffer,
                           (GWeakNotify)search_context_weak_notify_cb,
                           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);
-       }
-}
diff --git a/gtksourceview/gtksourcebuffer.h b/gtksourceview/gtksourcebuffer.h
index 5810d0d..9026ca2 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);
-
 G_END_DECLS
 
 #endif /* __GTK_SOURCE_BUFFER_H__ */
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]