[gnome-boxes] Assume installer media for all native URIs/paths



commit 3cb8eed06e39ec243d50e9f0b252ddfb03da7472
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Nov 17 01:15:10 2011 +0200

    Assume installer media for all native URIs/paths
    
    Without this change if you pass uri/path to a mount point (e.g
    /media/Fedora16) rather than path to device itself, boxes will bail-out
    with a 'Invalid URI' error.

 src/wizard.vala |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/wizard.vala b/src/wizard.vala
index 84868fd..a94766c 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -155,17 +155,21 @@ private class Boxes.Wizard: Boxes.UI {
     }
 
     private void prepare_for_location (string location) throws GLib.Error {
-        bool uncertain;
-
-        var mimetype = ContentType.guess (location, null, out uncertain);
+        var file = File.new_for_uri (location);
 
-        if (uncertain)
-            prepare_for_uri (location);
-        else if (ContentType.is_a (mimetype, "application/x-cd-image"))
-            // FIXME: We are assuming that its local URI
+        if (file.is_native ())
+            // FIXME: We should able to handle non-local URIs here too
             prepare_for_installer (location);
-        else
-            debug ("FIXME: %s".printf (mimetype));
+        else {
+            bool uncertain;
+
+            var mimetype = ContentType.guess (location, null, out uncertain);
+
+            if (uncertain)
+                prepare_for_uri (location);
+            else
+                debug ("FIXME: %s".printf (mimetype));
+        }
     }
 
     private void prepare_for_uri (string uri_as_text) throws Boxes.Error {



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