[gnome-boxes] installer: Add get_post_installable_drivers()



commit ad3a050030d6da8a525642706b215f68af80e30a
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Jan 28 00:45:35 2013 +0200

    installer: Add get_post_installable_drivers()
    
    Add method to fetch all post-installable device drivers.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691546

 src/unattended-installer.vala |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 4953087..ef8879d 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -714,13 +714,23 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
         }
     }
 
+    private delegate bool DriverTestFunction (DeviceDriver driver);
+
     private GLib.List<DeviceDriver> get_pre_installable_drivers () {
+        return get_drivers ((driver) => { return driver.get_pre_installable (); });
+    }
+
+    private GLib.List<DeviceDriver> get_post_installable_drivers () {
+        return get_drivers ((driver) => { return !driver.get_pre_installable (); });
+    }
+
+    private GLib.List<DeviceDriver> get_drivers (DriverTestFunction test_func) {
         var drivers = new GLib.List<DeviceDriver> ();
 
         foreach (var d in os.get_device_drivers ().get_elements ()) {
             var driver = d as DeviceDriver;
 
-            if (!driver.get_pre_installable ())
+            if (!test_func (driver))
                 continue;
 
             var compatibility = compare_cpu_architectures (os_media.architecture, driver.get_architecture 
());


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