[gnome-boxes] installer-media: Remove workaround for lack of async constructor



commit 3541f71e2e233c50df7f2da7b6cb3c3a36f0a5c9
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Feb 21 18:53:13 2013 +0200

    installer-media: Remove workaround for lack of async constructor
    
    Vala has had support for async constructors since 0.17.3 and we
    depend on 0.18.0 so no need for static methods workaround anymore.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694429

 src/installer-media.vala |   16 +++-------------
 src/media-manager.vala   |    2 +-
 2 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/src/installer-media.vala b/src/installer-media.vala
index c5ec559..69d3888 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -39,19 +39,9 @@ private class Boxes.InstallerMedia : GLib.Object {
         setup_label (label);
     }
 
-    public static async InstallerMedia create_for_path (string       path,
-                                                        MediaManager media_manager,
-                                                        Cancellable? cancellable) throws GLib.Error {
-        var media = new InstallerMedia ();
-
-        yield media.setup_for_path (path, media_manager, cancellable);
-
-        return media;
-    }
-
-    private async void setup_for_path (string       path,
-                                       MediaManager media_manager,
-                                       Cancellable? cancellable) throws GLib.Error {
+    public async InstallerMedia.for_path (string       path,
+                                          MediaManager media_manager,
+                                          Cancellable? cancellable) throws GLib.Error {
         var device = yield get_device_from_path (path, media_manager.client, cancellable);
 
         if (device != null)
diff --git a/src/media-manager.vala b/src/media-manager.vala
index 1e0c5b6..b6c71ca 100644
--- a/src/media-manager.vala
+++ b/src/media-manager.vala
@@ -28,7 +28,7 @@ private class Boxes.MediaManager : Object {
                                  InstallerRecognized? on_installer_recognized = null,
                                  ActivityProgress     progress = new ActivityProgress (),
                                  Cancellable?         cancellable = null) throws GLib.Error {
-        var media = yield InstallerMedia.create_for_path (path, this, cancellable);
+        var media = yield new InstallerMedia.for_path (path, this, cancellable);
 
         return yield create_installer_media_from_media (media, on_installer_recognized);
     }


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