aboutsummaryrefslogtreecommitdiff
path: root/src/notifier.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-23 16:18:33 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-07-23 16:18:33 -0500
commitaba9e6261a6f02c501fa690e12babbbc8eea3a53 (patch)
treea921fa27c2dd73c5109ac6e38562464a908ef73d /src/notifier.c
parentbf934569374d2f15567e955c058c271d1072df7b (diff)
downloadayatana-indicator-power-aba9e6261a6f02c501fa690e12babbbc8eea3a53.tar.gz
ayatana-indicator-power-aba9e6261a6f02c501fa690e12babbbc8eea3a53.tar.bz2
ayatana-indicator-power-aba9e6261a6f02c501fa690e12babbbc8eea3a53.zip
copyediting: slightly better comments.
Diffstat (limited to 'src/notifier.c')
-rw-r--r--src/notifier.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/notifier.c b/src/notifier.c
index 8c12dfc..62952e6 100644
--- a/src/notifier.c
+++ b/src/notifier.c
@@ -58,9 +58,10 @@ static GParamSpec * properties[LAST_PROP];
struct _IndicatorPowerNotifierPrivate
{
/* The battery we're currently watching.
- This may be a physical battery or it may be a "merged" battery
- synthesized from multiple batteries present on the device.
- See indicator_power_service_choose_primary_device() */
+ This may be a physical battery or it may be an aggregated
+ battery from multiple batteries present on the device.
+ See indicator_power_service_choose_primary_device() and
+ bug #880881 */
IndicatorPowerDevice * battery;
PowerLevel power_level;
gboolean discharging;
@@ -68,10 +69,10 @@ struct _IndicatorPowerNotifierPrivate
NotifyNotification* notify_notification;
gboolean is_warning;
- DbusBattery * dbus_battery;
- GBinding * is_warning_binding;
- GBinding * power_level_binding;
GDBusConnection * bus;
+ DbusBattery * dbus_battery; /* com.canonical.indicator.power.Battery skeleton */
+ GBinding * is_warning_binding; /* pushes our property to dbus_battery */
+ GBinding * power_level_binding; /* pushes our property to dbus_battery */
};
typedef IndicatorPowerNotifierPrivate priv_t;
@@ -162,7 +163,7 @@ on_battery_property_changed (IndicatorPowerNotifier * self)
old_discharging = p->discharging;
new_discharging = indicator_power_device_get_state(p->battery) == UP_DEVICE_STATE_DISCHARGING;
- /* pop up a notification for a battery whenever either:
+ /* pop up a 'low battery' notification if either:
a) it's already discharging, and its PowerLevel worsens, OR
b) it's already got a bad PowerLevel and its state becomes 'discharging */
if ((new_discharging && (new_power_level > old_power_level)) ||