[gnome-boxes/show-recomended-resources: 6/8] os-database: Add get_recommended_resources_for_os()



commit b436bb2c47e8012157be604b4d36fd77986b1414
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Feb 5 23:06:21 2013 +0200

    os-database: Add get_recommended_resources_for_os()
    
    Add a method to retrieve recommended resources for an OS.

 src/os-database.vala |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/os-database.vala b/src/os-database.vala
index 2853647..7aae7ce 100644
--- a/src/os-database.vala
+++ b/src/os-database.vala
@@ -111,6 +111,16 @@ private class Boxes.OSDatabase : GLib.Object {
         return get_resources_from_os_resources (minimum, recommended);
     }
 
+    public Resources? get_recommended_resources_for_os (Os os, string architecture) {
+        var prefs = new string[0];
+        prefs += architecture;
+        prefs += ARCHITECTURE_ALL;
+
+        var list = os.get_recommended_resources ();
+
+        return get_prefered_resources (list, prefs);
+    }
+
     private Resources get_resources_from_os_resources (Resources? minimum, Resources? recommended) {
         var resources = get_default_resources ();
 



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