diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-10-24 19:19:20 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-10-24 19:19:20 -0500 |
commit | 1ad4f0f5a54d0e3fecc5e29ea3f8808cbd82a937 (patch) | |
tree | 2d2032ad66a6d843a8fbf406c1a869bd7186a016 /src | |
parent | 506ae9ce557174f5ecc2dc09738c6c1659d4b040 (diff) | |
download | ayatana-indicator-bluetooth-1ad4f0f5a54d0e3fecc5e29ea3f8808cbd82a937.tar.gz ayatana-indicator-bluetooth-1ad4f0f5a54d0e3fecc5e29ea3f8808cbd82a937.tar.bz2 ayatana-indicator-bluetooth-1ad4f0f5a54d0e3fecc5e29ea3f8808cbd82a937.zip |
don't leak implicitly-created GVariants
Diffstat (limited to 'src')
-rw-r--r-- | src/desktop.vala | 12 | ||||
-rw-r--r-- | src/profile.vala | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/desktop.vala b/src/desktop.vala index 267cf27..3c21124 100644 --- a/src/desktop.vala +++ b/src/desktop.vala @@ -104,10 +104,10 @@ class Desktop: Profile debug (@"creating action for $action_name"); var a = new SimpleAction.stateful (action_name, null, - device.is_connected); + new Variant.boolean (device.is_connected)); a.activate.connect (() - => a.set_state (!a.get_state().get_boolean())); + => a.set_state (new Variant.boolean (!a.get_state().get_boolean()))); a.notify["state"].connect (() => bluetooth.set_device_connected (id, a.get_state().get_boolean())); @@ -119,7 +119,7 @@ class Desktop: Profile { debug (@"updating action $(device.id) state to $(device.is_connected)"); var action = connect_actions.lookup (device.id); - action.set_state (device.is_connected); + action.set_state (new Variant.boolean (device.is_connected)); } return item; @@ -218,16 +218,16 @@ class Desktop: Profile { var action = new SimpleAction.stateful ("desktop-discoverable", null, - bluetooth.discoverable); + new Variant.boolean (bluetooth.discoverable)); action.activate.connect (() - => action.set_state (!action.get_state().get_boolean())); + => action.set_state (new Variant.boolean (!action.get_state().get_boolean()))); action.notify["state"].connect (() => bluetooth.try_set_discoverable (action.get_state().get_boolean())); bluetooth.notify["discoverable"].connect (() - => action.set_state (bluetooth.discoverable)); + => action.set_state (new Variant.boolean (bluetooth.discoverable))); return action; } diff --git a/src/profile.vala b/src/profile.vala index 584af56..6aedec3 100644 --- a/src/profile.vala +++ b/src/profile.vala @@ -111,10 +111,10 @@ class Profile: Object { var action = new SimpleAction.stateful ("bluetooth-supported", null, - bluetooth.supported); + new Variant.boolean (bluetooth.supported)); bluetooth.notify["supported"].connect (() - => action.set_state (bluetooth.supported)); + => action.set_state (new Variant.boolean (bluetooth.supported))); return action; } @@ -123,16 +123,16 @@ class Profile: Object { var action = new SimpleAction.stateful ("bluetooth-enabled", null, - bluetooth.enabled); + new Variant.boolean (bluetooth.enabled)); action.activate.connect (() - => action.change_state (!action.get_state().get_boolean())); + => action.change_state (new Variant.boolean (!action.get_state().get_boolean()))); action.change_state.connect ((action, requestedValue) => bluetooth.try_set_enabled (requestedValue.get_boolean())); bluetooth.notify["enabled"].connect (() - => action.set_state (bluetooth.enabled)); + => action.set_state (new Variant.boolean (bluetooth.enabled))); return action; } |