[gnome-boxes/gnome-3-8] wizard: Don't hang on failure to handle a URL



commit e0d4d2c2d2082f272f0492934a598d12280986bd
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Aug 21 23:03:41 2013 +0300

    wizard: Don't hang on failure to handle a URL
    
    Boxes would just hang in wizard's preparation stage if you pass a path
    to a file on a locally mounted remote share (e.g SMB). Although the real
    solution is to be able to handle those, we should have this in place
    just in case this codepath is walked for some other reason.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688798

 src/wizard.vala |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/wizard.vala b/src/wizard.vala
index 14729f2..d007302 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -240,8 +240,12 @@ private class Boxes.Wizard: Boxes.UI {
 
             if (uncertain)
                 prepare_for_uri (uri);
-            else
-                debug ("FIXME: %s".printf (mimetype));
+            else {
+                debug ("Can't handle remote location '%s' (mime type: '%s')",
+                        uri,
+                        ContentType.get_mime_type (mimetype));
+                throw new Boxes.Error.INVALID (_("Invalid URI"));
+            }
         }
     }
 


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