[gnome-boxes/downloads-fixups: 6/6] wizard-downloads-search: Show recommended OSes as search results



commit b60c734b229eb90c20cafa8ba71085d23051fb29
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Nov 13 14:27:37 2018 +0100

    wizard-downloads-search: Show recommended OSes as search results
    
    The recommended downloads list should have a precedence over the
    Osinfo downloadable filter. So if a vendor wants to enforce some
    OS to appear, that doesn't need to satisfy the current filters.
    
    This also fixes the problem of having OSes such as RHEL not
    appearing in the search results, since they don't have an explicit
    URL for download, but require a custom handling.
    
    Fixes #249

 src/search.vala | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/search.vala b/src/search.vala
index dac57970..a416f26d 100644
--- a/src/search.vala
+++ b/src/search.vala
@@ -40,12 +40,20 @@
         os_db.list_downloadable_oses.begin ((db, result) => {
             try {
                 media_list = os_db.list_downloadable_oses.end (result);
+
+                load_recommended_downloads.begin ();
             } catch (OSDatabaseError error) {
                 debug ("Failed to populate the list of downloadable OSes: %s", error.message);
             }
         });
     }
 
+    private async void load_recommended_downloads () {
+        foreach (var media in yield get_recommended_downloads ()) {
+            media_list.append (media);
+        }
+    }
+
     public void show_all () {
         foreach (var media in media_list) {
             model.append (media);


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