aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog36
-rw-r--r--Makefile.am36
-rw-r--r--Makefile.am.coverage48
-rw-r--r--Makefile.in71
-rwxr-xr-xconfigure158
-rw-r--r--configure.ac5
-rw-r--r--m4/gcov.m423
-rw-r--r--src/indicator-power.c23
8 files changed, 253 insertions, 147 deletions
diff --git a/ChangeLog b/ChangeLog
index 9bb1bdf..bcfaff8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,41 @@
# Generated by Makefile. Do not edit.
+2012-04-11 Charles Kerr <charles.kerr@canonical.com>
+
+ 2.0
+
+2012-04-10 Charles Kerr <charles.kerr@canonical.com>
+
+ merge lp:~allanlesage/indicator-power/TDD to improve our gcov fules in autotools
+
+2012-03-27 Allan LeSage <allanlesage@gmail.com>
+
+ Pedantic name change for gcovr xml results.
+
+2012-03-27 Allan LeSage <allanlesage@gmail.com>
+
+ Added gcov coverage tooling.
+
+2012-04-09 Charles Kerr <charles.kerr@canonical.com>
+
+ use atk_object_set_name(foo,bar)" instead of g_object_set(foo,"accessible-name",bar,NULL)"
+
+2012-04-09 Charles Kerr <charles.kerr@canonical.com>
+
+ leak fix 3 of 3: don't leak the GIcons returned by get_device_icon()
+
+2012-04-09 Charles Kerr <charles.kerr@canonical.com>
+
+ leak fix 2 of 3: fix leaky fallback GIcon in get_device_icon()
+
+2012-04-09 Charles Kerr <charles.kerr@canonical.com>
+
+ leak fix 1 of 3: don't leak object_path and device_icon if kind == UP_DEVICE_KIND_LINE_POWER
+
+2012-04-09 Charles Kerr <charles.kerr@canonical.com>
+
+ if possible, set the device menuitems' accessible names.
+
2012-03-21 Charles Kerr <charles.kerr@canonical.com>
1.93
diff --git a/Makefile.am b/Makefile.am
index 0ef4362..25cbee5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,38 +61,4 @@ dist-hook:
echo Failed to generate AUTHORS: not a branch >&2; \
fi
-
-# Coverage targets
-
-.PHONY: clean-gcda
-clean-gcda:
- @echo Removing old coverage results
- -find -name '*.gcda' -print | xargs -r rm
-
-.PHONY: coverage-html generate-coverage-html clean-coverage-html
-coverage-html: clean-gcda
- -$(MAKE) $(AM_MAKEFLAGS) -k check
- $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
-
-generate-coverage-html:
- @echo Collecting coverage data
- $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
- LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
-
-clean-coverage-html: clean-gcda
- -$(LCOV) --directory $(top_builddir) -z
- -rm -rf coverage.info coveragereport
-
-.PHONY: coverage-xml generate-coverage-xml clean-coverage-xml
-coverage-xml: clean-gcda
- -$(MAKE) $(AM_MAKEFLAGS) -k check
- $(MAKE) $(AM_MAKEFLAGS) generate-coverage-xml
-
-generate-coverage-xml:
- @echo Generating coverage XML report
- $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
-
-clean-coverage-xml: clean-gcda
- -rm -rf $(top_builddir)/coverage.xml
-
-clean-local: clean-coverage-html clean-coverage-xml
+include $(top_srcdir)/Makefile.am.coverage
diff --git a/Makefile.am.coverage b/Makefile.am.coverage
new file mode 100644
index 0000000..fb97747
--- /dev/null
+++ b/Makefile.am.coverage
@@ -0,0 +1,48 @@
+
+# Coverage targets
+
+.PHONY: clean-gcno clean-gcda \
+ coverage-html generate-coverage-html clean-coverage-html \
+ coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
+
+clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
+
+if HAVE_GCOV
+
+clean-gcno:
+ @echo Removing old coverage instrumentation
+ -find -name '*.gcno' -print | xargs -r rm
+
+clean-gcda:
+ @echo Removing old coverage results
+ -find -name '*.gcda' -print | xargs -r rm
+
+coverage-html: clean-gcda
+ -$(MAKE) $(AM_MAKEFLAGS) -k check
+ $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
+
+generate-coverage-html:
+ @echo Collecting coverage data
+ $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
+ LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
+
+clean-coverage-html: clean-gcda
+ -$(LCOV) --directory $(top_builddir) -z
+ -rm -rf coverage.info coveragereport
+
+if HAVE_GCOVR
+
+coverage-gcovr: clean-gcda
+ -$(MAKE) $(AM_MAKEFLAGS) -k check
+ $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr
+
+generate-coverage-gcovr:
+ @echo Generating coverage GCOVR report
+ $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
+
+clean-coverage-gcovr: clean-gcda
+ -rm -rf $(top_builddir)/coverage.xml
+
+endif # HAVE_GCOVR
+
+endif # HAVE_GCOV
diff --git a/Makefile.in b/Makefile.in
index 38a665b..011f720 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -15,6 +15,8 @@
@SET_MAKE@
+# Coverage targets
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -35,13 +37,14 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-subdir = .
DIST_COMMON = $(am__configure_deps) $(dist_noinst_SCRIPTS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/config.h.in $(top_srcdir)/configure ABOUT-NLS \
- COPYING build-aux/compile build-aux/config.guess \
- build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
- build-aux/install-sh build-aux/ltmain.sh build-aux/missing
+ $(srcdir)/config.h.in $(top_srcdir)/Makefile.am.coverage \
+ $(top_srcdir)/configure ABOUT-NLS COPYING build-aux/compile \
+ build-aux/config.guess build-aux/config.rpath \
+ build-aux/config.sub build-aux/depcomp build-aux/install-sh \
+ build-aux/ltmain.sh build-aux/missing
+subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
@@ -393,7 +396,7 @@ all: config.h
.SUFFIXES: .c .lo .o .obj
am--refresh: Makefile
@:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.coverage $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -416,6 +419,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
+$(top_srcdir)/Makefile.am.coverage:
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
@@ -1026,40 +1030,43 @@ dist-hook:
echo Failed to generate AUTHORS: not a branch >&2; \
fi
-# Coverage targets
+.PHONY: clean-gcno clean-gcda \
+ coverage-html generate-coverage-html clean-coverage-html \
+ coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
+
+clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
-.PHONY: clean-gcda
-clean-gcda:
- @echo Removing old coverage results
- -find -name '*.gcda' -print | xargs -r rm
+@HAVE_GCOV_TRUE@clean-gcno:
+@HAVE_GCOV_TRUE@ @echo Removing old coverage instrumentation
+@HAVE_GCOV_TRUE@ -find -name '*.gcno' -print | xargs -r rm
-.PHONY: coverage-html generate-coverage-html clean-coverage-html
-coverage-html: clean-gcda
- -$(MAKE) $(AM_MAKEFLAGS) -k check
- $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
+@HAVE_GCOV_TRUE@clean-gcda:
+@HAVE_GCOV_TRUE@ @echo Removing old coverage results
+@HAVE_GCOV_TRUE@ -find -name '*.gcda' -print | xargs -r rm
-generate-coverage-html:
- @echo Collecting coverage data
- $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
- LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
+@HAVE_GCOV_TRUE@coverage-html: clean-gcda
+@HAVE_GCOV_TRUE@ -$(MAKE) $(AM_MAKEFLAGS) -k check
+@HAVE_GCOV_TRUE@ $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
-clean-coverage-html: clean-gcda
- -$(LCOV) --directory $(top_builddir) -z
- -rm -rf coverage.info coveragereport
+@HAVE_GCOV_TRUE@generate-coverage-html:
+@HAVE_GCOV_TRUE@ @echo Collecting coverage data
+@HAVE_GCOV_TRUE@ $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
+@HAVE_GCOV_TRUE@ LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
-.PHONY: coverage-xml generate-coverage-xml clean-coverage-xml
-coverage-xml: clean-gcda
- -$(MAKE) $(AM_MAKEFLAGS) -k check
- $(MAKE) $(AM_MAKEFLAGS) generate-coverage-xml
+@HAVE_GCOV_TRUE@clean-coverage-html: clean-gcda
+@HAVE_GCOV_TRUE@ -$(LCOV) --directory $(top_builddir) -z
+@HAVE_GCOV_TRUE@ -rm -rf coverage.info coveragereport
-generate-coverage-xml:
- @echo Generating coverage XML report
- $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
+@HAVE_GCOVR_TRUE@@HAVE_GCOV_TRUE@coverage-gcovr: clean-gcda
+@HAVE_GCOVR_TRUE@@HAVE_GCOV_TRUE@ -$(MAKE) $(AM_MAKEFLAGS) -k check
+@HAVE_GCOVR_TRUE@@HAVE_GCOV_TRUE@ $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr
-clean-coverage-xml: clean-gcda
- -rm -rf $(top_builddir)/coverage.xml
+@HAVE_GCOVR_TRUE@@HAVE_GCOV_TRUE@generate-coverage-gcovr:
+@HAVE_GCOVR_TRUE@@HAVE_GCOV_TRUE@ @echo Generating coverage GCOVR report
+@HAVE_GCOVR_TRUE@@HAVE_GCOV_TRUE@ $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
-clean-local: clean-coverage-html clean-coverage-xml
+@HAVE_GCOVR_TRUE@@HAVE_GCOV_TRUE@clean-coverage-gcovr: clean-gcda
+@HAVE_GCOVR_TRUE@@HAVE_GCOV_TRUE@ -rm -rf $(top_builddir)/coverage.xml
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/configure b/configure
index 0e91fa4..7345ab2 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for indicator-power 1.93.
+# Generated by GNU Autoconf 2.68 for indicator-power 2.0.
#
# Report bugs to <http://bugs.launchpad.net/indicator-power>.
#
@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='indicator-power'
PACKAGE_TARNAME='indicator-power'
-PACKAGE_VERSION='1.93'
-PACKAGE_STRING='indicator-power 1.93'
+PACKAGE_VERSION='2.0'
+PACKAGE_STRING='indicator-power 2.0'
PACKAGE_BUGREPORT='http://bugs.launchpad.net/indicator-power'
PACKAGE_URL='http://launchpad.net/indicator-power'
@@ -671,6 +671,12 @@ INDICATORDIR
COVERAGE_LDFLAGS
COVERAGE_CXXFLAGS
COVERAGE_CFLAGS
+HAVE_GCOVR_FALSE
+HAVE_GCOVR_TRUE
+HAVE_LCOV_FALSE
+HAVE_LCOV_TRUE
+HAVE_GCOV_FALSE
+HAVE_GCOV_TRUE
GCOVR
GENHTML
LCOV
@@ -1384,7 +1390,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures indicator-power 1.93 to adapt to many kinds of systems.
+\`configure' configures indicator-power 2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1454,7 +1460,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of indicator-power 1.93:";;
+ short | recursive ) echo "Configuration of indicator-power 2.0:";;
esac
cat <<\_ACEOF
@@ -1586,7 +1592,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-indicator-power configure 1.93
+indicator-power configure 2.0
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1864,7 +1870,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by indicator-power $as_me 1.93, which was
+It was created by indicator-power $as_me 2.0, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2688,7 +2694,7 @@ fi
# Define the identity of the package.
PACKAGE='indicator-power'
- VERSION='1.93'
+ VERSION='2.0'
cat >>confdefs.h <<_ACEOF
@@ -12193,13 +12199,7 @@ endif
# AC_TDD_GCOV
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether code coverage tools are available" >&5
-$as_echo_n "checking whether code coverage tools are available... " >&6; }
-if ${ac_cv_check_gcov+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-# Check whether --enable-gcov was given.
+ # Check whether --enable-gcov was given.
if test "${enable_gcov+set}" = set; then :
enableval=$enable_gcov; use_gcov=$enableval
else
@@ -12335,43 +12335,6 @@ $as_echo "no" >&6; }
fi
- # Extract the first word of "gcovr", so it can be a program name with args.
-set dummy gcovr; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_GCOVR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$GCOVR"; then
- ac_cv_prog_GCOVR="$GCOVR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_GCOVR="gcovr"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-GCOVR=$ac_cv_prog_GCOVR
-if test -n "$GCOVR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOVR" >&5
-$as_echo "$GCOVR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
if test "$LCOV"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lcov version" >&5
@@ -12408,10 +12371,8 @@ $as_echo "$glib_cv_lcov_version" >&6; }
as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5
fi
- if test -z "$GCOVR"; then
- as_fn_error $? "Could not find gcovr; easy_install (or pip) gcovr" "$LINENO" 5
- fi
-
+ ac_cv_check_gcov=yes
+ ac_cv_check_lcov=yes
# Remove all optimization flags from CFLAGS
@@ -12423,11 +12384,76 @@ $as_echo "$glib_cv_lcov_version" >&6; }
COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage"
COVERAGE_LDFLAGS="-lgcov"
+ # Check availability of gcovr
+ # Extract the first word of "gcovr", so it can be a program name with args.
+set dummy gcovr; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GCOVR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$GCOVR"; then
+ ac_cv_prog_GCOVR="$GCOVR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_GCOVR="gcovr"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+GCOVR=$ac_cv_prog_GCOVR
+if test -n "$GCOVR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOVR" >&5
+$as_echo "$GCOVR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test -z "$GCOVR"; then
+ ac_cv_check_gcovr=no
+ else
+ ac_cv_check_gcovr=yes
+ fi
+
+fi
+
+ if test "x$ac_cv_check_gcov" = xyes; then
+ HAVE_GCOV_TRUE=
+ HAVE_GCOV_FALSE='#'
+else
+ HAVE_GCOV_TRUE='#'
+ HAVE_GCOV_FALSE=
+fi
+
+ if test "x$ac_cv_check_lcov" = xyes; then
+ HAVE_LCOV_TRUE=
+ HAVE_LCOV_FALSE='#'
+else
+ HAVE_LCOV_TRUE='#'
+ HAVE_LCOV_FALSE=
fi
+ if test "x$ac_cv_check_gcovr" = xyes; then
+ HAVE_GCOVR_TRUE=
+ HAVE_GCOVR_FALSE='#'
+else
+ HAVE_GCOVR_TRUE='#'
+ HAVE_GCOVR_FALSE=
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_check_gcov" >&5
-$as_echo "$ac_cv_check_gcov" >&6; }
+
@@ -15081,6 +15107,18 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${HAVE_GCOV_TRUE}" && test -z "${HAVE_GCOV_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_GCOV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LCOV_TRUE}" && test -z "${HAVE_LCOV_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LCOV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_GCOVR_TRUE}" && test -z "${HAVE_GCOVR_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_GCOVR\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
ac_config_commands="$ac_config_commands po/stamp-it"
@@ -15494,7 +15532,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by indicator-power $as_me 1.93, which was
+This file was extended by indicator-power $as_me 2.0, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15561,7 +15599,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-indicator-power config.status 1.93
+indicator-power config.status 2.0
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 477709b..fc287a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_INIT([indicator-power],
- [1.93],
+ [2.0],
[http://bugs.launchpad.net/indicator-power],
[indicator-power],
[http://launchpad.net/indicator-power])
@@ -53,6 +53,9 @@ GLIB_GSETTINGS
m4_include([m4/gcov.m4])
AC_TDD_GCOV
+AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
+AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
+AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_CXXFLAGS)
AC_SUBST(COVERAGE_LDFLAGS)
diff --git a/m4/gcov.m4 b/m4/gcov.m4
index 1169573..3163584 100644
--- a/m4/gcov.m4
+++ b/m4/gcov.m4
@@ -5,11 +5,10 @@
# * gcovr
#
# Sets ac_cv_check_gcov to yes if tooling is present
-# and reports the executables to the variables LCOV, GCOVR and GENHTML.
+# and reports the executables to the variables LCOV, GCOVR and GENHTML.
AC_DEFUN([AC_TDD_GCOV],
-[AC_CACHE_CHECK([whether code coverage tools are available], ac_cv_check_gcov,
[
-AC_ARG_ENABLE(gcov,
+ AC_ARG_ENABLE(gcov,
AS_HELP_STRING([--enable-gcov],
[enable coverage testing with gcov]),
[use_gcov=$enableval], [use_gcov=no])
@@ -34,7 +33,6 @@ AC_ARG_ENABLE(gcov,
lcov_version_list="1.6 1.7 1.8 1.9"
AC_CHECK_PROG(LCOV, lcov, lcov)
AC_CHECK_PROG(GENHTML, genhtml, genhtml)
- AC_CHECK_PROG(GCOVR, gcovr, gcovr)
if test "$LCOV"; then
AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [
@@ -63,10 +61,8 @@ AC_ARG_ENABLE(gcov,
AC_MSG_ERROR([Could not find genhtml from the lcov package])
fi
- if test -z "$GCOVR"; then
- AC_MSG_ERROR([Could not find gcovr; easy_install (or pip) gcovr])
- fi
-
+ ac_cv_check_gcov=yes
+ ac_cv_check_lcov=yes
# Remove all optimization flags from CFLAGS
changequote({,})
@@ -78,6 +74,13 @@ AC_ARG_ENABLE(gcov,
COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage"
COVERAGE_LDFLAGS="-lgcov"
-fi
-])]) # AC_TDD_GCOV
+ # Check availability of gcovr
+ AC_CHECK_PROG(GCOVR, gcovr, gcovr)
+ if test -z "$GCOVR"; then
+ ac_cv_check_gcovr=no
+ else
+ ac_cv_check_gcovr=yes
+ fi
+fi
+]) # AC_TDD_GCOV
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 6140c54..5d37da3 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -510,11 +510,9 @@ static GIcon*
get_device_icon (UpDeviceKind kind,
UpDeviceState state,
guint64 time_sec,
- gchar *device_icon)
+ const gchar *device_icon)
{
- GIcon *gicon;
-
- gicon = g_icon_new_for_string (device_icon, NULL);
+ GIcon *gicon = NULL;
if (kind == UP_DEVICE_KIND_BATTERY &&
(state == UP_DEVICE_STATE_FULLY_CHARGED ||
@@ -538,6 +536,9 @@ get_device_icon (UpDeviceKind kind,
}
}
+ if (gicon == NULL)
+ gicon = g_icon_new_for_string (device_icon, NULL);
+
return gicon;
}
@@ -553,20 +554,21 @@ menu_add_device (GtkMenu *menu,
GtkWidget *details_label;
GtkWidget *grid;
GIcon *device_gicons;
- gchar *device_icon = NULL;
- gchar *object_path = NULL;
+ const gchar *device_icon = NULL;
+ const gchar *object_path = NULL;
gdouble percentage;
guint64 time;
const gchar *device_name;
gchar *short_details = NULL;
gchar *details = NULL;
gchar *accessible_name = NULL;
+ AtkObject *atk_object;
if (device == NULL)
return;
g_variant_get (device,
- "(susdut)",
+ "(&su&sdut)",
&object_path,
&kind,
&device_icon,
@@ -583,6 +585,7 @@ menu_add_device (GtkMenu *menu,
device_gicons = get_device_icon (kind, state, time, device_icon);
icon = gtk_image_new_from_gicon (device_gicons,
GTK_ICON_SIZE_SMALL_TOOLBAR);
+ g_clear_object (&device_gicons);
device_name = device_kind_to_localised_string (kind);
@@ -590,6 +593,9 @@ menu_add_device (GtkMenu *menu,
/* Create menu item */
item = gtk_image_menu_item_new ();
+ atk_object = gtk_widget_get_accessible(item);
+ if (atk_object != NULL)
+ atk_object_set_name (atk_object, accessible_name);
grid = gtk_grid_new ();
gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
@@ -607,8 +613,6 @@ menu_add_device (GtkMenu *menu,
g_free (short_details);
g_free (details);
g_free (accessible_name);
- g_free (device_icon);
- g_free (object_path);
}
static gsize
@@ -808,6 +812,7 @@ put_primary_device (IndicatorPower *self,
gtk_image_set_from_gicon (self->status_image,
device_gicons,
GTK_ICON_SIZE_LARGE_TOOLBAR);
+ g_clear_object (&device_gicons);
gtk_widget_show (GTK_WIDGET (self->status_image));