summaryrefslogtreecommitdiff
path: root/src/plugins/rotation
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2013-09-30 13:12:05 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2013-09-30 13:12:05 +0100
commitcf143e0320a21c4833e476485b0ec480fda9501f (patch)
treed7f95ec885548d3cae92769d133f110e50935a42 /src/plugins/rotation
parent0fb4c0ec1f4cf4486ffe5dbc5ba3a4135cc0eae3 (diff)
downloadtotem-cf143e0320a21c4833e476485b0ec480fda9501f.tar.gz
rotation: Use explicit .begin()/.end for async Vala calls
This removes a compilation warning and makes the code a little clearer.
Diffstat (limited to 'src/plugins/rotation')
-rw-r--r--src/plugins/rotation/totem-rotation-plugin.vala12
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 1bc571ec3..9a3c3ec70 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 ()