[gnome-boxes] os-database: Make some methods static



commit efd06d56650afbbc0d3f4509ff157069b5f8c47f
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Dec 3 18:34:16 2013 +0000

    os-database: Make some methods static
    
    So that one doesn't need an instance of OSDatabase to use these
    state-less methods.

 src/libvirt-machine-properties.vala |    2 +-
 src/os-database.vala                |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 22a9610..b5bfbec 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -386,7 +386,7 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
         }
 
         var architecture = machine.domain_config.get_os ().get_arch ();
-        var resources = os_db.get_recommended_resources_for_os (os, architecture);
+        var resources = OSDatabase.get_recommended_resources_for_os (os, architecture);
         if (resources != null) {
             if (ram_property != null)
                 ram_property.recommended = resources.ram;
diff --git a/src/os-database.vala b/src/os-database.vala
index df92add..2d57331 100644
--- a/src/os-database.vala
+++ b/src/os-database.vala
@@ -168,7 +168,7 @@ 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) {
+    public static Resources? get_recommended_resources_for_os (Os os, string architecture) {
         string[] prefs = { architecture, ARCHITECTURE_ALL };
 
         var list = os.get_recommended_resources ();
@@ -200,7 +200,7 @@ private class Boxes.OSDatabase : GLib.Object {
         return resources;
     }
 
-    private Resources? get_prefered_resources (ResourcesList list, string[] prefs) {
+    private static Resources? get_prefered_resources (ResourcesList list, string[] prefs) {
         if (prefs.length <= 0)
             return null;
 
@@ -213,7 +213,7 @@ private class Boxes.OSDatabase : GLib.Object {
             return filtered.get_nth (0) as Resources;
     }
 
-    private ResourcesList filter_resources_list_by_arch (ResourcesList list, string arch) {
+    private static ResourcesList filter_resources_list_by_arch (ResourcesList list, string arch) {
         var new_list = new ResourcesList ();
         foreach (var entity in list.get_elements ()) {
             var resources = entity as Resources;


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