[totem] rotation: Use explicit .begin()/.end for async Vala calls



commit cf143e0320a21c4833e476485b0ec480fda9501f
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Sep 30 13:12:05 2013 +0100

    rotation: Use explicit .begin()/.end for async Vala calls
    
    This removes a compilation warning and makes the code a little clearer.

 src/plugins/rotation/totem-rotation-plugin.vala |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/rotation/totem-rotation-plugin.vala b/src/plugins/rotation/totem-rotation-plugin.vala
index 1bc571e..9a3c3ec 100644
--- a/src/plugins/rotation/totem-rotation-plugin.vala
+++ b/src/plugins/rotation/totem-rotation-plugin.vala
@@ -66,7 +66,9 @@ class RotationPlugin: GLib.Object, Peas.Activatable
 
         // read the state of the current video from the GIO attribute
         if (mrl != null) {
-            this.try_restore_state (mrl);
+            this.try_restore_state.begin (mrl, (o, r) => {
+                this.try_restore_state.end (r);
+            });
         }
 
         t.file_closed.connect (this.cb_file_closed);
@@ -101,14 +103,14 @@ class RotationPlugin: GLib.Object, Peas.Activatable
     {
         int state = (this.bvw.get_rotation() - 1) % STATE_COUNT;
         this.bvw.set_rotation ((Bacon.Rotation) state);
-        this.store_state ();
+        this.store_state.begin ((o, r) => { this.store_state.end (r); });
     }
 
     private void cb_rotate_right ()
     {
         int state = (this.bvw.get_rotation() + 1) % STATE_COUNT;
         this.bvw.set_rotation ((Bacon.Rotation) state);
-        this.store_state ();
+        this.store_state.begin ((o, r) => { this.store_state.end (r); });
     }
 
     private void cb_file_closed ()
@@ -123,7 +125,9 @@ class RotationPlugin: GLib.Object, Peas.Activatable
     {
         this.rotate_right_action.set_enabled (true);
         this.rotate_left_action.set_enabled (true);
-        this.try_restore_state (mrl);
+        this.try_restore_state.begin (mrl, (o, r) => {
+            this.try_restore_state.end (r);
+        });
     }
 
     private async void store_state ()


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