[gnome-boxes] Sane default sound & video devices for unknown OSs



commit 0df298ba1f6f504697879f67c6584aed80402940
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Mar 26 22:36:21 2012 +0300

    Sane default sound & video devices for unknown OSs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672872

 src/vm-configurator.vala |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 4f3e94e..53712d4 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -186,12 +186,10 @@ private class Boxes.VMConfigurator {
     }
 
     private void set_video_config (Domain domain, InstallerMedia install_media) {
-        var device = get_os_device_by_prop (install_media.os, DEVICE_PROP_CLASS, "video");
-        if (device == null)
-            return;
-
         var video = new DomainVideo ();
-        var model = get_enum_value (device.get_name (), typeof (DomainVideoModel));
+        var device = get_os_device_by_prop (install_media.os, DEVICE_PROP_CLASS, "video");
+        var model = (device != null)? get_enum_value (device.get_name (), typeof (DomainVideoModel)) :
+                                      DomainVideoModel.QXL;
         return_if_fail (model != -1);
         video.set_model ((DomainVideoModel) model);
 
@@ -199,12 +197,10 @@ private class Boxes.VMConfigurator {
     }
 
     private void set_sound_config (Domain domain, InstallerMedia install_media) {
-        var device = get_os_device_by_prop (install_media.os, DEVICE_PROP_CLASS, "audio");
-        if (device == null)
-            return;
-
         var sound = new DomainSound ();
-        var model = get_enum_value (device.get_name (), typeof (DomainSoundModel));
+        var device = get_os_device_by_prop (install_media.os, DEVICE_PROP_CLASS, "audio");
+        var model = (device != null)? get_enum_value (device.get_name (), typeof (DomainSoundModel)) :
+                                      DomainSoundModel.AC97;
         return_if_fail (model != -1);
         sound.set_model ((DomainSoundModel) model);
 



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