[gnome-software/gnome-3-32] snap: Populate media instead of deprecated screenshots
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-32] snap: Populate media instead of deprecated screenshots
- Date: Fri, 26 Jul 2019 04:26:51 +0000 (UTC)
commit b1a4574f3b69db8fcd58c0f1975763d3cd2c2411
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Jul 12 11:19:31 2019 +1200
snap: Populate media instead of deprecated screenshots
plugins/snap/gs-self-test.c | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/plugins/snap/gs-self-test.c b/plugins/snap/gs-self-test.c
index 7a1aa5cc..d76f19b7 100644
--- a/plugins/snap/gs-self-test.c
+++ b/plugins/snap/gs-self-test.c
@@ -74,26 +74,28 @@ make_snap (const gchar *name, SnapdSnapStatus status)
gchar *common_ids[] = { NULL };
g_autoptr(GDateTime) install_date = NULL;
g_autoptr(GPtrArray) apps = NULL;
- g_autoptr(GPtrArray) screenshots = NULL;
- SnapdScreenshot *screenshot;
+ g_autoptr(GPtrArray) media = NULL;
+ SnapdMedia *m;
install_date = g_date_time_new_utc (2017, 1, 2, 11, 23, 58);
apps = g_ptr_array_new_with_free_func (g_object_unref);
- screenshots = g_ptr_array_new_with_free_func (g_object_unref);
- screenshot = g_object_new (SNAPD_TYPE_SCREENSHOT,
- "url", "http://example.com/screenshot1.jpg",
- "width", 640,
- "height", 480,
- NULL);
- g_ptr_array_add (screenshots, screenshot);
- screenshot = g_object_new (SNAPD_TYPE_SCREENSHOT,
- "url", "http://example.com/screenshot2.jpg",
- "width", 1024,
- "height", 768,
- NULL);
- g_ptr_array_add (screenshots, screenshot);
+ media = g_ptr_array_new_with_free_func (g_object_unref);
+ m = g_object_new (SNAPD_TYPE_MEDIA,
+ "type", "screenshot",
+ "url", "http://example.com/screenshot1.jpg",
+ "width", 640,
+ "height", 480,
+ NULL);
+ g_ptr_array_add (media, m);
+ m = g_object_new (SNAPD_TYPE_MEDIA,
+ "type", "screenshot",
+ "url", "http://example.com/screenshot2.jpg",
+ "width", 1024,
+ "height", 768,
+ NULL);
+ g_ptr_array_add (media, m);
return g_object_new (SNAPD_TYPE_SNAP,
"apps", status == SNAPD_SNAP_STATUS_INSTALLED ? apps : NULL,
@@ -104,8 +106,8 @@ make_snap (const gchar *name, SnapdSnapStatus status)
"id", name,
"install-date", status == SNAPD_SNAP_STATUS_INSTALLED ? install_date : NULL,
"installed-size", status == SNAPD_SNAP_STATUS_INSTALLED ? 1000 : 0,
+ "media", status == SNAPD_SNAP_STATUS_AVAILABLE ? media : NULL,
"name", name,
- "screenshots", status == SNAPD_SNAP_STATUS_AVAILABLE ? screenshots : NULL,
"status", status,
"snap-type", SNAPD_SNAP_TYPE_APP,
"summary", "SUMMARY",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]