[gnome-boxes] installer: Add get_post_installer_scripts()



commit 4014fab8aa9d5ac7b590a52ec958aed5e03b349a
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Jan 28 00:38:23 2013 +0200

    installer: Add get_post_installer_scripts()
    
    Add method to fetch scripts that can install drivers at the end of OS
    installation.
    
    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 3e2f49d..4953087 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -733,13 +733,23 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
         return drivers;
     }
 
+    private delegate bool ScriptTestFunction (InstallScript script);
+
     private GLib.List<InstallScript> get_pre_installer_scripts () {
+        return get_scripts ((script) => { return script.get_can_pre_install_drivers (); });
+    }
+
+    private GLib.List<InstallScript> get_post_installer_scripts () {
+        return get_scripts ((script) => { return script.get_can_post_install_drivers (); });
+    }
+
+    private GLib.List<InstallScript> get_scripts (ScriptTestFunction test_func) {
         var scripts = new GLib.List<InstallScript> ();
 
         foreach (var s in this.scripts.get_elements ()) {
             var script = s as InstallScript;
 
-            if (script.get_can_pre_install_drivers ())
+            if (test_func (script))
                 scripts.append (script);
         }
 


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