[gtksourceview/wip/gsv-4] SearchContext: remove set_settings() deprecated API
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/gsv-4] SearchContext: remove set_settings() deprecated API
- Date: Fri, 4 Nov 2016 21:23:32 +0000 (UTC)
commit bc8ef000f457dc64f16101a27d72247b9db399ab
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Nov 4 22:03:43 2016 +0100
SearchContext: remove set_settings() deprecated API
docs/reference/gtksourceview-4.0-sections.txt | 1 -
gtksourceview/gtksourcesearchcontext.c | 100 +++++++++---------------
gtksourceview/gtksourcesearchcontext.h | 4 -
3 files changed, 38 insertions(+), 67 deletions(-)
---
diff --git a/docs/reference/gtksourceview-4.0-sections.txt b/docs/reference/gtksourceview-4.0-sections.txt
index ff81eec..c39029f 100644
--- a/docs/reference/gtksourceview-4.0-sections.txt
+++ b/docs/reference/gtksourceview-4.0-sections.txt
@@ -676,7 +676,6 @@ GtkSourceSearchContext
gtk_source_search_context_new
gtk_source_search_context_get_buffer
gtk_source_search_context_get_settings
-gtk_source_search_context_set_settings
gtk_source_search_context_get_highlight
gtk_source_search_context_set_highlight
gtk_source_search_context_get_match_style
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index e459885..05d5b02 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -2589,6 +2589,43 @@ settings_notify_cb (GtkSourceSearchContext *search,
}
static void
+set_settings (GtkSourceSearchContext *search,
+ GtkSourceSearchSettings *settings)
+{
+ if (search->priv->settings != NULL)
+ {
+ g_warning ("The GtkSourceSearchContext:settings property "
+ "will become a construct-only property in a future version.");
+
+ g_signal_handlers_disconnect_by_func (search->priv->settings,
+ settings_notify_cb,
+ search);
+
+ g_object_unref (search->priv->settings);
+ }
+
+ if (settings != NULL)
+ {
+ search->priv->settings = g_object_ref (settings);
+ }
+ else
+ {
+ search->priv->settings = gtk_source_search_settings_new ();
+ }
+
+ g_signal_connect_object (search->priv->settings,
+ "notify",
+ G_CALLBACK (settings_notify_cb),
+ search,
+ G_CONNECT_SWAPPED);
+
+ search_text_updated (search);
+ update (search);
+
+ g_object_notify (G_OBJECT (search), "settings");
+}
+
+static void
gtk_source_search_context_dispose (GObject *object)
{
GtkSourceSearchContext *search = GTK_SOURCE_SEARCH_CONTEXT (object);
@@ -2696,9 +2733,7 @@ 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;
+ set_settings (search, g_value_get_object (value));
break;
case PROP_HIGHLIGHT:
@@ -2895,65 +2930,6 @@ gtk_source_search_context_get_settings (GtkSourceSearchContext *search)
}
/**
- * gtk_source_search_context_set_settings:
- * @search: a #GtkSourceSearchContext.
- * @settings: (nullable): the new #GtkSourceSearchSettings, or %NULL.
- *
- * Associate a #GtkSourceSearchSettings with the search context. If @settings is
- * %NULL, a new one will be created.
- *
- * 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,
- GtkSourceSearchSettings *settings)
-{
- g_return_if_fail (GTK_SOURCE_IS_SEARCH_CONTEXT (search));
- g_return_if_fail (settings == NULL || GTK_SOURCE_IS_SEARCH_SETTINGS (settings));
-
- 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);
-
- g_object_unref (search->priv->settings);
- }
-
- if (settings != NULL)
- {
- search->priv->settings = g_object_ref (settings);
- }
- else
- {
- search->priv->settings = gtk_source_search_settings_new ();
- }
-
- g_signal_connect_object (search->priv->settings,
- "notify",
- G_CALLBACK (settings_notify_cb),
- search,
- G_CONNECT_SWAPPED);
-
- search_text_updated (search);
- update (search);
-
- g_object_notify (G_OBJECT (search), "settings");
-}
-
-/**
* gtk_source_search_context_get_highlight:
* @search: a #GtkSourceSearchContext.
*
diff --git a/gtksourceview/gtksourcesearchcontext.h b/gtksourceview/gtksourcesearchcontext.h
index dcafa13..ce1a8de 100644
--- a/gtksourceview/gtksourcesearchcontext.h
+++ b/gtksourceview/gtksourcesearchcontext.h
@@ -72,10 +72,6 @@ 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_DEPRECATED_IN_3_24_FOR (gtk_source_search_context_new)
-void gtk_source_search_context_set_settings (GtkSourceSearchContext
*search,
- GtkSourceSearchSettings
*settings);
-
GTK_SOURCE_AVAILABLE_IN_3_10
gboolean gtk_source_search_context_get_highlight (GtkSourceSearchContext
*search);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]