Merge lp:~charlesk/indicator-bluetooth/lp-1244468 into lp:indicator-bluetooth/14.04

Proposed by Charles Kerr
Status: Merged
Approved by: Lars Karlitski
Approved revision: 74
Merged at revision: 74
Proposed branch: lp:~charlesk/indicator-bluetooth/lp-1244468
Merge into: lp:indicator-bluetooth/14.04
Diff against target: 82 lines (+11/-11)
2 files modified
src/desktop.vala (+6/-6)
src/profile.vala (+5/-5)
To merge this branch: bzr merge lp:~charlesk/indicator-bluetooth/lp-1244468
Reviewer Review Type Date Requested Status
Lars Karlitski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+192618@code.launchpad.net

Description of the change

explicitly instantiate GVariants to avoid leaking them. See the description in bug #1244468 for before & after C code and more information.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

Workaroundy, but looks fine to me. Nice find!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/desktop.vala'
2--- src/desktop.vala 2013-10-21 21:55:15 +0000
3+++ src/desktop.vala 2013-10-25 00:20:38 +0000
4@@ -104,10 +104,10 @@
5 debug (@"creating action for $action_name");
6 var a = new SimpleAction.stateful (action_name,
7 null,
8- device.is_connected);
9+ new Variant.boolean (device.is_connected));
10
11 a.activate.connect (()
12- => a.set_state (!a.get_state().get_boolean()));
13+ => a.set_state (new Variant.boolean (!a.get_state().get_boolean())));
14
15 a.notify["state"].connect (()
16 => bluetooth.set_device_connected (id, a.get_state().get_boolean()));
17@@ -119,7 +119,7 @@
18 {
19 debug (@"updating action $(device.id) state to $(device.is_connected)");
20 var action = connect_actions.lookup (device.id);
21- action.set_state (device.is_connected);
22+ action.set_state (new Variant.boolean (device.is_connected));
23 }
24
25 return item;
26@@ -218,16 +218,16 @@
27 {
28 var action = new SimpleAction.stateful ("desktop-discoverable",
29 null,
30- bluetooth.discoverable);
31+ new Variant.boolean (bluetooth.discoverable));
32
33 action.activate.connect (()
34- => action.set_state (!action.get_state().get_boolean()));
35+ => action.set_state (new Variant.boolean (!action.get_state().get_boolean())));
36
37 action.notify["state"].connect (()
38 => bluetooth.try_set_discoverable (action.get_state().get_boolean()));
39
40 bluetooth.notify["discoverable"].connect (()
41- => action.set_state (bluetooth.discoverable));
42+ => action.set_state (new Variant.boolean (bluetooth.discoverable)));
43
44 return action;
45 }
46
47=== modified file 'src/profile.vala'
48--- src/profile.vala 2013-10-11 13:38:51 +0000
49+++ src/profile.vala 2013-10-25 00:20:38 +0000
50@@ -111,10 +111,10 @@
51 {
52 var action = new SimpleAction.stateful ("bluetooth-supported",
53 null,
54- bluetooth.supported);
55+ new Variant.boolean (bluetooth.supported));
56
57 bluetooth.notify["supported"].connect (()
58- => action.set_state (bluetooth.supported));
59+ => action.set_state (new Variant.boolean (bluetooth.supported)));
60
61 return action;
62 }
63@@ -123,16 +123,16 @@
64 {
65 var action = new SimpleAction.stateful ("bluetooth-enabled",
66 null,
67- bluetooth.enabled);
68+ new Variant.boolean (bluetooth.enabled));
69
70 action.activate.connect (()
71- => action.change_state (!action.get_state().get_boolean()));
72+ => action.change_state (new Variant.boolean (!action.get_state().get_boolean())));
73
74 action.change_state.connect ((action, requestedValue)
75 => bluetooth.try_set_enabled (requestedValue.get_boolean()));
76
77 bluetooth.notify["enabled"].connect (()
78- => action.set_state (bluetooth.enabled));
79+ => action.set_state (new Variant.boolean (bluetooth.enabled)));
80
81 return action;
82 }

Subscribers

People subscribed via source and target branches