[gnome-builder/wip/gtk4-port: 2/7] plugins/buildui: Port GbpBuilduiEditorPageAddin




commit 9f49ac2289b11e80bd47dacdf20a11d4468b3551
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Apr 30 09:08:51 2022 -0300

    plugins/buildui: Port GbpBuilduiEditorPageAddin
    
    This is an easy one, should have ported together with the first
    batch of buildui ports.

 src/plugins/buildui/buildui-plugin.c                |  4 ++--
 src/plugins/buildui/gbp-buildui-editor-page-addin.c | 14 ++++++++------
 src/plugins/buildui/meson.build                     |  2 +-
 3 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/src/plugins/buildui/buildui-plugin.c b/src/plugins/buildui/buildui-plugin.c
index 33f4f8c88..c0e1eb62c 100644
--- a/src/plugins/buildui/buildui-plugin.c
+++ b/src/plugins/buildui/buildui-plugin.c
@@ -28,7 +28,7 @@
 #include <libide-tree.h>
 
 //#include "gbp-buildui-config-view-addin.h"
-//#include "gbp-buildui-editor-page-addin.h"
+#include "gbp-buildui-editor-page-addin.h"
 #include "gbp-buildui-workspace-addin.h"
 #include "gbp-buildui-tree-addin.h"
 
@@ -39,10 +39,10 @@ _gbp_buildui_register_types (PeasObjectModule *module)
   peas_object_module_register_extension_type (module,
                                               IDE_TYPE_CONFIG_VIEW_ADDIN,
                                               GBP_TYPE_BUILDUI_CONFIG_VIEW_ADDIN);
+#endif
   peas_object_module_register_extension_type (module,
                                               IDE_TYPE_EDITOR_PAGE_ADDIN,
                                               GBP_TYPE_BUILDUI_EDITOR_PAGE_ADDIN);
-#endif
   peas_object_module_register_extension_type (module,
                                               IDE_TYPE_WORKSPACE_ADDIN,
                                               GBP_TYPE_BUILDUI_WORKSPACE_ADDIN);
diff --git a/src/plugins/buildui/gbp-buildui-editor-page-addin.c 
b/src/plugins/buildui/gbp-buildui-editor-page-addin.c
index 427f3e9a0..aabbdef3a 100644
--- a/src/plugins/buildui/gbp-buildui-editor-page-addin.c
+++ b/src/plugins/buildui/gbp-buildui-editor-page-addin.c
@@ -63,16 +63,17 @@ parse_version (const gchar *str,
 
 static void
 on_push_snippet_cb (GbpBuilduiEditorPageAddin *self,
-                    IdeSnippet                *snippet,
-                    const GtkTextIter         *iter,
+                    GtkSourceSnippet          *snippet,
+                    GtkTextIter               *iter,
                     IdeSourceView             *view)
 {
   g_autoptr(IdeContext) context = NULL;
   g_autofree gchar *project_version = NULL;
+  GtkSourceSnippetContext *snippet_context;
   GtkTextBuffer *buffer;
 
   g_assert (IDE_IS_MAIN_THREAD ());
-  g_assert (IDE_IS_SNIPPET (snippet));
+  g_assert (GTK_SOURCE_IS_SNIPPET (snippet));
   g_assert (IDE_IS_SOURCE_VIEW (view));
 
   buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
@@ -105,9 +106,10 @@ on_push_snippet_cb (GbpBuilduiEditorPageAddin *self,
         }
     }
 
-  ide_snippet_context_add_variable (ide_snippet_get_context (snippet),
-                                    "project_version",
-                                    project_version ?: "");
+  snippet_context = gtk_source_snippet_get_context (snippet);
+  gtk_source_snippet_context_set_variable (snippet_context,
+                                           "project_version",
+                                           project_version ?: "");
 }
 
 static void
diff --git a/src/plugins/buildui/meson.build b/src/plugins/buildui/meson.build
index 059368039..ce335f70f 100644
--- a/src/plugins/buildui/meson.build
+++ b/src/plugins/buildui/meson.build
@@ -2,7 +2,7 @@ plugins_sources += files([
   'buildui-plugin.c',
   #'gbp-buildui-config-surface.c',
   #'gbp-buildui-config-view-addin.c',
-  #'gbp-buildui-editor-page-addin.c',
+  'gbp-buildui-editor-page-addin.c',
   'gbp-buildui-log-pane.c',
   'gbp-buildui-omni-bar-section.c',
   'gbp-buildui-pane.c',


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