[gnome-software/wip/kalev/require-distro-upgrade-artwork] Don't offer Fedora distro upgrades if we don't have correct artwork



commit 2dd8b607d2ba673c040aad7b6135f2ab447a468c
Author: Kalev Lember <klember redhat com>
Date:   Mon May 4 14:08:08 2020 +0200

    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.

 .../gs-plugin-fedora-pkgdb-collections.c                         | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c 
b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
index 2e6486c4..26602baa 100644
--- a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
+++ b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
@@ -294,9 +294,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;"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]