[gnome-boxes/recommended-downloads-always-look-for-latest-version-in-osinfo-db: 4/5] downloader, logos: Fallback to "upgrades" when "derives_from" is empty
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/recommended-downloads-always-look-for-latest-version-in-osinfo-db: 4/5] downloader, logos: Fallback to "upgrades" when "derives_from" is empty
- Date: Wed, 2 Mar 2022 10:59:03 +0000 (UTC)
commit 5c3cb694b0bfd6f2882b0fae90da88bc7919c41c
Author: Felipe Borges <felipeborges gnome org>
Date: Wed Mar 2 11:48:37 2022 +0100
downloader, logos: Fallback to "upgrades" when "derives_from" is empty
Boxes iterates over the logo list based on the Osinfo "DERIVES_FROM"
relationship between OS versions.
In case of OSes like RHEL9, which don't derive directly from RHEL8,
we should use the "UPGRADES" relationship as a fallback. This helps
us always show an OS logo when available.
src/downloader.vala | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/src/downloader.vala b/src/downloader.vala
index d6b22abd..90b03db6 100644
--- a/src/downloader.vala
+++ b/src/downloader.vala
@@ -41,6 +41,9 @@ public static string fetch_os_logo_url (Osinfo.Os os) {
string logo_url = null;
var derived = os.get_related (Osinfo.ProductRelationship.DERIVES_FROM);
+ if (derived.get_length () == 0)
+ derived = os.get_related (Osinfo.ProductRelationship.UPGRADES);
+
while (derived.get_length () > 0 && logo_url == null) {
// FIXME: Does Osinfo allows deriving from multiple OSs?
var parent = derived.get_nth (0) as Osinfo.Os;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]