[gnome-boxes] Revert "Wait until all machines are suspended"



commit 2decebd6e1c9f91994063793baa5474f9270ea41
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Thu Sep 13 18:15:41 2012 +0200

    Revert "Wait until all machines are suspended"
    
    This reverts commit 524265e4132711ca7965bed9472b22103720ceec.
    I've totally missed Alex's concerns in bug #683473, let's revert this
    for now.

 src/app.vala |   33 +++++++--------------------------
 1 files changed, 7 insertions(+), 26 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 216f6a9..6054115 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -154,15 +154,6 @@ private class Boxes.App: Boxes.UI {
         application.activate.connect_after ((app) => {
             window.present ();
         });
-        application.shutdown.connect (() => {
-            MainLoop loop = new MainLoop ();
-            Idle.add (() => {
-                suspend_machines.begin (() => { loop.quit (); });
-                return false;
-                });
-            loop.run ();
-        });
-
     }
 
     public int run () {
@@ -573,29 +564,19 @@ private class Boxes.App: Boxes.UI {
         }
     }
 
-    private async void suspend_machines () {
-        var waiting_counter = 0;
-        debug ("Suspending running boxes");
+    public bool quit () {
+        notificationbar.cancel ();
+        save_window_geometry ();
+        window.hide ();
+
         foreach (var item in collection.items.data)
             if (item is LibvirtMachine) {
                 var machine = item as LibvirtMachine;
 
-                if (machine.connection == default_connection) {
-                    waiting_counter++;
-                    machine.suspend.begin (() => { suspend_machines.callback (); });
-                }
+                if (machine.connection == default_connection)
+                    machine.suspend.begin ();
             }
 
-        while (waiting_counter > 0) {
-            yield;
-            waiting_counter--;
-        }
-        debug ("Running boxes suspended");
-    }
-
-    public bool quit () {
-        notificationbar.cancel ();
-        save_window_geometry ();
         wizard.cleanup ();
         window.destroy ();
 



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