Commit 57e05058 authored by Kalev Lember's avatar Kalev Lember

Don't offer Fedora distro upgrades if we don't have correct artwork

Make sure we have the artwork for the distro upgrade banner before
offering an upgrade. In practice, this means that we don't offer a
distro upgrade at all unless the user has first updated gnome-software
to the version available from in the updates repo.

This comes with a slight tradeoff that some people who never install
regular updates will not get the distro upgrade notification at all
after this change.
parent c59a9446
Pipeline #176188 passed with stage
in 3 minutes and 22 seconds
......@@ -248,6 +248,7 @@ _sort_items_cb (gconstpointer a, gconstpointer b)
static GsApp *
_create_upgrade_from_info (GsPlugin *plugin, PkgdbItem *item)
{
GsPluginData *priv = gs_plugin_get_data (plugin);
GsApp *app;
g_autofree gchar *app_id = NULL;
g_autofree gchar *app_version = NULL;
......@@ -294,9 +295,14 @@ _create_upgrade_from_info (GsPlugin *plugin, PkgdbItem *item)
item->version);
gs_app_set_url (app, AS_URL_KIND_HOMEPAGE, url);
/* use a fancy background if possible */
background = _get_upgrade_css_background (item->version);
if (background != NULL) {
if (background == NULL) {
/* require fancy background for upgrades, except for when
* testing pre-releases with show-upgrade-prerelease key set */
if (!g_settings_get_boolean (priv->settings, "show-upgrade-prerelease"))
return NULL;
} else {
/* use a fancy background */
css = g_strdup_printf ("background: %s;"
"background-position: top;"
"background-size: cover;"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment