Merge lp:~fourdollars/indicator-power/xenial into lp:indicator-power/16.04

Proposed by Shih-Yuan Lee on 2017-01-05
Status: Needs review
Proposed branch: lp:~fourdollars/indicator-power/xenial
Merge into: lp:indicator-power/16.04
Diff against target: 453 lines (+111/-52)
7 files modified
src/device-provider-upower.c (+5/-1)
src/device.c (+37/-5)
src/device.h (+4/-1)
src/service.c (+18/-6)
src/testing.c (+2/-1)
tests/test-device.cc (+39/-35)
tests/test-notify.cc (+6/-3)
To merge this branch: bzr merge lp:~fourdollars/indicator-power/xenial
Reviewer Review Type Date Requested Status
Indicator Applet Developers 2017-01-05 Pending
Review via email: mp+314127@code.launchpad.net

This proposal supersedes a proposal from 2017-01-05.

Commit message

Make device with power supply has higher sorting priority. (LP: #1100546)

To post a comment you must log in.

Unmerged revisions

293. By Shih-Yuan Lee on 2017-01-05

Make device with power supply has higher sorting priority. (LP: #1100546)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/device-provider-upower.c'
2--- src/device-provider-upower.c 2014-09-08 14:50:22 +0000
3+++ src/device-provider-upower.c 2017-01-05 04:47:47 +0000
4@@ -113,6 +113,7 @@
5 gint64 time_to_empty = 0;
6 gint64 time_to_full = 0;
7 gint64 time;
8+ gboolean power_supply = FALSE;
9 IndicatorPowerDevice * device;
10 priv_t * p = get_priv(data->self);
11 GVariant * dict = g_variant_get_child_value (response, 0);
12@@ -122,6 +123,7 @@
13 g_variant_lookup (dict, "Percentage", "d", &percentage);
14 g_variant_lookup (dict, "TimeToEmpty", "x", &time_to_empty);
15 g_variant_lookup (dict, "TimeToFull", "x", &time_to_full);
16+ g_variant_lookup (dict, "PowerSupply", "b", &power_supply);
17 time = time_to_empty ? time_to_empty : time_to_full;
18
19 if ((device = g_hash_table_lookup (p->devices, data->path)))
20@@ -131,6 +133,7 @@
21 INDICATOR_POWER_DEVICE_OBJECT_PATH, data->path,
22 INDICATOR_POWER_DEVICE_PERCENTAGE, percentage,
23 INDICATOR_POWER_DEVICE_TIME, time,
24+ INDICATOR_POWER_DEVICE_POWER_SUPPLY, power_supply,
25 NULL);
26 }
27 else
28@@ -139,7 +142,8 @@
29 kind,
30 percentage,
31 state,
32- (time_t)time);
33+ (time_t)time,
34+ power_supply);
35
36 g_hash_table_insert (p->devices,
37 g_strdup (data->path),
38
39=== modified file 'src/device.c'
40--- src/device.c 2015-01-12 22:43:49 +0000
41+++ src/device.c 2017-01-05 04:47:47 +0000
42@@ -42,6 +42,7 @@
43 the time-remaining field for this device, or 0 if not applicable.
44 This is used when generating the time-remaining string. */
45 GTimer * inestimable;
46+ gboolean power_supply;
47 };
48
49 /* Properties */
50@@ -53,6 +54,7 @@
51 PROP_OBJECT_PATH,
52 PROP_PERCENTAGE,
53 PROP_TIME,
54+ PROP_POWER_SUPPLY,
55 N_PROPERTIES
56 };
57
58@@ -116,6 +118,12 @@
59 0,
60 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
61
62+ properties[PROP_POWER_SUPPLY] = g_param_spec_boolean (INDICATOR_POWER_DEVICE_POWER_SUPPLY,
63+ "power supply",
64+ "The device's power supply",
65+ FALSE,
66+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
67+
68 g_object_class_install_properties (object_class, N_PROPERTIES, properties);
69 }
70
71@@ -132,6 +140,7 @@
72 priv->object_path = NULL;
73 priv->percentage = 0.0;
74 priv->time = 0;
75+ priv->power_supply = FALSE;
76
77 self->priv = priv;
78 }
79@@ -190,6 +199,10 @@
80 g_value_set_uint64 (value, (guint64)priv->time);
81 break;
82
83+ case PROP_POWER_SUPPLY:
84+ g_value_set_boolean (value, priv->power_supply);
85+ break;
86+
87 default:
88 G_OBJECT_WARN_INVALID_PROPERTY_ID(o, prop_id, pspec);
89 break;
90@@ -225,6 +238,10 @@
91 p->time = (time_t) g_value_get_uint64(value);
92 break;
93
94+ case PROP_POWER_SUPPLY:
95+ p->power_supply = g_value_get_boolean (value);
96+ break;
97+
98 default:
99 G_OBJECT_WARN_INVALID_PROPERTY_ID(o, prop_id, pspec);
100 break;
101@@ -304,6 +321,16 @@
102 return device->priv->time;
103 }
104
105+gboolean
106+indicator_power_device_get_power_supply (const IndicatorPowerDevice * device)
107+{
108+ /* LCOV_EXCL_START */
109+ g_return_val_if_fail (INDICATOR_IS_POWER_DEVICE(device), FALSE);
110+ /* LCOV_EXCL_STOP */
111+
112+ return device->priv->power_supply;
113+}
114+
115 /***
116 ****
117 ****
118@@ -866,7 +893,8 @@
119 UpDeviceKind kind,
120 gdouble percentage,
121 UpDeviceState state,
122- time_t timestamp)
123+ time_t timestamp,
124+ gboolean power_supply)
125 {
126 GObject * o = g_object_new (INDICATOR_POWER_DEVICE_TYPE,
127 INDICATOR_POWER_DEVICE_KIND, kind,
128@@ -874,6 +902,7 @@
129 INDICATOR_POWER_DEVICE_OBJECT_PATH, object_path,
130 INDICATOR_POWER_DEVICE_PERCENTAGE, percentage,
131 INDICATOR_POWER_DEVICE_TIME, (guint64)timestamp,
132+ INDICATOR_POWER_DEVICE_POWER_SUPPLY, power_supply,
133 NULL);
134 return INDICATOR_POWER_DEVICE(o);
135 }
136@@ -881,7 +910,7 @@
137 IndicatorPowerDevice *
138 indicator_power_device_new_from_variant (GVariant * v)
139 {
140- g_return_val_if_fail (g_variant_is_of_type (v, G_VARIANT_TYPE("(susdut)")), NULL);
141+ g_return_val_if_fail (g_variant_is_of_type (v, G_VARIANT_TYPE("(susdutb)")), NULL);
142
143 UpDeviceKind kind = UP_DEVICE_KIND_UNKNOWN;
144 UpDeviceState state = UP_DEVICE_STATE_UNKNOWN;
145@@ -889,18 +918,21 @@
146 const gchar * object_path = NULL;
147 gdouble percentage = 0;
148 guint64 time = 0;
149+ gboolean power_supply = FALSE;
150
151- g_variant_get (v, "(&su&sdut)",
152+ g_variant_get (v, "(&su&sdutb)",
153 &object_path,
154 &kind,
155 &icon,
156 &percentage,
157 &state,
158- &time);
159+ &time,
160+ &power_supply);
161
162 return indicator_power_device_new (object_path,
163 kind,
164 percentage,
165 state,
166- (time_t)time);
167+ (time_t)time,
168+ power_supply);
169 }
170
171=== modified file 'src/device.h'
172--- src/device.h 2014-07-24 20:20:16 +0000
173+++ src/device.h 2017-01-05 04:47:47 +0000
174@@ -44,6 +44,7 @@
175 #define INDICATOR_POWER_DEVICE_OBJECT_PATH "object-path"
176 #define INDICATOR_POWER_DEVICE_PERCENTAGE "percentage"
177 #define INDICATOR_POWER_DEVICE_TIME "time"
178+#define INDICATOR_POWER_DEVICE_POWER_SUPPLY "power-supply"
179
180 typedef enum
181 {
182@@ -107,7 +108,8 @@
183 UpDeviceKind kind,
184 gdouble percentage,
185 UpDeviceState state,
186- time_t time);
187+ time_t time,
188+ gboolean power_supply);
189
190 /**
191 * Convenience wrapper around indicator_power_device_new()
192@@ -121,6 +123,7 @@
193 const gchar * indicator_power_device_get_object_path (const IndicatorPowerDevice * device);
194 gdouble indicator_power_device_get_percentage (const IndicatorPowerDevice * device);
195 time_t indicator_power_device_get_time (const IndicatorPowerDevice * device);
196+gboolean indicator_power_device_get_power_supply (const IndicatorPowerDevice * device);
197
198 GStrv indicator_power_device_get_icon_names (const IndicatorPowerDevice * device);
199 GIcon * indicator_power_device_get_gicon (const IndicatorPowerDevice * device);
200
201=== modified file 'src/service.c'
202--- src/service.c 2016-01-02 02:19:45 +0000
203+++ src/service.c 2017-01-05 04:47:47 +0000
204@@ -162,11 +162,12 @@
205 }
206
207 /* sort devices from most interesting to least interesting on this criteria:
208- 1. discharging items from least time remaining until most time remaining
209- 2. charging items from most time left to charge to least time left to charge
210- 3. charging items with an unknown time remaining
211- 4. discharging items with an unknown time remaining
212- 5. batteries, then non-line power, then line-power */
213+ 1. device that supplied the power to the system
214+ 2. discharging items from least time remaining until most time remaining
215+ 3. charging items from most time left to charge to least time left to charge
216+ 4. charging items with an unknown time remaining
217+ 5. discharging items with an unknown time remaining
218+ 6. batteries, then non-line power, then line-power */
219 static gint
220 device_compare_func (gconstpointer ga, gconstpointer gb)
221 {
222@@ -174,6 +175,8 @@
223 int state;
224 const IndicatorPowerDevice * a = ga;
225 const IndicatorPowerDevice * b = gb;
226+ const gboolean a_power_supply = indicator_power_device_get_power_supply (a);
227+ const gboolean b_power_supply = indicator_power_device_get_power_supply (b);
228 const int a_state = indicator_power_device_get_state (a);
229 const int b_state = indicator_power_device_get_state (b);
230 const gdouble a_percentage = indicator_power_device_get_percentage (a);
231@@ -183,6 +186,14 @@
232
233 ret = 0;
234
235+ if (!ret)
236+ {
237+ if (a_power_supply == TRUE && b_power_supply == FALSE)
238+ ret = -1;
239+ else if (a_power_supply == FALSE && b_power_supply == TRUE)
240+ ret = 1;
241+ }
242+
243 state = UP_DEVICE_STATE_DISCHARGING;
244 if (!ret && (((a_state == state) && a_time) ||
245 ((b_state == state) && b_time)))
246@@ -1418,7 +1429,8 @@
247 UP_DEVICE_KIND_BATTERY,
248 percent,
249 state,
250- time_left);
251+ time_left,
252+ TRUE);
253 }
254
255 return device;
256
257=== modified file 'src/testing.c'
258--- src/testing.c 2014-10-14 19:50:47 +0000
259+++ src/testing.c 2017-01-05 04:47:47 +0000
260@@ -301,7 +301,8 @@
261 UP_DEVICE_KIND_BATTERY,
262 50.0,
263 UP_DEVICE_STATE_DISCHARGING,
264- 60*30);
265+ 60*30,
266+ TRUE);
267
268
269 /* Mock Provider */
270
271=== modified file 'tests/test-device.cc'
272--- tests/test-device.cc 2015-01-12 21:47:27 +0000
273+++ tests/test-device.cc 2017-01-05 04:47:47 +0000
274@@ -190,7 +190,8 @@
275 UP_DEVICE_KIND_BATTERY,
276 50.0,
277 UP_DEVICE_STATE_CHARGING,
278- 30);
279+ 30,
280+ TRUE);
281 ASSERT_TRUE (device != NULL);
282 ASSERT_TRUE (INDICATOR_IS_POWER_DEVICE(device));
283 ASSERT_EQ (UP_DEVICE_KIND_BATTERY, indicator_power_device_get_kind(device));
284@@ -198,6 +199,7 @@
285 ASSERT_STREQ ("/object/path", indicator_power_device_get_object_path(device));
286 ASSERT_EQ (50, int(indicator_power_device_get_percentage(device)));
287 ASSERT_EQ (30, indicator_power_device_get_time(device));
288+ ASSERT_TRUE (indicator_power_device_get_power_supply(device));
289
290 // cleanup
291 g_object_unref (device);
292@@ -205,13 +207,14 @@
293
294 TEST_F(DeviceTest, NewFromVariant)
295 {
296- auto variant = g_variant_new("(susdut)",
297+ auto variant = g_variant_new("(susdutb)",
298 "/object/path",
299 guint32(UP_DEVICE_KIND_BATTERY),
300 "icon",
301 50.0,
302 guint32(UP_DEVICE_STATE_CHARGING),
303- guint64(30));
304+ guint64(30),
305+ TRUE);
306 IndicatorPowerDevice * device = indicator_power_device_new_from_variant (variant);
307 ASSERT_TRUE (variant != NULL);
308 ASSERT_TRUE (device != NULL);
309@@ -221,6 +224,7 @@
310 ASSERT_STREQ ("/object/path", indicator_power_device_get_object_path(device));
311 ASSERT_EQ (50, int(indicator_power_device_get_percentage(device)));
312 ASSERT_EQ (30, indicator_power_device_get_time(device));
313+ ASSERT_TRUE (indicator_power_device_get_power_supply(device));
314
315 // cleanup
316 g_object_unref (device);
317@@ -709,26 +713,27 @@
318 UpDeviceState state;
319 guint64 time;
320 double percentage;
321+ gboolean power_supply;
322 };
323
324 const Description descriptions[] = {
325- { "/some/path/d0", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 10, 60.0 }, // 0
326- { "/some/path/d1", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 20, 80.0 }, // 1
327- { "/some/path/d2", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 30, 100.0 }, // 2
328-
329- { "/some/path/c0", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 10, 60.0 }, // 3
330- { "/some/path/c1", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 20, 80.0 }, // 4
331- { "/some/path/c2", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 30, 100.0 }, // 5
332-
333- { "/some/path/f0", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_FULLY_CHARGED, 0, 100.0 }, // 6
334- { "/some/path/m0", UP_DEVICE_KIND_MOUSE, UP_DEVICE_STATE_DISCHARGING, 20, 80.0 }, // 7
335- { "/some/path/m1", UP_DEVICE_KIND_MOUSE, UP_DEVICE_STATE_FULLY_CHARGED, 0, 100.0 }, // 8
336- { "/some/path/pw", UP_DEVICE_KIND_LINE_POWER, UP_DEVICE_STATE_UNKNOWN, 0, 0.0 } // 9
337+ { "/some/path/d0", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 10, 60.0, TRUE }, // 0
338+ { "/some/path/d1", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 20, 80.0, TRUE }, // 1
339+ { "/some/path/d2", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 30, 100.0, TRUE }, // 2
340+
341+ { "/some/path/c0", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 10, 60.0, TRUE }, // 3
342+ { "/some/path/c1", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 20, 80.0, TRUE }, // 4
343+ { "/some/path/c2", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 30, 100.0, TRUE }, // 5
344+
345+ { "/some/path/f0", UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_FULLY_CHARGED, 0, 100.0, TRUE }, // 6
346+ { "/some/path/m0", UP_DEVICE_KIND_MOUSE, UP_DEVICE_STATE_DISCHARGING, 20, 80.0, FALSE }, // 7
347+ { "/some/path/m1", UP_DEVICE_KIND_MOUSE, UP_DEVICE_STATE_FULLY_CHARGED, 0, 100.0, FALSE }, // 8
348+ { "/some/path/pw", UP_DEVICE_KIND_LINE_POWER, UP_DEVICE_STATE_UNKNOWN, 0, 0.0, TRUE } // 9
349 };
350
351 std::vector<IndicatorPowerDevice*> devices;
352 for(const auto& desc : descriptions)
353- devices.push_back(indicator_power_device_new(desc.path, desc.kind, desc.percentage, desc.state, time_t(desc.time)));
354+ devices.push_back(indicator_power_device_new(desc.path, desc.kind, desc.percentage, desc.state, time_t(desc.time), desc.power_supply));
355
356 const struct {
357 std::vector<unsigned int> device_indices;
358@@ -736,29 +741,26 @@
359 } tests[] = {
360
361 { { 0 }, descriptions[0] }, // 1 discharging
362- { { 0, 1 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 20, 70.0 } }, // 2 discharging
363- { { 1, 2 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 30, 90.0 } }, // 2 discharging
364- { { 0, 1, 2 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 30, 80.0 } }, // 3 discharging
365+ { { 0, 1 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 20, 70.0, TRUE } }, // 2 discharging
366+ { { 1, 2 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 30, 90.0, TRUE } }, // 2 discharging
367+ { { 0, 1, 2 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 30, 80.0, TRUE } }, // 3 discharging
368+ { { 0, 1, 2, 7 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 30, 80.0, TRUE } }, // ignore mouse
369
370 { { 3 }, descriptions[3] }, // 1 charging
371- { { 3, 4 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 20, 70.0 } }, // 2 charging
372- { { 4, 5 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 30, 90.0 } }, // 2 charging
373- { { 3, 4, 5 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 30, 80.0 } }, // 3 charging
374+ { { 3, 4 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 20, 70.0, TRUE } }, // 2 charging
375+ { { 4, 5 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 30, 90.0, TRUE } }, // 2 charging
376+ { { 3, 4, 5 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 30, 80.0, TRUE } }, // 3 charging
377+ { { 3, 4, 5, 8 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 30, 80.0, TRUE } }, // ignore mouse
378
379 { { 6 }, descriptions[6] }, // 1 charged
380- { { 6, 0 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 10, 80.0 } }, // 1 charged, 1 discharging
381- { { 6, 3 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 10, 80.0 } }, // 1 charged, 1 charging
382- { { 6, 0, 3 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 10, 73.3 } }, // 1 charged, 1 charging, 1 discharging
383-
384- { { 0, 7 }, descriptions[0] }, // 1 discharging battery, 1 discharging mouse. pick the one with the least time left.
385- { { 2, 7 }, descriptions[7] }, // 1 discharging battery, 1 discharging mouse. pick the one with the least time left.
386-
387- { { 0, 8 }, descriptions[0] }, // 1 discharging battery, 1 fully-charged mouse. pick the one that's discharging.
388- { { 6, 7 }, descriptions[7] }, // 1 discharging mouse, 1 fully-charged battery. pick the one that's discharging.
389-
390- { { 0, 9 }, descriptions[0] }, // everything comes before power lines
391- { { 3, 9 }, descriptions[3] },
392- { { 7, 9 }, descriptions[7] }
393+ { { 6, 0 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 10, 80.0, TRUE } }, // 1 charged, 1 discharging
394+ { { 6, 3 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_CHARGING, 10, 80.0, TRUE } }, // 1 charged, 1 charging
395+ { { 6, 0, 3 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 10, 73.3, TRUE } }, // 1 charged, 1 charging, 1 discharging
396+ { { 6, 0, 3, 7, 8 }, { nullptr, UP_DEVICE_KIND_BATTERY, UP_DEVICE_STATE_DISCHARGING, 10, 73.3, TRUE } }, // ignore mouse
397+
398+ { { 0, 9 }, descriptions[0] }, // everything comes before power lines except devices without power supply
399+ { { 3, 9 }, descriptions[3] },
400+ { { 7, 9 }, descriptions[9] },
401 };
402
403 for(const auto& test : tests)
404@@ -775,6 +777,7 @@
405 EXPECT_EQ(x.state, indicator_power_device_get_state(primary));
406 EXPECT_EQ(x.time, indicator_power_device_get_time(primary));
407 EXPECT_EQ(int(ceil(x.percentage)), int(ceil(indicator_power_device_get_percentage(primary))));
408+ EXPECT_EQ(x.power_supply, indicator_power_device_get_power_supply(primary));
409 g_object_unref(primary);
410
411 // reverse the list and repeat the test
412@@ -786,6 +789,7 @@
413 EXPECT_EQ(x.state, indicator_power_device_get_state(primary));
414 EXPECT_EQ(x.time, indicator_power_device_get_time(primary));
415 EXPECT_EQ(int(ceil(x.percentage)), int(ceil(indicator_power_device_get_percentage(primary))));
416+ EXPECT_EQ(x.power_supply, indicator_power_device_get_power_supply(primary));
417 g_object_unref(primary);
418
419 // cleanup
420
421=== modified file 'tests/test-notify.cc'
422--- tests/test-notify.cc 2016-01-02 01:37:51 +0000
423+++ tests/test-notify.cc 2017-01-05 04:47:47 +0000
424@@ -194,7 +194,8 @@
425 UP_DEVICE_KIND_BATTERY,
426 50.0,
427 UP_DEVICE_STATE_DISCHARGING,
428- 30);
429+ 30,
430+ TRUE);
431
432 // confirm that the power levels trigger at the right percentages
433 for (int i=100; i>=0; --i)
434@@ -272,7 +273,8 @@
435 UP_DEVICE_KIND_BATTERY,
436 50.0,
437 UP_DEVICE_STATE_DISCHARGING,
438- 30);
439+ 30,
440+ TRUE);
441
442 // set up a notifier and give it the battery so changing the battery's
443 // charge should show up on the bus.
444@@ -354,7 +356,8 @@
445 UP_DEVICE_KIND_BATTERY,
446 percent_low + 1.0,
447 UP_DEVICE_STATE_DISCHARGING,
448- 30);
449+ 30,
450+ TRUE);
451
452 // the file we expect to play on a low battery notification...
453 const char* expected_file = XDG_DATA_HOME "/" GETTEXT_PACKAGE "/sounds/" LOW_BATTERY_SOUND;

Subscribers

People subscribed via source and target branches