[gnome-builder/wip/beniofel/media-controls] indentation and try/catch for dbus
- From: Ben Iofel <beniofel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/beniofel/media-controls] indentation and try/catch for dbus
- Date: Wed, 20 Jan 2016 05:24:00 +0000 (UTC)
commit 01ea15c94e69d3e43503c2814ea6bee38ee08caa
Author: Ben Iofel <iofelben gmail com>
Date: Wed Jan 20 00:23:53 2016 -0500
indentation and try/catch for dbus
plugins/media-controls/media-controls.vala | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/plugins/media-controls/media-controls.vala b/plugins/media-controls/media-controls.vala
index eb75a43..df090db 100644
--- a/plugins/media-controls/media-controls.vala
+++ b/plugins/media-controls/media-controls.vala
@@ -29,14 +29,18 @@ public class Ide.MediaControls : GLib.Object, Ide.WorkbenchAddin {
Mpris? mpris = null;
Bus.get_proxy.begin<Mpris> (BusType.SESSION,
-
"org.mpris.MediaPlayer2.spotify",
- "/org/mpris/MediaPlayer2",
- 0, null,
- (obj, res) => {
- mpris = Bus.get_proxy.end (res);
- back.clicked.connect (button => mpris.previous ());
- play.clicked.connect (button => mpris.play_pause ());
- forward.clicked.connect (button => mpris.next ());
+ "org.mpris.MediaPlayer2.spotify",
+ "/org/mpris/MediaPlayer2",
+ 0, null,
+ (obj, res) => {
+ try {
+ mpris = Bus.get_proxy.end (res);
+ back.clicked.connect (button => mpris.previous ());
+ play.clicked.connect (button => mpris.play_pause ());
+ forward.clicked.connect (button => mpris.next ());
+ } catch (IOError e) {
+ warning (e.message);
+ }
});
box.add (back);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]