[gnome-builder/wip/gtk4-port] libide/editor: add compatibility helper
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] libide/editor: add compatibility helper
- Date: Fri, 29 Apr 2022 04:07:13 +0000 (UTC)
commit 4fca20f10d23c15285cb7242aa7fa49c1f6fde69
Author: Christian Hergert <chergert redhat com>
Date: Thu Apr 28 21:00:36 2022 -0700
libide/editor: add compatibility helper
src/libide/editor/ide-editor-page.c | 18 ++++++++++++++++++
src/libide/editor/ide-editor-page.h | 2 ++
2 files changed, 20 insertions(+)
---
diff --git a/src/libide/editor/ide-editor-page.c b/src/libide/editor/ide-editor-page.c
index 7dae8b0f7..433b2b7eb 100644
--- a/src/libide/editor/ide-editor-page.c
+++ b/src/libide/editor/ide-editor-page.c
@@ -476,6 +476,24 @@ ide_editor_page_get_buffer (IdeEditorPage *self)
return self->buffer;
}
+/**
+ * ide_editor_page_get_file:
+ * @self: a #IdeEditorPage
+ *
+ * Gets the file for the document.
+ *
+ * This is a convenience function around ide_buffer_get_file().
+ *
+ * Returns: (transfer none): a #GFile
+ */
+GFile *
+ide_editor_page_get_file (IdeEditorPage *self)
+{
+ g_return_val_if_fail (IDE_IS_EDITOR_PAGE (self), NULL);
+
+ return ide_buffer_get_file (self->buffer);
+}
+
static void
ide_editor_page_save_cb (GObject *object,
GAsyncResult *result,
diff --git a/src/libide/editor/ide-editor-page.h b/src/libide/editor/ide-editor-page.h
index 8722b616e..d49786292 100644
--- a/src/libide/editor/ide-editor-page.h
+++ b/src/libide/editor/ide-editor-page.h
@@ -43,6 +43,8 @@ IdeBuffer *ide_editor_page_get_buffer (IdeEditorPage *sel
IDE_AVAILABLE_IN_ALL
IdeSourceView *ide_editor_page_get_view (IdeEditorPage *self);
IDE_AVAILABLE_IN_ALL
+GFile *ide_editor_page_get_file (IdeEditorPage *self);
+IDE_AVAILABLE_IN_ALL
IdeGutter *ide_editor_page_get_gutter (IdeEditorPage *self);
IDE_AVAILABLE_IN_ALL
void ide_editor_page_set_gutter (IdeEditorPage *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]