From e4002d584ae850b9c5e546fb638efe94a8e2b361 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 25 Sep 2012 09:58:35 +0200 Subject: get_icon: Plug memory leak --- src/indicator-power.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/indicator-power.c b/src/indicator-power.c index f3a7235..9829839 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -508,6 +508,7 @@ get_image (IndicatorObject *io) gicon = g_themed_icon_new (DEFAULT_ICON); priv->status_image = GTK_IMAGE (gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_LARGE_TOOLBAR)); + g_object_unref (gicon); } return priv->status_image; -- cgit v1.2.3 From 2b046e762cb8166c9b11af187835126094ff118d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 3 Oct 2012 11:30:18 -0500 Subject: when discharging the battery, prefer the percent-charged icons over the full,good,low icons because the former show a more accurate view of the charge. --- src/device.c | 3 ++- tests/test-device.cc | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/device.c b/src/device.c index 078c7a4..898e18f 100644 --- a/src/device.c +++ b/src/device.c @@ -390,8 +390,9 @@ indicator_power_device_get_icon_names (const IndicatorPowerDevice * device) suffix_str = get_device_icon_suffix (percentage); index_str = get_device_icon_index (percentage); - g_ptr_array_add (names, g_strdup_printf ("battery-%s-symbolic", suffix_str)); + g_ptr_array_add (names, g_strdup_printf ("%s-%s", kind_str, index_str)); g_ptr_array_add (names, g_strdup_printf ("gpm-%s-%s", kind_str, index_str)); + g_ptr_array_add (names, g_strdup_printf ("battery-%s-symbolic", suffix_str)); g_ptr_array_add (names, g_strdup_printf ("battery-%s", suffix_str)); break; diff --git a/tests/test-device.cc b/tests/test-device.cc index 728010d..eb087dc 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -310,8 +310,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_DISCHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 95.0, NULL); - check_icon_names (device, "battery-full-symbolic;" + check_icon_names (device, "battery-100;" "gpm-battery-100;" + "battery-full-symbolic;" "battery-full"); // discharging battery, 85% @@ -319,8 +320,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_DISCHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 85.0, NULL); - check_icon_names (device, "battery-full-symbolic;" + check_icon_names (device, "battery-080;" "gpm-battery-080;" + "battery-full-symbolic;" "battery-full"); // discharging battery, 50% -- 1 hour left @@ -329,8 +331,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_PERCENTAGE, 50.0, INDICATOR_POWER_DEVICE_TIME, (guint64)(60*60), NULL); - check_icon_names (device, "battery-good-symbolic;" + check_icon_names (device, "battery-060;" "gpm-battery-060;" + "battery-good-symbolic;" "battery-good"); // discharging battery, 25% -- 1 hour left @@ -339,8 +342,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_PERCENTAGE, 25.0, INDICATOR_POWER_DEVICE_TIME, (guint64)(60*60), NULL); - check_icon_names (device, "battery-good-symbolic;" + check_icon_names (device, "battery-040;" "gpm-battery-040;" + "battery-good-symbolic;" "battery-good"); // discharging battery, 25% -- 15 minutes left @@ -349,8 +353,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_PERCENTAGE, 25.0, INDICATOR_POWER_DEVICE_TIME, (guint64)(60*15), NULL); - check_icon_names (device, "battery-low-symbolic;" + check_icon_names (device, "battery-020;" "gpm-battery-020;" + "battery-low-symbolic;" "battery-low"); // discharging battery, 5% -- 1 hour left @@ -359,8 +364,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_PERCENTAGE, 5.0, INDICATOR_POWER_DEVICE_TIME, (guint64)(60*60), NULL); - check_icon_names (device, "battery-good-symbolic;" + check_icon_names (device, "battery-040;" "gpm-battery-040;" + "battery-good-symbolic;" "battery-good"); // discharging battery, 5% -- 15 minutes left @@ -369,9 +375,11 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_PERCENTAGE, 5.0, INDICATOR_POWER_DEVICE_TIME, (guint64)(60*15), NULL); - check_icon_names (device, "battery-caution-symbolic;" + check_icon_names (device, "battery-000;" "gpm-battery-000;" + "battery-caution-symbolic;" "battery-caution"); + // state unknown g_object_set (o, INDICATOR_POWER_DEVICE_KIND, UP_DEVICE_KIND_BATTERY, INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_UNKNOWN, -- cgit v1.2.3 From 3a0758a29fdae434142e1a67329ff2b65fee3c6b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 3 Oct 2012 11:51:08 -0500 Subject: 12.10.2 --- NEWS | 11 +++++++++++ configure.ac | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 NEWS diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..ff89f0e --- /dev/null +++ b/NEWS @@ -0,0 +1,11 @@ +12.10.2 + - Show a more accurate view of discharging batteries (LP: #1054146) + - Fix a GIcon memory leak + - In device.c, include gi18n-lib.h instead of gi18n.h + +12.10.1 + - Update our glib version dependency (LP: #1023533) + +12.10.0 + - Refactored the device icon/text code for better test coverage + diff --git a/configure.ac b/configure.ac index 94f5b83..5fbf2e5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([indicator-power], - [12.10.1], + [12.10.2], [http://bugs.launchpad.net/indicator-power], [indicator-power], [http://launchpad.net/indicator-power]) -- cgit v1.2.3