aboutsummaryrefslogtreecommitdiff
path: root/src/desktop.vala
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-08-06 15:33:26 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-08-06 15:33:26 -0500
commitb82c9a9de54e3659386a178926dc8ce99917c6f6 (patch)
tree3811f467837cd2cc49e0c2ef3872fdc156e24a4c /src/desktop.vala
parentdf2bb3084af551770e9cd3f3e9b4cf59c439041b (diff)
downloadayatana-indicator-bluetooth-b82c9a9de54e3659386a178926dc8ce99917c6f6.tar.gz
ayatana-indicator-bluetooth-b82c9a9de54e3659386a178926dc8ce99917c6f6.tar.bz2
ayatana-indicator-bluetooth-b82c9a9de54e3659386a178926dc8ce99917c6f6.zip
copyediting: whitespace, type inference
Diffstat (limited to 'src/desktop.vala')
-rw-r--r--src/desktop.vala27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/desktop.vala b/src/desktop.vala
index e4e7d04..588a584 100644
--- a/src/desktop.vala
+++ b/src/desktop.vala
@@ -72,7 +72,7 @@ class Desktop: Profile
bluetooth.devices_changed.connect (()=> {
if (idle_rebuild_id == 0)
idle_rebuild_id = Idle.add (() => {
- rebuild_device_section();
+ rebuild_device_section ();
idle_rebuild_id = 0;
return false;
});
@@ -90,20 +90,29 @@ class Desktop: Profile
MenuItem create_device_connection_menuitem (Device device)
{
- var action_name = @"desktop-device-$(device.id)-connected";
+ var id = device.id;
+ var action_name = @"desktop-device-$(id)-connected";
var item = new MenuItem (_("Connection"), @"indicator.$action_name");
- item.set_attribute ("x-canonical-type", "s", "com.canonical.indicator.switch");
+ item.set_attribute ("x-canonical-type",
+ "s", "com.canonical.indicator.switch");
// if this doesn't already have an action, create one
- if (!connect_actions.contains (device.id))
+ if (!connect_actions.contains (id))
{
debug (@"creating action for $action_name");
- var action = new SimpleAction.stateful (action_name, null, device.is_connected);
- action.activate.connect (() => action.set_state (!action.get_state().get_boolean()));
- action.notify["state"].connect (() => bluetooth.set_device_connected (device.id, action.get_state().get_boolean()));
- connect_actions.insert (device.id, action);
- action_group.insert (action);
+ var a = new SimpleAction.stateful (action_name,
+ null,
+ device.is_connected);
+
+ a.activate.connect (()
+ => a.set_state (!a.get_state().get_boolean()));
+
+ a.notify["state"].connect (()
+ => bluetooth.set_device_connected (id, a.get_state().get_boolean()));
+
+ connect_actions.insert (device.id, a);
+ action_group.insert (a);
}
else
{