[gnome-builder/wip/gtk4-port] plugins/sysprof: add helper to get GFile for page



commit d8a7183d6c35d73a8345d1f2a73014e9957e80e4
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 17 16:23:24 2022 -0700

    plugins/sysprof: add helper to get GFile for page

 src/plugins/sysprof/gbp-sysprof-page.c | 4 ++--
 src/plugins/sysprof/gbp-sysprof-page.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/sysprof/gbp-sysprof-page.c b/src/plugins/sysprof/gbp-sysprof-page.c
index db20abf0b..56e334943 100644
--- a/src/plugins/sysprof/gbp-sysprof-page.c
+++ b/src/plugins/sysprof/gbp-sysprof-page.c
@@ -45,10 +45,10 @@ G_DEFINE_TYPE (GbpSysprofPage, gbp_sysprof_page, IDE_TYPE_PAGE)
 
 static GParamSpec *properties [N_PROPS];
 
-static GFile *
+GFile *
 gbp_sysprof_page_get_file (GbpSysprofPage *self)
 {
-  g_assert (GBP_IS_SYSPROF_PAGE (self));
+  g_return_val_if_fail (GBP_IS_SYSPROF_PAGE (self), NULL);
 
   return self->file;
 }
diff --git a/src/plugins/sysprof/gbp-sysprof-page.h b/src/plugins/sysprof/gbp-sysprof-page.h
index a668f0fac..a662d32cf 100644
--- a/src/plugins/sysprof/gbp-sysprof-page.h
+++ b/src/plugins/sysprof/gbp-sysprof-page.h
@@ -28,6 +28,7 @@ G_BEGIN_DECLS
 
 G_DECLARE_FINAL_TYPE (GbpSysprofPage, gbp_sysprof_page, GBP, SYSPROF_PAGE, IdePage)
 
-GbpSysprofPage *gbp_sysprof_page_new_for_file (GFile *file);
+GbpSysprofPage *gbp_sysprof_page_new_for_file (GFile          *file);
+GFile          *gbp_sysprof_page_get_file     (GbpSysprofPage *self);
 
 G_END_DECLS


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