[gtksourceview] SearchContext: deprecate set_settings()



commit 77906cf17d5c4905c8efb00f325253d7f772a18e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Oct 19 15:16:12 2016 +0200

    SearchContext: deprecate set_settings()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726981

 gtksourceview/gtksourcesearchcontext.c |   12 ++++++++++++
 gtksourceview/gtksourcesearchcontext.h |    2 +-
 2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index 1c1441b..37aa447 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -2696,7 +2696,9 @@ gtk_source_search_context_set_property (GObject      *object,
                        break;
 
                case PROP_SETTINGS:
+                       G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
                        gtk_source_search_context_set_settings (search, g_value_get_object (value));
+                       G_GNUC_END_IGNORE_DEPRECATIONS;
                        break;
 
                case PROP_HIGHLIGHT:
@@ -2903,6 +2905,12 @@ gtk_source_search_context_get_settings (GtkSourceSearchContext *search)
  * The search context holds a reference to @settings.
  *
  * Since: 3.10
+ * Deprecated: 3.24: The #GtkSourceSearchContext:settings property will become a
+ * construct-only property in a future version. Create a new
+ * #GtkSourceSearchContext instead, or change the #GtkSourceSearchSettings
+ * properties. When the #GtkSourceSearchContext:settings property will become
+ * construct-only, it will be possible to simplify some code that needed to
+ * listen to the notify::settings signal.
  */
 void
 gtk_source_search_context_set_settings (GtkSourceSearchContext  *search,
@@ -2913,6 +2921,10 @@ gtk_source_search_context_set_settings (GtkSourceSearchContext  *search,
 
        if (search->priv->settings != NULL)
        {
+               g_warning ("%s() is deprecated, the GtkSourceSearchContext:settings property "
+                          "will become a construct-only property in a future version.",
+                          G_STRFUNC);
+
                g_signal_handlers_disconnect_by_func (search->priv->settings,
                                                      settings_notify_cb,
                                                      search);
diff --git a/gtksourceview/gtksourcesearchcontext.h b/gtksourceview/gtksourcesearchcontext.h
index 851676f..f88799c 100644
--- a/gtksourceview/gtksourcesearchcontext.h
+++ b/gtksourceview/gtksourcesearchcontext.h
@@ -72,7 +72,7 @@ GtkSourceBuffer               *gtk_source_search_context_get_buffer                   
(GtkSourceSearchContext
 GTK_SOURCE_AVAILABLE_IN_3_10
 GtkSourceSearchSettings        *gtk_source_search_context_get_settings                 
(GtkSourceSearchContext  *search);
 
-GTK_SOURCE_AVAILABLE_IN_3_10
+GTK_SOURCE_DEPRECATED_IN_3_24_FOR (gtk_source_search_context_new)
 void                    gtk_source_search_context_set_settings                 (GtkSourceSearchContext  
*search,
                                                                                 GtkSourceSearchSettings 
*settings);
 


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