[gnome-boxes/gnome-3-8] Disabling express install disables additional devices



commit f556149ccec2334a78438c9bb83ff5d3581347bd
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat May 18 22:52:34 2013 +0300

    Disabling express install disables additional devices
    
    We were assuming the existance of additional devices even when user was
    choosing to disable express installation while these devices are only
    made available through express installation. This effectively meant
    broken non-express installation for Windows XP and 7.
    
    Keep additional devices in a separate list to ensure that we don't assume
    their existence when express installation is disabled by user.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700477

 src/installer-media.vala      |   16 +++++-----------
 src/unattended-installer.vala |   19 +++++++++++++++++--
 2 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 0bf3eb2..16698b4 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -13,7 +13,11 @@ private class Boxes.InstallerMedia : GLib.Object {
     public string mount_point;
     public bool from_image;
 
-    public Osinfo.DeviceList supported_devices;
+    public virtual Osinfo.DeviceList supported_devices {
+        owned get {
+            return os.get_all_devices (null);
+        }
+    }
 
     public signal void user_wants_to_create (); // User wants to already create the VM
 
@@ -42,7 +46,6 @@ private class Boxes.InstallerMedia : GLib.Object {
         from_image = true;
 
         setup_label (label);
-        init_supported_devices ();
     }
 
     public async InstallerMedia.for_path (string       path,
@@ -60,7 +63,6 @@ private class Boxes.InstallerMedia : GLib.Object {
         }
 
         setup_label ();
-        init_supported_devices ();
 
         // FIXME: these values could be made editable somehow
         var architecture = (os_media != null) ? os_media.architecture : "i686";
@@ -121,14 +123,6 @@ private class Boxes.InstallerMedia : GLib.Object {
         domain.add_device (disk);
     }
 
-    private void init_supported_devices () {
-        if (os != null) {
-            var os_devices = os.get_all_devices (null) as Osinfo.List;
-            supported_devices = os_devices.new_copy () as Osinfo.DeviceList;
-        } else
-            supported_devices = new Osinfo.DeviceList ();
-    }
-
     private async GUdev.Device? get_device_from_path (string path, Client client, Cancellable? cancellable) {
         try {
             var mount_dir = File.new_for_path (path);
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 2448b15..7c250d7 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -24,6 +24,17 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
         }
     }
 
+    public override Osinfo.DeviceList supported_devices {
+        owned get {
+            var devices = base.supported_devices;
+
+            if (express_install)
+                return (devices as Osinfo.List).new_union (additional_devices) as Osinfo.DeviceList;
+            else
+                return devices;
+        }
+    }
+
     public bool express_install {
         get { return express_toggle.active; }
     }
@@ -78,6 +89,9 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
     private string kbd;
     private bool driver_signing = true;
 
+    // Devices made available by device drivers added through express installation (only).
+    private Osinfo.DeviceList additional_devices;
+
     private ulong key_inserted_id; // ID of key_entry.insert_text signal handler
 
     private static Fdo.Accounts? accounts;
@@ -108,7 +122,6 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
         from_image = media.from_image;
         mount_point = media.mount_point;
         resources = media.resources;
-        supported_devices = media.supported_devices;
 
         this.scripts = scripts;
         config = new InstallConfig ("http://live.gnome.org/Boxes/unattended";);
@@ -121,6 +134,8 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
             add_unattended_file (new UnattendedScriptFile (this, script, filename));
         }
 
+        additional_devices = new Osinfo.DeviceList ();
+
         timezone = get_timezone ();
         lang = get_preferred_language ();
         kbd = lang;
@@ -704,7 +719,7 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
             var driver_progress = progress.add_child_activity (driver_progress_scale);
             try {
                 yield setup_driver (driver, driver_progress, add_func, cancellable);
-                supported_devices.add_all (driver.get_devices ());
+                additional_devices.add_all (driver.get_devices ());
             } catch (GLib.Error e) {
                 debug ("Failed to make use of drivers at '%s': %s", driver.get_location (), e.message);
             } finally {


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