[gnome-software: 4/5] data: Drop upgrade-background-uri GSettings key




commit c230156c6685c1654588d469a260b19c14897bb9
Author: Philip Withnall <pwithnall endlessos org>
Date:   Fri Feb 4 14:49:41 2022 +0000

    data: Drop upgrade-background-uri GSettings key
    
    The background image for upgrades should not be settable per-user. This
    was a hack to allow the background image to be set differently for
    different distributions using GSettings overrides.
    
    That’s now possible by dropping the background image in a well-known
    path, as documented in `doc/vendor-customisations.md`, so this hack can
    be removed.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 NEWS                                               |  3 ++-
 data/org.gnome.software.gschema.xml                |  5 ----
 .../gs-plugin-fedora-pkgdb-collections.c           | 31 ----------------------
 3 files changed, 2 insertions(+), 37 deletions(-)
---
diff --git a/NEWS b/NEWS
index ea1a7e37c..beec84cc7 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,8 @@ UNRELEASED
  * The background image for upgrades is now looked for using several well-known
    (and distribution-specific) names in `${DATADIR}/gnome-software/backgrounds`,
    and the previous Fedora-specific default background image is no longer
-   distributed. Distributions may need to update how they ship background
+   distributed. Similarly, the `upgrade-background-uri` GSettings key has been
+   removed. Distributions may need to update how they ship background
    images. See `doc/vendor-customisation.md`.
 
 Version 42.alpha
diff --git a/data/org.gnome.software.gschema.xml b/data/org.gnome.software.gschema.xml
index 895ac4389..bf43208d9 100644
--- a/data/org.gnome.software.gschema.xml
+++ b/data/org.gnome.software.gschema.xml
@@ -144,11 +144,6 @@
       <summary>Priority order of packaging formats to prefer, with more important formats listed first. An 
empty array means the default order. Omitted formats are assumed to be listed last. Example packaging formats 
are: deb, flatpak, rpm, snap.</summary>
     </key>
     <child name="auth" schema="org.gnome.software.auth"/>
-    <key name="upgrade-background-uri" type="s">
-      <default>''</default>
-      <summary>The URI that references the background for an upgrade banner.</summary>
-      <description>The URI can contain up to three '%u', which will be replaced by the upgrade 
version.</description>
-    </key>
   </schema>
   <schema id="org.gnome.software.auth" gettext-domain="gnome-software">
     <key name="account-id" type="s">
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 1aabe0186..7cd799d58 100644
--- a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
+++ b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
@@ -274,41 +274,10 @@ gs_plugin_refresh (GsPlugin *plugin,
 static gchar *
 _get_upgrade_css_background (guint version)
 {
-       g_autoptr(GSettings) settings = NULL;
        g_autofree gchar *version_str = g_strdup_printf ("%u", version);
        g_autofree gchar *filename0 = NULL;
        g_autofree gchar *filename1 = NULL;
        g_autofree gchar *filename2 = NULL;
-       g_autofree gchar *uri = NULL;
-
-       settings = g_settings_new ("org.gnome.software");
-       uri = g_settings_get_string (settings, "upgrade-background-uri");
-       if (uri != NULL && *uri != '\0') {
-               const gchar *ptr;
-               guint percents_u = 0;
-               for (ptr = uri; *ptr != '\0'; ptr++) {
-                       if (*ptr == '%') {
-                               if (ptr[1] == 'u')
-                                       percents_u++;
-                               else if (ptr[1] == '%')
-                                       ptr++;
-                               else
-                                       break;
-                       }
-               }
-
-               if (*ptr != '\0' || percents_u > 3) {
-                       g_warning ("Incorrect upgrade-background-uri (%s), it can contain only up to three 
'%%u' sequences", uri);
-               } else {
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
-                       filename1 = g_strdup_printf (uri, version, version, version);
-#pragma GCC diagnostic pop
-                       if (*filename1 == '/')
-                               return g_strdup_printf ("url('file://%s')", filename1);
-                       return g_strdup_printf ("url('%s')", filename1);
-               }
-       }
 
        /* Check the standard location. */
        filename0 = gs_utils_get_upgrade_background (version_str);


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