[gnome-builder] devhelp: use documentation-requested from IdeSourceView



commit 799a9c23bc57deeeeae3fea31057ae2d51774aca
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jul 1 15:42:23 2017 -0700

    devhelp: use documentation-requested from IdeSourceView

 plugins/devhelp/gbp-devhelp-editor-view-addin.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/plugins/devhelp/gbp-devhelp-editor-view-addin.c b/plugins/devhelp/gbp-devhelp-editor-view-addin.c
index c3d4b79..441acd9 100644
--- a/plugins/devhelp/gbp-devhelp-editor-view-addin.c
+++ b/plugins/devhelp/gbp-devhelp-editor-view-addin.c
@@ -32,18 +32,20 @@ G_DEFINE_TYPE_EXTENDED (GbpDevhelpEditorViewAddin, gbp_devhelp_editor_view_addin
                         G_IMPLEMENT_INTERFACE (IDE_TYPE_EDITOR_VIEW_ADDIN, iface_init))
 
 static void
-request_documentation_cb (GbpDevhelpEditorViewAddin *self,
-                          const gchar               *word,
-                          IdeEditorView             *view)
+documentation_requested_cb (GbpDevhelpEditorViewAddin *self,
+                            const gchar               *word,
+                            IdeSourceView             *source_view)
 {
   GtkWidget *layout;
   GtkWidget *panel;
   GtkWidget *pane;
 
-  g_assert (IDE_IS_EDITOR_VIEW (view));
   g_assert (GBP_IS_DEVHELP_EDITOR_VIEW_ADDIN (self));
+  g_assert (IDE_IS_SOURCE_VIEW (source_view));
+
+  /* TODO: This would be much better as a GAction */
 
-  layout = gtk_widget_get_ancestor (GTK_WIDGET (view), IDE_TYPE_LAYOUT);
+  layout = gtk_widget_get_ancestor (GTK_WIDGET (source_view), IDE_TYPE_LAYOUT);
   if (layout == NULL)
     return;
 
@@ -59,9 +61,9 @@ gbp_devhelp_editor_view_addin_load (IdeEditorViewAddin *addin,
   g_assert (GBP_IS_DEVHELP_EDITOR_VIEW_ADDIN (addin));
   g_assert (IDE_IS_EDITOR_VIEW (view));
 
-  g_signal_connect_object (view,
-                           "request-documentation",
-                           G_CALLBACK (request_documentation_cb),
+  g_signal_connect_object (ide_editor_view_get_view (view),
+                           "documentation-requested",
+                           G_CALLBACK (documentation_requested_cb),
                            addin,
                            G_CONNECT_SWAPPED);
 }


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