[gnome-boxes] media-manager: Work around vala bug#706517



commit 52ae6702349f0f3544a64b7794b85737297e908a
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Aug 21 20:05:12 2013 +0300

    media-manager: Work around vala bug#706517
    
    Its not one of those ugly work arounds and I'm pretty certain some
    people will find the resulting code from this minor change, more
    readable than before.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688798

 src/media-manager.vala |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/media-manager.vala b/src/media-manager.vala
index 270bd76..ad4f5f1 100644
--- a/src/media-manager.vala
+++ b/src/media-manager.vala
@@ -25,9 +25,12 @@ private class Boxes.MediaManager : Object {
 
     public async InstallerMedia create_installer_media_for_path (string       path,
                                                                  Cancellable? cancellable = null) throws 
GLib.Error {
-        var media = is_mime_type (path, "application/x-cd-image") ?
-                    yield new InstallerMedia.for_path (path, this, cancellable) :
-                    new InstalledMedia (path);
+        InstallerMedia media;
+
+        if (is_mime_type (path, "application/x-cd-image"))
+            media = yield new InstallerMedia.for_path (path, this, cancellable);
+        else
+            media = new InstalledMedia (path);
 
         return create_installer_media_from_media (media);
     }


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