[gnome-boxes/update-downloadable-oses: 1/2] wizard-source: Use get_recommended_downloads in the frontpage
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/update-downloadable-oses: 1/2] wizard-source: Use get_recommended_downloads in the frontpage
- Date: Thu, 22 Nov 2018 14:59:58 +0000 (UTC)
commit a4829f2a0712b19b41a83497d7816d36a16a9435
Author: Felipe Borges <felipeborges gnome org>
Date: Thu Nov 22 15:53:13 2018 +0100
wizard-source: Use get_recommended_downloads in the frontpage
We also recommend some downloads in the wizard's frontpage when
there aren't medias index by tracker to list.
src/wizard-source.vala | 26 ++++----------------------
1 file changed, 4 insertions(+), 22 deletions(-)
---
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 5b14bfa8..6868122e 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -285,12 +285,6 @@ private void on_notify_estimated_load_progress () {
public string filename { get; set; }
- private string[] recommended_downloads = {
- "http://ubuntu.com/ubuntu/16.04",
- "http://opensuse.org/opensuse/42.3",
- "http://fedoraproject.org/fedora/27",
- };
-
public bool download_required {
get {
string scheme = Uri.parse_scheme (uri);
@@ -390,25 +384,13 @@ public void setup_ui (AppWindow window) {
downloads_vbox.bind_model (downloads_model, create_downloadable_entry);
- populate_recommended_downloads ();
+ populate_recommended_downloads.begin ();
}
- private void populate_recommended_downloads () {
+ private async void populate_recommended_downloads () {
var os_db = media_manager.os_db;
- foreach (var os_id in recommended_downloads) {
- os_db.get_os_by_id.begin (os_id, (obj, res) => {
- try {
- var os = os_db.get_os_by_id.end (res);
-
- // TODO: Select the desktop/workstation variant.
- var media = os.get_media_list ().get_nth (0) as Osinfo.Media;
-
- downloads_model.append (media);
- } catch (OSDatabaseError error) {
- warning ("Failed to find OS with ID '%s': %s", os_id, error.message);
- return;
- }
- });
+ foreach (var media in yield get_recommended_downloads ()) {
+ downloads_model.append (media);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]