[gnome-boxes/gnome-3-4] express: Make use of 'distro' data from libosinfo



commit 6f15da200d868e102939b7edf90828d83e0b0ce9
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Apr 10 18:32:37 2012 +0300

    express: Make use of 'distro' data from libosinfo
    
    No need to hardcode each fedora version anymore.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673847

 configure.ac           |    2 +-
 src/media-manager.vala |   26 +++++++++++++++-----------
 2 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5e9d63a..9edf67c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,7 +50,7 @@ LIBVIRT_GCONFIG_MIN_VERSION=0.0.7
 LIBXML2_MIN_VERSION=2.7.8
 SPICE_GTK_MIN_VERSION=0.9
 GUDEV_MIN_VERSION=165
-OSINFO_MIN_VERSION=0.0.6
+OSINFO_MIN_VERSION=0.1.1
 TRACKER_SPARQL=0.13.1
 
 PKG_CHECK_MODULES(BOXES, [
diff --git a/src/media-manager.vala b/src/media-manager.vala
index 664f45f..9be8727 100644
--- a/src/media-manager.vala
+++ b/src/media-manager.vala
@@ -106,20 +106,24 @@ private class Boxes.MediaManager : Object {
         if (media.os == null)
             return media;
 
-        switch (media.os.short_id) {
-        case "fedora14":
-        case "fedora15":
-        case "fedora16":
+        switch (media.os.distro) {
+        case "fedora":
             return new FedoraInstaller.copy (media);
 
-        case "win7":
-        case "win2k8":
-            return new Win7Installer.copy (media);
+        case "win":
+            switch (media.os.short_id) {
+            case "win7":
+            case "win2k8":
+                return new Win7Installer.copy (media);
 
-        case "winxp":
-        case "win2k":
-        case "win2k3":
-            return new WinXPInstaller.copy (media);
+            case "winxp":
+            case "win2k":
+            case "win2k3":
+                return new WinXPInstaller.copy (media);
+
+            default:
+                return media;
+            }
 
         default:
             return media;



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