[gtksourceview/wip/chergert/gsv-gtk4] snippets: use "focus-position" for property name



commit 86f4ae1ff46b64f832bcdb3230f9f5db1d9eb40c
Author: Christian Hergert <chergert redhat com>
Date:   Wed Sep 9 14:16:50 2020 -0700

    snippets: use "focus-position" for property name
    
    This is more consistent with the accessor function.

 gtksourceview/gtksourcesnippet.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gtksourceview/gtksourcesnippet.c b/gtksourceview/gtksourcesnippet.c
index b9b8bf1f..b1bc5912 100644
--- a/gtksourceview/gtksourcesnippet.c
+++ b/gtksourceview/gtksourcesnippet.c
@@ -84,9 +84,9 @@ enum {
        PROP_0,
        PROP_BUFFER,
        PROP_DESCRIPTION,
+       PROP_FOCUS_POSITION,
        PROP_LANGUAGE_ID,
        PROP_NAME,
-       PROP_POSITION,
        PROP_TRIGGER,
        N_PROPS
 };
@@ -490,6 +490,8 @@ gtk_source_snippet_select_chunk (GtkSourceSnippet      *snippet,
 
        gtk_text_buffer_select_range (snippet->buffer, &begin, &end);
 
+       g_object_notify_by_pspec (G_OBJECT (snippet), properties [PROP_FOCUS_POSITION]);
+
 #ifndef G_DISABLE_ASSERT
        {
                GtkTextIter set_begin;
@@ -1357,7 +1359,7 @@ gtk_source_snippet_get_property (GObject    *object,
                g_value_set_string (value, snippet->name);
                break;
 
-       case PROP_POSITION:
+       case PROP_FOCUS_POSITION:
                g_value_set_uint (value, snippet->focus_position);
                break;
 
@@ -1452,10 +1454,10 @@ gtk_source_snippet_class_init (GtkSourceSnippetClass *klass)
                                      G_PARAM_EXPLICIT_NOTIFY |
                                      G_PARAM_STATIC_STRINGS));
 
-       properties[PROP_POSITION] =
-               g_param_spec_int ("position",
-                                 "Position",
-                                 "The current position",
+       properties[PROP_FOCUS_POSITION] =
+               g_param_spec_int ("focus-position",
+                                 "Focus Position",
+                                 "The currently focused chunk",
                                  -1,
                                  G_MAXINT,
                                  -1,


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