[gnome-software] snap: Drop featured snap support
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] snap: Drop featured snap support
- Date: Mon, 23 Sep 2019 12:32:46 +0000 (UTC)
commit 266fed5b2af5d878eac1fe90a025298949ee8b2c
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Sep 20 14:12:32 2019 +0200
snap: Drop featured snap support
The banner for featured snaps was done using specially named screenshots and
was a workaround until Snaps supported a banner format. They now do but the
banners don't fit the existing GNOME Software banner in sizing or content.
The screenshot workaround is no longer supported so this feature won't work
anymore.
plugins/snap/gs-plugin-snap.c | 63 +------------------------------------------
1 file changed, 1 insertion(+), 62 deletions(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index b5616e27..57ca8e77 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -383,66 +383,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
return NULL;
}
-gboolean
-gs_plugin_add_featured (GsPlugin *plugin,
- GsAppList *list,
- GCancellable *cancellable,
- GError **error)
-{
- g_autoptr(GPtrArray) snaps = NULL;
- SnapdSnap *snap;
- g_autoptr(GsApp) app = NULL;
- const gchar *banner_url = NULL, *icon_url = NULL;
- g_autoptr(GString) background_css = NULL;
- g_autofree gchar *css = NULL;
-
- snaps = find_snaps (plugin, SNAPD_FIND_FLAGS_SCOPE_WIDE, "featured", NULL, cancellable, error);
-
- if (snaps == NULL)
- return FALSE;
-
- if (snaps->len == 0)
- return TRUE;
-
- /* use first snap as the featured app */
- snap = snaps->pdata[0];
- app = snap_to_app (plugin, snap);
-
- /* if has a screenshot called 'banner.png' or 'banner-icon.png' then use them for the banner */
- banner_url = get_media_url (snap, is_banner_image);
- icon_url = get_media_url (snap, is_banner_icon_image);
-
- background_css = g_string_new ("");
- if (icon_url != NULL)
- g_string_append_printf (background_css,
- "url('%s') left center / auto 100%% no-repeat, ",
- icon_url);
- else
- g_string_append_printf (background_css,
- "url('%s') left center / auto 100%% no-repeat, ",
- snapd_snap_get_icon (snap));
- if (banner_url != NULL)
- g_string_append_printf (background_css,
- "url('%s') center / cover no-repeat;",
- banner_url);
- else
- g_string_append_printf (background_css, "#FFFFFF;");
- css = g_strdup_printf ("border-color: #000000;\n"
- "text-shadow: 0 1px 1px rgba(255,255,255,0.5);\n"
- "color: #000000;\n"
- "outline-offset: 0;\n"
- "outline-color: alpha(#ffffff, 0.75);\n"
- "outline-style: dashed;\n"
- "outline-offset: 2px;\n"
- "background: %s;",
- background_css->str);
- gs_app_set_metadata (app, "GnomeSoftware::FeatureTile-css", css);
-
- gs_app_list_add (list, app);
-
- return TRUE;
-}
-
gboolean
gs_plugin_add_popular (GsPlugin *plugin,
GsAppList *list,
@@ -456,8 +396,7 @@ gs_plugin_add_popular (GsPlugin *plugin,
if (snaps == NULL)
return FALSE;
- /* skip first snap - it is used as the featured app */
- for (i = 1; i < snaps->len; i++) {
+ for (i = 0; i < snaps->len; i++) {
g_autoptr(GsApp) app = snap_to_app (plugin, g_ptr_array_index (snaps, i));
gs_app_list_add (list, app);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]