[gnome-builder/wip/gtk4-port] libide/editor: make project-tree reveal work
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] libide/editor: make project-tree reveal work
- Date: Thu, 7 Apr 2022 04:47:22 +0000 (UTC)
commit 76d8d5b612876dcf9aed6361144b23a72b7ced6a
Author: Christian Hergert <chergert redhat com>
Date: Wed Apr 6 21:47:17 2022 -0700
libide/editor: make project-tree reveal work
src/libide/editor/ide-editor-page.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/src/libide/editor/ide-editor-page.c b/src/libide/editor/ide-editor-page.c
index 5914f1e1d..2acbe3c89 100644
--- a/src/libide/editor/ide-editor-page.c
+++ b/src/libide/editor/ide-editor-page.c
@@ -215,6 +215,23 @@ ide_editor_page_root (GtkWidget *widget)
IDE_EXIT;
}
+static GFile *
+ide_editor_page_get_file_or_directory (IdePage *page)
+{
+ GFile *ret;
+
+ IDE_ENTRY;
+
+ g_assert (IDE_IS_EDITOR_PAGE (page));
+
+ ret = ide_buffer_get_file (IDE_EDITOR_PAGE (page)->buffer);
+
+ if (ret != NULL)
+ g_object_ref (ret);
+
+ IDE_RETURN (ret);
+}
+
static void
ide_editor_page_dispose (GObject *object)
{
@@ -281,6 +298,7 @@ ide_editor_page_class_init (IdeEditorPageClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ IdePageClass *page_class = IDE_PAGE_CLASS (klass);
object_class->dispose = ide_editor_page_dispose;
object_class->get_property = ide_editor_page_get_property;
@@ -289,6 +307,8 @@ ide_editor_page_class_init (IdeEditorPageClass *klass)
widget_class->grab_focus = ide_editor_page_grab_focus;
widget_class->root = ide_editor_page_root;
+ page_class->get_file_or_directory = ide_editor_page_get_file_or_directory;
+
/**
* IdeEditorPage:buffer:
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]