[gnome-desktop/mcatanzaro/mr47-followup: 4/5] Go back to a filename parameter for GnomeBGSlideShow
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop/mcatanzaro/mr47-followup: 4/5] Go back to a filename parameter for GnomeBGSlideShow
- Date: Thu, 18 Jul 2019 21:00:20 +0000 (UTC)
commit 269682c4a03458c546c5ecd0cc08f40e712e51a6
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Thu Jul 18 15:26:23 2019 -0500
Go back to a filename parameter for GnomeBGSlideShow
I think GFile works well for the property, but not for the new function.
There's not much value in forcing API users to create a GFile
themselves, and if you already have a GFile it's trivial to get the
filename from it. Also, we forgot the (transfer none) annotation on the
parameter.
libgnome-desktop/gnome-bg-slide-show.c | 14 +++++++++++---
libgnome-desktop/gnome-bg-slide-show.h | 2 +-
2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/libgnome-desktop/gnome-bg-slide-show.c b/libgnome-desktop/gnome-bg-slide-show.c
index 6c107ba1..bc42e5cc 100644
--- a/libgnome-desktop/gnome-bg-slide-show.c
+++ b/libgnome-desktop/gnome-bg-slide-show.c
@@ -229,7 +229,7 @@ gnome_bg_slide_show_init (GnomeBGSlideShow *self)
/**
* gnome_bg_slide_show_new:
- * @file: The #GFile of the slide show
+ * @filename: The filename of the slide show
*
* Creates a new object to manage a slide show.
* window background between two #cairo_surface_ts.
@@ -237,11 +237,19 @@ gnome_bg_slide_show_init (GnomeBGSlideShow *self)
* Return value: the new #GnomeBGSlideShow
**/
GnomeBGSlideShow *
-gnome_bg_slide_show_new (GFile *file)
+gnome_bg_slide_show_new (const char *filename)
{
- return GNOME_BG_SLIDE_SHOW (g_object_new (GNOME_BG_TYPE_SLIDE_SHOW,
+ GFile *file;
+ GnomeBGSlideShow *self;
+
+ file = g_file_new_for_path (filename);
+
+ self = GNOME_BG_SLIDE_SHOW (g_object_new (GNOME_BG_TYPE_SLIDE_SHOW,
"file", file,
NULL));
+ g_object_unref (file);
+
+ return self;
}
static void
diff --git a/libgnome-desktop/gnome-bg-slide-show.h b/libgnome-desktop/gnome-bg-slide-show.h
index 4c3be7b8..bcf17137 100644
--- a/libgnome-desktop/gnome-bg-slide-show.h
+++ b/libgnome-desktop/gnome-bg-slide-show.h
@@ -59,7 +59,7 @@ struct _GnomeBGSlideShowClass
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeBGSlideShow, g_object_unref)
GType gnome_bg_slide_show_get_type (void);
-GnomeBGSlideShow *gnome_bg_slide_show_new (GFile *file);
+GnomeBGSlideShow *gnome_bg_slide_show_new (const char *filename);
gboolean gnome_bg_slide_show_load (GnomeBGSlideShow *self,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]