[gnome-boxes] util: Simplify run()



commit ba8de1d22b540eca56ed65972d59cdbaf11bad12
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat Jul 14 00:35:01 2012 +0300

    util: Simplify run()
    
    Basically it now just launches run_sync() through run_in_thread().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679896

 src/util.vala |   27 ++-------------------------
 1 files changed, 2 insertions(+), 25 deletions(-)
---
diff --git a/src/util.vala b/src/util.vala
index 8587d30..48df49b 100644
--- a/src/util.vala
+++ b/src/util.vala
@@ -462,32 +462,9 @@ namespace Boxes {
     }
 
     public async void exec (string[] argv, Cancellable? cancellable) throws GLib.Error {
-        SourceFunc continuation = exec.callback;
-        GLib.Error error = null;
-        var context = MainContext.get_thread_default ();
-
-        g_io_scheduler_push_job ((job) => {
-            try {
-                exec_sync (argv);
-            } catch (GLib.Error err) {
-                error = err;
-            }
-
-            var source = new IdleSource ();
-            source.set_callback (() => {
-                continuation ();
-
-                return false;
-            });
-            source.attach (context);
-
-            return false;
+        yield run_in_thread (() => {
+            exec_sync (argv);
         });
-
-        yield;
-
-        if (error != null)
-            throw error;
     }
 
     public void exec_sync (string[] argv) throws GLib.Error {



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