[gnome-software] snap: Remove legacy screenshot code
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] snap: Remove legacy screenshot code
- Date: Thu, 5 Dec 2019 08:32:30 +0000 (UTC)
commit a07e7b0422842dfd157e4c5bceca714ae2d229ac
Author: Robert Ancell <robert ancell canonical com>
Date: Thu Nov 28 12:44:17 2019 +1300
snap: Remove legacy screenshot code
Snapd moved from "screenshots" to "media". The screenshots array now just
contains a note in JSON that is generating warnings.
plugins/snap/gs-plugin-snap.c | 33 +--------------------------------
1 file changed, 1 insertion(+), 32 deletions(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index ece07ae8..f6fc2bc5 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -776,7 +776,7 @@ gs_plugin_snap_get_description_safe (SnapdSnap *snap)
static void
refine_screenshots (GsApp *app, SnapdSnap *snap)
{
- GPtrArray *media, *screenshots;
+ GPtrArray *media;
guint i;
media = snapd_snap_get_media (snap);
@@ -806,37 +806,6 @@ refine_screenshots (GsApp *app, SnapdSnap *snap)
as_screenshot_add_image (ss, image);
gs_app_add_screenshot (app, ss);
}
-
- if (gs_app_get_screenshots (app)->len > 0)
- return;
-
- /* fallback to old screenshots data */
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- screenshots = snapd_snap_get_screenshots (snap);
-G_GNUC_END_IGNORE_DEPRECATIONS
- for (i = 0; i < screenshots->len; i++) {
- SnapdScreenshot *screenshot = screenshots->pdata[i];
- const gchar *url;
- g_autofree gchar *filename = NULL;
- g_autoptr(AsScreenshot) ss = NULL;
- g_autoptr(AsImage) image = NULL;
-
- /* skip screenshots used for banner when app is featured */
- url = snapd_screenshot_get_url (screenshot);
- filename = g_path_get_basename (url);
- if (is_banner_image (filename) || is_banner_icon_image (filename))
- continue;
-
- ss = as_screenshot_new ();
- as_screenshot_set_kind (ss, AS_SCREENSHOT_KIND_NORMAL);
- image = as_image_new ();
- as_image_set_url (image, snapd_screenshot_get_url (screenshot));
- as_image_set_kind (image, AS_IMAGE_KIND_SOURCE);
- as_image_set_width (image, snapd_screenshot_get_width (screenshot));
- as_image_set_height (image, snapd_screenshot_get_height (screenshot));
- as_screenshot_add_image (ss, image);
- gs_app_add_screenshot (app, ss);
- }
}
gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]