Merge lp:~charlesk/indicator-datetime/cmakeify into lp:indicator-datetime/14.04

Proposed by Charles Kerr
Status: Merged
Approved by: Ted Gould
Approved revision: 298
Merged at revision: 281
Proposed branch: lp:~charlesk/indicator-datetime/cmakeify
Merge into: lp:indicator-datetime/14.04
Diff against target: 1504 lines (+567/-540)
33 files modified
CMakeLists.txt (+103/-0)
INSTALL (+75/-0)
Makefile.am (+0/-39)
Makefile.am.coverage (+0/-48)
autogen.sh (+0/-11)
cmake/FindIntltool.cmake (+23/-0)
cmake/GCov.cmake (+50/-0)
cmake/GdbusCodegen.cmake (+36/-0)
cmake/Translations.cmake (+41/-0)
cmake/UseGSettings.cmake (+23/-0)
configure.ac (+0/-192)
data/CMakeLists.txt (+66/-0)
data/Makefile.am (+0/-45)
data/indicator-datetime.service.in (+1/-1)
debian/control (+4/-3)
debian/indicator-datetime.install (+1/-1)
debian/rules (+2/-8)
panel/CMakeLists.txt (+25/-0)
panel/datetime-prefs-locations.c (+13/-7)
panel/datetime-prefs.c (+25/-15)
po/CMakeLists.txt (+3/-0)
po/POTFILES.in (+2/-2)
src/CMakeLists.txt (+45/-0)
src/Makefile.am (+0/-88)
src/clock-live.c (+1/-3)
src/main.c (+0/-2)
src/planner-eds.c (+0/-2)
src/service.c (+1/-3)
src/timezone-file.c (+0/-2)
src/timezone-geoclue.c (+1/-3)
src/utils.c (+3/-7)
tests/CMakeLists.txt (+23/-0)
tests/Makefile.am (+0/-58)
To merge this branch: bzr merge lp:~charlesk/indicator-datetime/cmakeify
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+192598@code.launchpad.net

Commit message

Switch the build system to cmake

Description of the change

This is step 2 of work to increase test coverage in indicator-datetime for bug #1237509. The first step decoupled some of datetime's code to make unit tests possible. This step switches the build system to cmake, and step 3 will add test coverage.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
292. By Charles Kerr

update POTFILES.in to reflect that the g-c-c panel code's been moved to panel/

293. By Charles Kerr

remove libtool reference from debian/rules

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
294. By Charles Kerr

look for indicator-datetime-service in usr/lib/*/indicator-datetime/indicator-datetime-service

295. By Charles Kerr

point the dbus service file at pkglibexecdir

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Pete Woods (pete-woods) wrote :

The cmake stuff all looks pretty reasonable to me. The one thing I'd change is the GETTEXT_PACKAGE variable. It messes up the dh_translations script, which only does a trivial grep of the root CMakeLists.txt file. You'll have to explicitly put:

set (GETTEXT_PACKAGE "indicator-datetime")

296. By Charles Kerr

set GETTEXT_PACKAGE to an actual string to make dh_translations happier

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
297. By Charles Kerr

fix DPKGDATADIR definition for locating the datetime-panel.ui file

298. By Charles Kerr

let service know how to launch gnome-control-center on the desktop

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote :

Checked packages and they're the same!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'CMakeLists.txt'
--- CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ CMakeLists.txt 2013-10-30 22:00:17 +0000
@@ -0,0 +1,103 @@
1project (indicator-datetime C CXX)
2cmake_minimum_required (VERSION 2.8.9)
3
4list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
5
6set (PROJECT_VERSION "14.04.0")
7set (PACKAGE ${CMAKE_PROJECT_NAME})
8set (GETTEXT_PACKAGE "indicator-datetime")
9add_definitions (-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}"
10 -DGNOMELOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
11
12option (enable_tests "Build the package's automatic tests." ON)
13option (enable_lcov "Generate lcov code coverage reports." ON)
14
15##
16## GNU standard installation directories
17##
18
19include (GNUInstallDirs)
20if (EXISTS "/etc/debian_version") # Workaround for libexecdir on debian
21 set (CMAKE_INSTALL_LIBEXECDIR "${CMAKE_INSTALL_LIBDIR}")
22 set (CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
23endif ()
24set (CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
25set (CMAKE_INSTALL_FULL_PKGLIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
26
27##
28## Check for prerequisites
29##
30
31find_package (PkgConfig REQUIRED)
32include (FindPkgConfig)
33
34pkg_check_modules (SERVICE_DEPS REQUIRED
35 glib-2.0>=2.36
36 gio-unix-2.0>=2.36
37 geoclue>=0.12
38 libical>=0.48
39 libecal-1.2>=3.5
40 libedataserver-1.2>=3.5
41 libnotify>=0.7.6
42 url-dispatcher-1>=1
43 json-glib-1.0>=0.16.2)
44include_directories (${SERVICE_INCLUDE_DIRS})
45
46pkg_check_modules (PANEL_DEPS
47 glib-2.0>=2.36
48 gio-unix-2.0>=2.36
49 gtk+-3.0>=3.1.4
50 timezonemap
51 libgnome-control-center
52 polkit-gobject-1)
53if (PANEL_DEPS_FOUND)
54 set (BUILD_PANEL 1)
55endif ()
56
57##
58## custom targets
59##
60
61set (ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION})
62add_custom_target (dist
63 COMMAND bzr export --root=${ARCHIVE_NAME} ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz
64 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
65
66add_custom_target (clean-coverage
67 COMMAND find ${CMAKE_BINARY_DIR} -name '*.gcda' | xargs rm -f)
68
69add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 --inline-suppr
70 ${CMAKE_SOURCE_DIR}/src
71 ${CMAKE_SOURCE_DIR}/tests)
72
73##
74## Actual building
75##
76
77set (CC_WARNING_ARGS " -Wall -Wshadow -Wextra -Wunused -Wformat=2 -Wno-missing-field-initializers")
78
79include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src)
80include_directories (${CMAKE_CURRENT_BINARY_DIR}/src)
81
82# testing & coverage
83if (${enable_tests})
84 set (GTEST_SOURCE_DIR /usr/src/gtest/src)
85 set (GTEST_INCLUDE_DIR ${GTEST_SOURCE_DIR}/..)
86 set (GTEST_LIBS -lpthread)
87 enable_testing ()
88 if (${enable_lcov})
89 include(GCov)
90 endif ()
91endif ()
92
93# actually build things
94add_subdirectory (src)
95if (BUILD_PANEL)
96 add_subdirectory (panel)
97endif ()
98add_subdirectory (data)
99add_subdirectory (po)
100if (${enable_tests})
101 add_subdirectory (tests)
102endif ()
103
0104
=== added file 'INSTALL'
--- INSTALL 1970-01-01 00:00:00 +0000
+++ INSTALL 2013-10-30 22:00:17 +0000
@@ -0,0 +1,75 @@
1#
2# Copyright (C) 2013 Canonical Ltd
3#
4# This program is free software: you can redistribute it and/or modify
5# it under the terms of the GNU General Public License version 3 as
6# published by the Free Software Foundation.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15#
16
17BUILD DEPENDENCIES
18==================
19
20build dependencies for indicator-datetime-service
21 * glib-2.0 >= 2.36
22 * gio-unix-2.0 >= 2.36
23 * geoclue >= 0.12
24 * libical >= 0.48
25 * libecal-1.2 >= 3.5
26 * libedataserver-1.2 >= 3.5
27 * libnotify >= 0.7.6
28 * url-dispatcher-1 >= 1
29 * json-glib-1.0 >= 0.16.2
30
31
32Additional build dependencies for the gnome-control-center panel:
33 * gtk+-3.0>=3.1.4
34 * timezonemap
35 * libgnome-control-center
36 * polkit-gobject-1
37
38Build dependencies for testing / code coverage:
39 * gcovr (gcovr, 2.4 or later)
40 * lcov (lcov, 1.9 or later)
41 * google test (libgtest-dev, 1.6.0 or later)
42 * cppcheck (cppcheck)
43
44
45Building the code
46-----------------
47 1. $ cd indicator-datetime-X.Y.Z
48 2. $ mkdir build
49 3. $ cd build
50 4. $ cmake ..
51 or
52 $ cmake -DCMAKE_INSTALL_PREFIX=/your/install/prefix/here ..
53 or
54 $ cmake -GNinja ..
55 5. $ make
56
57Running the tests
58-----------------
59 1. $ cd indicator-datetime-X.Y.Z
60 2. $ mkdir build
61 3. $ cd build
62 4. $ cmake ..
63 5. $ make
64 6. $ make test
65 7. $ make cppcheck
66
67Generating Test Coverage Reports
68--------------------------------
69 1. $ cd indicator-datetime-X.Y.Z
70 2. $ mkdir build-coverage
71 3. $ cd build-coverage
72 4. $ cmake -DCMAKE_BUILD_TYPE=coverage ..
73 5. $ make
74 6. $ make coverage-html
75
076
=== removed file 'Makefile.am'
--- Makefile.am 2013-06-28 21:41:31 +0000
+++ Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,39 +0,0 @@
1ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
2
3SUBDIRS = po data src
4
5if BUILD_TESTS
6SUBDIRS += tests
7# build src first
8tests: src
9endif
10
11EXTRA_DIST = autogen.sh
12
13dist-hook:
14 @if test -d "$(top_srcdir)/.bzr"; \
15 then \
16 echo Creating ChangeLog && \
17 ( cd "$(top_srcdir)" && \
18 echo '# Generated by Makefile. Do not edit.'; echo; \
19 $(top_srcdir)/build-aux/missing --run bzr log --gnu-changelog ) > ChangeLog.tmp \
20 && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
21 || (rm -f ChangeLog.tmp; \
22 echo Failed to generate ChangeLog >&2 ); \
23 else \
24 echo Failed to generate ChangeLog: not a branch >&2; \
25 fi
26 @if test -d "$(top_srcdir)/.bzr"; \
27 then \
28 echo Creating AUTHORS && \
29 ( cd "$(top_srcdir)" && \
30 echo '# Generated by Makefile. Do not edit.'; echo; \
31 $(top_srcdir)/build-aux/missing --run bzr log --long --levels=0 | grep -e "^\s*author:" -e "^\s*committer:" | cut -d ":" -f 2 | cut -d "<" -f 1 | sort -u) > AUTHORS.tmp \
32 && mv -f AUTHORS.tmp $(top_distdir)/AUTHORS \
33 || (rm -f AUTHORS.tmp; \
34 echo Failed to generate AUTHORS >&2 ); \
35 else \
36 echo Failed to generate AUTHORS: not a branch >&2; \
37 fi
38
39include $(top_srcdir)/Makefile.am.coverage
400
=== removed file 'Makefile.am.coverage'
--- Makefile.am.coverage 2012-03-27 22:17:43 +0000
+++ Makefile.am.coverage 1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
1
2# Coverage targets
3
4.PHONY: clean-gcno clean-gcda \
5 coverage-html generate-coverage-html clean-coverage-html \
6 coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
7
8clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
9
10if HAVE_GCOV
11
12clean-gcno:
13 @echo Removing old coverage instrumentation
14 -find -name '*.gcno' -print | xargs -r rm
15
16clean-gcda:
17 @echo Removing old coverage results
18 -find -name '*.gcda' -print | xargs -r rm
19
20coverage-html: clean-gcda
21 -$(MAKE) $(AM_MAKEFLAGS) -k check
22 $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
23
24generate-coverage-html:
25 @echo Collecting coverage data
26 $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
27 LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
28
29clean-coverage-html: clean-gcda
30 -$(LCOV) --directory $(top_builddir) -z
31 -rm -rf coverage.info coveragereport
32
33if HAVE_GCOVR
34
35coverage-gcovr: clean-gcda
36 -$(MAKE) $(AM_MAKEFLAGS) -k check
37 $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr
38
39generate-coverage-gcovr:
40 @echo Generating coverage GCOVR report
41 $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
42
43clean-coverage-gcovr: clean-gcda
44 -rm -rf $(top_builddir)/coverage.xml
45
46endif # HAVE_GCOVR
47
48endif # HAVE_GCOV
490
=== removed file 'autogen.sh'
--- autogen.sh 2010-03-04 18:01:39 +0000
+++ autogen.sh 1970-01-01 00:00:00 +0000
@@ -1,11 +0,0 @@
1#!/bin/sh
2
3PKG_NAME="indicator-datetime"
4
5which gnome-autogen.sh || {
6 echo "You need gnome-common from GNOME Git"
7 exit 1
8}
9
10USE_GNOME2_MACROS=1 \
11. gnome-autogen.sh $@
120
=== added directory 'cmake'
=== added file 'cmake/FindIntltool.cmake'
--- cmake/FindIntltool.cmake 1970-01-01 00:00:00 +0000
+++ cmake/FindIntltool.cmake 2013-10-30 22:00:17 +0000
@@ -0,0 +1,23 @@
1# FindIntltool.cmake
2#
3# Jim Nelson <jim@yorba.org>
4# Copyright 2012 Yorba Foundation
5
6find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge)
7
8if (INTLTOOL_MERGE_EXECUTABLE)
9 set (INTLTOOL_MERGE_FOUND TRUE)
10else (INTLTOOL_MERGE_EXECUTABLE)
11 set (INTLTOOL_MERGE_FOUND FALSE)
12endif (INTLTOOL_MERGE_EXECUTABLE)
13
14if (INTLTOOL_MERGE_FOUND)
15 macro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
16 add_custom_target (geary.desktop ALL
17 ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir}
18 ${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.desktop.in ${desktop_id}.desktop
19 )
20 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary.desktop DESTINATION /usr/share/applications)
21 endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
22endif (INTLTOOL_MERGE_FOUND)
23
024
=== added file 'cmake/GCov.cmake'
--- cmake/GCov.cmake 1970-01-01 00:00:00 +0000
+++ cmake/GCov.cmake 2013-10-30 22:00:17 +0000
@@ -0,0 +1,50 @@
1if (CMAKE_BUILD_TYPE MATCHES coverage)
2 set(GCOV_FLAGS "${GCOV_FLAGS} --coverage")
3 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCOV_FLAGS}")
4 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${GCOV_FLAGS}")
5 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GCOV_FLAGS}")
6 set(GCOV_LIBS ${GCOV_LIBS} gcov)
7
8 find_program(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin")
9 if (NOT GCOVR_EXECUTABLE)
10 message(STATUS "Gcovr binary was not found, can not generate XML coverage info.")
11 else ()
12 message(STATUS "Gcovr found, can generate XML coverage info.")
13 add_custom_target (coverage-xml
14 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
15 COMMAND "${GCOVR_EXECUTABLE}" --exclude="test.*" -x -r "${CMAKE_SOURCE_DIR}"
16 --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml)
17 endif()
18
19 find_program(LCOV_EXECUTABLE lcov HINTS ${LCOV_ROOT} "${GCOVR_ROOT}/bin")
20 find_program(GENHTML_EXECUTABLE genhtml HINTS ${GENHTML_ROOT})
21 if (NOT LCOV_EXECUTABLE)
22 message(STATUS "Lcov binary was not found, can not generate HTML coverage info.")
23 else ()
24 if(NOT GENHTML_EXECUTABLE)
25 message(STATUS "Genthml binary not found, can not generate HTML coverage info.")
26 else()
27 message(STATUS "Lcov and genhtml found, can generate HTML coverage info.")
28 add_custom_target (coverage-html
29 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
30 COMMAND "${CMAKE_CTEST_COMMAND}" --force-new-ctest-process --verbose
31 COMMAND "${LCOV_EXECUTABLE}" --directory ${CMAKE_BINARY_DIR} --capture | ${CMAKE_SOURCE_DIR}/trim-lcov.py > dconf-lcov.info
32 COMMAND LANG=C "${GENHTML_EXECUTABLE}" --prefix ${CMAKE_BINARY_DIR} --output-directory lcov-html --legend --show-details dconf-lcov.info
33 COMMAND ${CMAKE_COMMAND} -E echo ""
34 COMMAND ${CMAKE_COMMAND} -E echo "file://${CMAKE_BINARY_DIR}/lcov-html/index.html"
35 COMMAND ${CMAKE_COMMAND} -E echo "")
36 #COMMAND "${LCOV_EXECUTABLE}" --directory ${CMAKE_BINARY_DIR} --capture --output-file coverage.info --no-checksum
37 #COMMAND "${GENHTML_EXECUTABLE}" --prefix ${CMAKE_BINARY_DIR} --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
38 #COMMAND ${CMAKE_COMMAND} -E echo "\\#define foo \\\"bar\\\""
39 #)
40 endif()
41 endif()
42endif()
43
44
45 #$(MAKE) $(AM_MAKEFLAGS) check
46 #lcov --directory $(top_builddir) --capture --test-name dconf | $(top_srcdir)/trim-lcov.py > dconf-lcov.info
47 #LANG=C genhtml --prefix $(top_builddir) --output-directory lcov-html --legend --show-details dconf-lcov.info
48 #@echo
49 #@echo " file://$(abs_top_builddir)/lcov-html/index.html"
50 #@echo
051
=== added file 'cmake/GdbusCodegen.cmake'
--- cmake/GdbusCodegen.cmake 1970-01-01 00:00:00 +0000
+++ cmake/GdbusCodegen.cmake 2013-10-30 22:00:17 +0000
@@ -0,0 +1,36 @@
1cmake_minimum_required(VERSION 2.6)
2if(POLICY CMP0011)
3 cmake_policy(SET CMP0011 NEW)
4endif(POLICY CMP0011)
5
6find_program(GDBUS_CODEGEN NAMES gdbus-codegen DOC "gdbus-codegen executable")
7if(NOT GDBUS_CODEGEN)
8 message(FATAL_ERROR "Excutable gdbus-codegen not found")
9endif()
10
11macro(add_gdbus_codegen outfiles name prefix service_xml)
12 add_custom_command(
13 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
14 COMMAND "${GDBUS_CODEGEN}"
15 --interface-prefix "${prefix}"
16 --generate-c-code "${name}"
17 "${service_xml}"
18 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
19 DEPENDS ${ARGN} "${service_xml}"
20 )
21 list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
22endmacro(add_gdbus_codegen)
23
24macro(add_gdbus_codegen_with_namespace outfiles name prefix namespace service_xml)
25 add_custom_command(
26 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
27 COMMAND "${GDBUS_CODEGEN}"
28 --interface-prefix "${prefix}"
29 --generate-c-code "${name}"
30 --c-namespace "${namespace}"
31 "${service_xml}"
32 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
33 DEPENDS ${ARGN} "${service_xml}"
34 )
35 list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
36endmacro(add_gdbus_codegen_with_namespace)
037
=== added file 'cmake/Translations.cmake'
--- cmake/Translations.cmake 1970-01-01 00:00:00 +0000
+++ cmake/Translations.cmake 2013-10-30 22:00:17 +0000
@@ -0,0 +1,41 @@
1# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
2
3macro(add_translations_directory NLS_PACKAGE)
4 add_custom_target (i18n ALL)
5 find_program (MSGFMT_EXECUTABLE msgfmt)
6 file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
7 foreach (PO_INPUT ${PO_FILES})
8 get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
9 set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
10 add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
11
12 install (FILES ${MO_OUTPUT} DESTINATION
13 ${CMAKE_INSTALL_LOCALEDIR}/${PO_INPUT_BASE}/LC_MESSAGES
14 RENAME ${NLS_PACKAGE}.mo)
15 endforeach (PO_INPUT ${PO_FILES})
16endmacro(add_translations_directory)
17
18
19macro(add_translations_catalog NLS_PACKAGE)
20 add_custom_target (pot COMMENT “Building translation catalog.”)
21 find_program (XGETTEXT_EXECUTABLE xgettext)
22
23
24 set(C_SOURCE "")
25
26 foreach(FILES_INPUT ${ARGN})
27 file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c)
28 foreach(C_FILE ${SOURCE_FILES})
29 set(C_SOURCE ${C_SOURCE} ${C_FILE})
30 endforeach()
31 file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala)
32 foreach(C_FILE ${SOURCE_FILES})
33 set(C_SOURCE ${C_SOURCE} ${C_FILE})
34 endforeach()
35 endforeach()
36
37 add_custom_command (TARGET pot COMMAND
38 ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
39 ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --keyword="N_" --from-code=UTF-8
40 )
41endmacro()
042
=== added file 'cmake/UseGSettings.cmake'
--- cmake/UseGSettings.cmake 1970-01-01 00:00:00 +0000
+++ cmake/UseGSettings.cmake 2013-10-30 22:00:17 +0000
@@ -0,0 +1,23 @@
1# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them.
2
3macro(add_schema SCHEMA_NAME)
4
5 set(PKG_CONFIG_EXECUTABLE pkg-config)
6 set(GSETTINGS_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/glib-2.0/schemas")
7
8 # Run the validator and error if it fails
9 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_compile_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
10 execute_process (COMMAND ${_glib_compile_schemas} --dry-run --schema-file=${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
11
12 if (_schemas_invalid)
13 message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
14 endif (_schemas_invalid)
15
16 # Actually install and recomple schemas
17 message (STATUS "${GSETTINGS_DIR} is the GSettings install dir")
18 install (FILES ${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
19
20 install (CODE "message (STATUS \"Compiling GSettings schemas\")")
21 install (CODE "execute_process (COMMAND ${_glib_compile_schemas} ${GSETTINGS_DIR})")
22endmacro()
23
024
=== removed file 'configure.ac'
--- configure.ac 2013-10-16 22:14:11 +0000
+++ configure.ac 1970-01-01 00:00:00 +0000
@@ -1,192 +0,0 @@
1AC_INIT([indicator-datetime],
2 [13.10.0],
3 [http://bugs.launchpad.net/indicator-datetime],
4 [indicator-datetime],
5 [http://launchpad.net/indicator-datetime])
6AC_COPYRIGHT([Copyright 2009-2011 Canonical])
7
8AC_PREREQ([2.64])
9
10AC_CONFIG_HEADERS([config.h])
11AC_CONFIG_SRCDIR([configure.ac])
12AC_CONFIG_MACRO_DIR([m4])
13AC_CONFIG_AUX_DIR([build-aux])
14
15AM_INIT_AUTOMAKE([check-news 1.11 -Wall])
16AM_MAINTAINER_MODE([enable])
17
18AM_SILENT_RULES([yes])
19
20# Check for programs
21AC_PROG_CC
22AM_PROG_CC_C_O
23AC_PROG_CXX
24AC_HEADER_STDC
25AM_PROG_AR
26
27# Initialize libtool
28LT_PREREQ([2.2])
29LT_INIT([disable-static])
30
31AC_CHECK_LIB([m],[pow])
32
33AC_ARG_ENABLE([deprecations],
34 [AS_HELP_STRING([--enable-deprecations],
35 [allow deprecated API usage @<:@default=yes@:>@])],
36 [],
37 [enable_deprecations=yes])
38AS_IF([test "x$enable_deprecations" = xno],
39 [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES"]
40)
41
42PKG_PROG_PKG_CONFIG
43
44###########################
45# Dependencies
46###########################
47
48GLIB_REQUIRED_VERSION=2.35.4
49GIO_REQUIRED_VERSION=2.25.11
50GEOCLUE_REQUIRED_VERSION=0.12.0
51ICAL_REQUIRED_VERSION=0.48
52ECAL_REQUIRED_VERSION=3.5
53EDS_REQUIRED_VERSION=3.5
54LIBNOTIFY_REQUIRED_VERSION=0.7.6
55URL_DISPATCHER_1_REQUIRED_VERSION=1
56JSON_GLIB_REQUIRED_VERSION=0.16.2
57
58GTK3_REQUIRED_VERSION=3.1.4
59
60PKG_CHECK_MODULES(SERVICE, [glib-2.0 >= $GLIB_REQUIRED_VERSION
61 gio-2.0 >= $GIO_REQUIRED_VERSION
62 geoclue >= $GEOCLUE_REQUIRED_VERSION
63 libical >= $ICAL_REQUIRED_VERSION
64 libecal-1.2 >= $ECAL_REQUIRED_VERSION
65 libedataserver-1.2 >= $EDS_REQUIRED_VERSION
66 libnotify >= $LIBNOTIFY_REQUIRED_VERSION
67 url-dispatcher-1 >= $URL_DISPATCHER_1_REQUIRED_VERSION
68 json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION])
69
70###########################
71# Control Center panel
72###########################
73
74AC_ARG_WITH([ccpanel],
75 AS_HELP_STRING([--with-ccpanel], [enable Control Center panel]),,
76 with_ccpanel=auto)
77
78if test x"$with_ccpanel" != x"no" ; then
79 PKG_CHECK_MODULES([PREF],
80 [gio-2.0 >= $GIO_REQUIRED_VERSION
81 gtk+-3.0 >= $GTK3_REQUIRED_VERSION
82 timezonemap
83 libgnome-control-center
84 polkit-gobject-1],
85 [have_ccpanel=yes],
86 [have_ccpanel=no])
87 if test x${have_ccpanel} = xyes; then
88 AC_DEFINE(HAVE_CCPANEL, 1, [Define to 1 to enable Control Center panel])
89 PKG_CHECK_MODULES(LIBMAP, gio-2.0 >= $GIO_REQUIRED_VERSION
90 gtk+-3.0 >= $GTK3_REQUIRED_VERSION)
91 fi
92 if test x${with_ccpanel} = xyes && test x${have_ccpanel} = xno; then
93 AC_MSG_ERROR([Control Center panel configured but not found])
94 fi
95else
96 have_ccpanel=no
97fi
98AM_CONDITIONAL(BUILD_CCPANEL, test x${have_ccpanel} = xyes)
99
100###########################
101# Grab the GSettings Macros
102###########################
103
104GLIB_GSETTINGS
105
106###########################
107# gcov coverage reporting
108###########################
109
110m4_include([m4/gcov.m4])
111AC_TDD_GCOV
112AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
113AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
114AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
115AC_SUBST(COVERAGE_CFLAGS)
116AC_SUBST(COVERAGE_LDFLAGS)
117
118###########################
119# Google Test framework
120###########################
121
122AC_ARG_ENABLE([tests],
123 [AS_HELP_STRING([--disable-tests], [Disable test scripts and tools (default=auto)])],
124 [enable_tests=${enableval}],
125 [enable_tests=auto])
126if test "x$enable_tests" != "xno"; then
127 m4_include([m4/gtest.m4])
128 CHECK_GTEST
129 CHECK_XORG_GTEST
130 if test "x$enable_tests" = "xauto"; then
131 enable_tests=${have_gtest}
132 elif test "x$enable_tests" = "xyes" && test "x$have_gtest" != "xyes"; then
133 AC_MSG_ERROR([tests were requested but gtest is not installed.])
134 fi
135fi
136AM_CONDITIONAL([BUILD_TESTS],[test "x$enable_tests" = "xyes"])
137
138##############################
139# Custom Junk
140##############################
141
142AC_DEFUN([AC_DEFINE_PATH], [
143 test "x$prefix" = xNONE && prefix="$ac_default_prefix"
144 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
145 ac_define_path=`eval echo [$]$2`
146 ac_define_path=`eval echo [$]ac_define_path`
147 $1="$ac_define_path"
148 AC_SUBST($1)
149 ifelse($3, ,
150 AC_DEFINE_UNQUOTED($1, "$ac_define_path"),
151 AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3))
152])
153
154###########################
155# Internationalization
156###########################
157IT_PROG_INTLTOOL([0.41.0])
158
159GETTEXT_PACKAGE=indicator-datetime
160AC_SUBST(GETTEXT_PACKAGE)
161AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default get text domain])
162AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory])
163
164AM_GLIB_GNU_GETTEXT
165
166###########################
167# Files
168###########################
169
170AC_CONFIG_FILES([
171Makefile
172src/Makefile
173data/Makefile
174tests/Makefile
175po/Makefile.in
176])
177AC_OUTPUT
178
179###########################
180# Results
181###########################
182
183AC_MSG_NOTICE([
184
185Date and Time Indicator Configuration:
186
187 Prefix: $prefix
188 CC Panel: $have_ccpanel
189 CC Panel Dir: $CCPANELDIR
190 Unit Tests: $enable_tests
191 gcov: $use_gcov
192])
1930
=== added file 'data/CMakeLists.txt'
--- data/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ data/CMakeLists.txt 2013-10-30 22:00:17 +0000
@@ -0,0 +1,66 @@
1##
2## GSettings schema
3##
4
5include (UseGSettings)
6set (SCHEMA_NAME "com.canonical.indicator.datetime.gschema.xml")
7set (SCHEMA_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME}")
8add_schema (${SCHEMA_FILE})
9
10
11##
12## DBus Service File
13##
14
15# where to install
16set (DBUS_SERVICE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/dbus-1/services")
17message (STATUS "${DBUS_SERVICE_DIR} is the DBus Service File install dir")
18
19set (SERVICE_NAME "${CMAKE_PROJECT_NAME}.service")
20set (SERVICE_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_NAME}")
21set (SERVICE_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SERVICE_NAME}.in")
22
23# build it
24set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}")
25configure_file ("${SERVICE_FILE_IN}" "${SERVICE_FILE}")
26
27# install it
28install (FILES "${SERVICE_FILE}"
29 DESTINATION "${DBUS_SERVICE_DIR}")
30
31
32##
33## Unity Indicator File
34##
35
36# where to install
37set (UNITY_INDICATOR_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/unity/indicators")
38message (STATUS "${UNITY_INDICATOR_DIR} is the Unity Indicator install dir")
39
40set (UNITY_INDICATOR_NAME "com.canonical.indicator.datetime")
41set (UNITY_INDICATOR_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${UNITY_INDICATOR_NAME}")
42
43install (FILES "${UNITY_INDICATOR_FILE}"
44 DESTINATION "${UNITY_INDICATOR_DIR}")
45
46
47##
48## gnome-control-center panel: .ui and .desktop files
49##
50
51if (BUILD_PANEL)
52
53 # the .ui file
54 install (FILES "datetime-dialog.ui"
55 DESTINATION "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}")
56
57 # the .desktop file
58 set (DESKTOP_NAME "gnome-indicator-datetime-panel.desktop")
59 set (DESKTOP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_NAME}")
60 set (DESKTOP_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${DESKTOP_NAME}.in")
61 set (ENV{LC_ALL} "C")
62 execute_process (COMMAND intltool-merge -quiet --desktop-style --utf8 "${CMAKE_SOURCE_DIR}/po" "${DESKTOP_FILE_IN}" "${DESKTOP_FILE}")
63 install (FILES ${DESKTOP_FILE}
64 DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
65
66endif ()
067
=== removed file 'data/Makefile.am'
--- data/Makefile.am 2013-06-28 21:41:31 +0000
+++ data/Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
1BUILT_SOURCES=
2CLEANFILES=
3EXTRA_DIST=
4
5#
6# the indicator bus file
7#
8
9indicatorsdir = $(prefix)/share/unity/indicators
10dist_indicators_DATA = com.canonical.indicator.datetime
11
12#
13# the gsettings
14#
15
16gsettings_SCHEMAS = com.canonical.indicator.datetime.gschema.xml
17@GSETTINGS_RULES@
18EXTRA_DIST += $(gsettings_SCHEMAS)
19
20#
21# the dbus service file
22#
23
24dbus_servicesdir = $(datadir)/dbus-1/services
25dbus_services_DATA = indicator-datetime.service
26dbus_services_in = $(dbus_services_DATA:.service=.service.in)
27$(dbus_services_DATA): $(dbus_services_in)
28 $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
29BUILT_SOURCES += $(dbus_services_DATA)
30CLEANFILES += $(dbus_services_DATA)
31EXTRA_DIST += $(dbus_services_in)
32
33#
34# the gnome-control-center panel
35#
36
37if BUILD_CCPANEL
38 pkgdata_DATA = datetime-dialog.ui
39 @INTLTOOL_DESKTOP_RULE@
40 desktopdir = $(datadir)/applications
41 desktop_DATA = gnome-indicator-datetime-panel.desktop
42 EXTRA_DIST += $(desktop_DATA)
43 CLEANFILES += $(desktop_DATA)
44endif
45EXTRA_DIST += datetime-dialog.ui $(desktop_DATA:.desktop=.desktop.in)
460
=== modified file 'data/indicator-datetime.service.in'
--- data/indicator-datetime.service.in 2011-01-17 17:41:28 +0000
+++ data/indicator-datetime.service.in 2013-10-30 22:00:17 +0000
@@ -1,3 +1,3 @@
1[D-BUS Service]1[D-BUS Service]
2Name=com.canonical.indicator.datetime2Name=com.canonical.indicator.datetime
3Exec=@libexecdir@/indicator-datetime-service3Exec=@pkglibexecdir@/indicator-datetime-service
44
=== modified file 'debian/control'
--- debian/control 2013-10-16 22:14:11 +0000
+++ debian/control 2013-10-30 22:00:17 +0000
@@ -2,9 +2,10 @@
2Section: misc2Section: misc
3Priority: optional3Priority: optional
4Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>4Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
5Build-Depends: debhelper (>= 9), 5Build-Depends: cmake,
6 quilt,6 dbus,
7 dh-autoreconf,7 debhelper (>= 9),
8 dh-translations,
8 intltool (>= 0.35.0), 9 intltool (>= 0.35.0),
9 gnome-common,10 gnome-common,
10 libxorg-gtest-dev,11 libxorg-gtest-dev,
1112
=== modified file 'debian/indicator-datetime.install'
--- debian/indicator-datetime.install 2013-08-27 14:52:26 +0000
+++ debian/indicator-datetime.install 2013-10-30 22:00:17 +0000
@@ -1,5 +1,5 @@
1usr/share/glib-2.0/schemas/*1usr/share/glib-2.0/schemas/*
2usr/share/dbus-1/services/*2usr/share/dbus-1/services/*
3usr/share/unity/indicators/*3usr/share/unity/indicators/*
4usr/lib/*/indicator-datetime-service4usr/lib/*/indicator-datetime/indicator-datetime-service
5usr/share/locale/*5usr/share/locale/*
66
=== modified file 'debian/rules'
--- debian/rules 2013-09-02 14:08:49 +0000
+++ debian/rules 2013-10-30 22:00:17 +0000
@@ -3,17 +3,11 @@
3LDFLAGS += -Wl,-z,defs -Wl,--as-needed3LDFLAGS += -Wl,-z,defs -Wl,--as-needed
44
5%:5%:
6 dh $@ --with quilt,autoreconf6 dh $@ --with translations
7
8override_dh_autoreconf:
9 NOCONFIGURE=1 dh_autoreconf ./autogen.sh
10
11override_dh_auto_configure:
12 dh_auto_configure -- --disable-static --disable-silent-rules
137
14override_dh_install:8override_dh_install:
15 cd po; intltool-update --pot --verbose9 cd po; intltool-update --pot --verbose
16 dh_install -X.la --fail-missing10 dh_install --fail-missing
17 # Language packs11 # Language packs
18 for d in $$(find debian/indicator-datetime -type f \( -name "*.desktop" -o -name "*.directory" \) ); do \12 for d in $$(find debian/indicator-datetime -type f \( -name "*.desktop" -o -name "*.directory" \) ); do \
19 sed -ri '/^(Name|GenericName|Comment|X-GNOME-FullName)\[/d' $$d; \13 sed -ri '/^(Name|GenericName|Comment|X-GNOME-FullName)\[/d' $$d; \
2014
=== added directory 'panel'
=== added file 'panel/CMakeLists.txt'
--- panel/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ panel/CMakeLists.txt 2013-10-30 22:00:17 +0000
@@ -0,0 +1,25 @@
1set (PANEL_LIB "indicator-datetime")
2
3add_definitions (-DPKGDATADIR="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}")
4
5add_library (${PANEL_LIB} SHARED
6 datetime-prefs.c
7 datetime-prefs-locations.c
8 datetime-prefs-locations.h
9 ${CMAKE_SOURCE_DIR}/src/utils.c
10 ${CMAKE_SOURCE_DIR}/src/utils.h
11 ${CMAKE_SOURCE_DIR}/src/settings-shared.h)
12
13include_directories (${PANEL_DEPS_INCLUDE_DIRS})
14
15link_directories (${PANEL_DEPS_LIBRARY_DIRS})
16
17set_property (TARGET ${PANEL_LIB}
18 APPEND_STRING PROPERTY COMPILE_FLAGS
19 " -g ${CC_WARNING_ARGS} ${GCOV_FLAGS}")
20
21target_link_libraries (${PANEL_LIB} ${PANEL_DEPS_LIBRARIES} ${GCOV_LIBS})
22
23install (TARGETS ${PANEL_LIB}
24 DESTINATION ${CMAKE_INSTALL_LIBDIR}/control-center-1/panels)
25
026
=== renamed file 'src/datetime-prefs-locations.c' => 'panel/datetime-prefs-locations.c'
--- src/datetime-prefs-locations.c 2013-10-26 20:37:14 +0000
+++ panel/datetime-prefs-locations.c 2013-10-30 22:00:17 +0000
@@ -109,7 +109,9 @@
109}109}
110110
111static void111static void
112handle_sort(GtkWidget * button, GtkTreeView * tree_view, GCompareFunc compare)112handle_sort(GtkWidget * button G_GNUC_UNUSED,
113 GtkTreeView * tree_view,
114 GCompareFunc compare)
113{115{
114 GtkTreeModel * model = gtk_tree_view_get_model (tree_view);116 GtkTreeModel * model = gtk_tree_view_get_model (tree_view);
115 GSList * l;117 GSList * l;
@@ -180,7 +182,7 @@
180***/182***/
181183
182static void184static void
183handle_add (GtkWidget * button, GtkTreeView * tree)185handle_add (GtkWidget * button G_GNUC_UNUSED, GtkTreeView * tree)
184{186{
185 GtkListStore * store = GTK_LIST_STORE (gtk_tree_view_get_model (tree));187 GtkListStore * store = GTK_LIST_STORE (gtk_tree_view_get_model (tree));
186188
@@ -193,7 +195,7 @@
193}195}
194196
195static void197static void
196handle_remove (GtkWidget * button, GtkTreeView * tree)198handle_remove (GtkWidget * button G_GNUC_UNUSED, GtkTreeView * tree)
197{199{
198 GtkListStore * store = GTK_LIST_STORE (gtk_tree_view_get_model (tree));200 GtkListStore * store = GTK_LIST_STORE (gtk_tree_view_get_model (tree));
199 GtkTreeSelection * selection = gtk_tree_view_get_selection (tree);201 GtkTreeSelection * selection = gtk_tree_view_get_selection (tree);
@@ -290,7 +292,9 @@
290}292}
291293
292static void294static void
293handle_edit (GtkCellRendererText * renderer, gchar * path, gchar * new_text,295handle_edit (GtkCellRendererText * renderer G_GNUC_UNUSED,
296 gchar * path,
297 gchar * new_text,
294 GtkListStore * store)298 GtkListStore * store)
295{299{
296 GtkTreeIter iter;300 GtkTreeIter iter;
@@ -388,8 +392,10 @@
388}392}
389393
390static void394static void
391handle_edit_started (GtkCellRendererText * renderer, GtkCellEditable * editable,395handle_edit_started (GtkCellRendererText * renderer G_GNUC_UNUSED,
392 gchar * path, CcTimezoneCompletion * completion)396 GtkCellEditable * editable,
397 gchar * path,
398 CcTimezoneCompletion * completion)
393{399{
394 if (GTK_IS_ENTRY (editable)) {400 if (GTK_IS_ENTRY (editable)) {
395 GtkEntry *entry = GTK_ENTRY (editable);401 GtkEntry *entry = GTK_ENTRY (editable);
@@ -548,7 +554,7 @@
548}554}
549555
550static void556static void
551dialog_closed (GtkWidget * dlg, GObject * store)557dialog_closed (GtkWidget * dlg, GObject * store G_GNUC_UNUSED)
552{558{
553 /* Cleanup a tad */559 /* Cleanup a tad */
554 guint time_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dlg), "time-id"));560 guint time_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dlg), "time-id"));
555561
=== renamed file 'src/datetime-prefs-locations.h' => 'panel/datetime-prefs-locations.h'
=== renamed file 'src/datetime-prefs.c' => 'panel/datetime-prefs.c'
--- src/datetime-prefs.c 2013-09-07 12:10:53 +0000
+++ panel/datetime-prefs.c 2013-10-30 22:00:17 +0000
@@ -83,7 +83,9 @@
8383
84/* Turns the boolean property into a string gsettings */84/* Turns the boolean property into a string gsettings */
85static GVariant *85static GVariant *
86bind_hours_set (const GValue * value, const GVariantType * type, gpointer user_data)86bind_hours_set (const GValue * value,
87 const GVariantType * type G_GNUC_UNUSED,
88 gpointer user_data)
87{89{
88 const gchar * output = NULL;90 const gchar * output = NULL;
89 gboolean is_12hour_button = (gboolean)GPOINTER_TO_INT(user_data);91 gboolean is_12hour_button = (gboolean)GPOINTER_TO_INT(user_data);
@@ -121,7 +123,7 @@
121}123}
122124
123static void125static void
124widget_dependency_cb (GtkWidget * parent, GParamSpec *pspec, GtkWidget * dependent)126widget_dependency_cb (GtkWidget * parent, GParamSpec *pspec G_GNUC_UNUSED, GtkWidget * dependent)
125{127{
126 gboolean active, sensitive;128 gboolean active, sensitive;
127 g_object_get (G_OBJECT (parent),129 g_object_get (G_OBJECT (parent),
@@ -141,7 +143,7 @@
141}143}
142144
143static void145static void
144polkit_dependency_cb (GPermission * permission, GParamSpec *pspec, GtkWidget * dependent)146polkit_dependency_cb (GPermission * permission, GParamSpec *pspec G_GNUC_UNUSED, GtkWidget * dependent)
145{147{
146 gboolean allowed = FALSE;148 gboolean allowed = FALSE;
147149
@@ -152,7 +154,7 @@
152}154}
153155
154static void156static void
155add_polkit_dependency_helper (GtkWidget * parent, GParamSpec *pspec, GtkWidget * dependent)157add_polkit_dependency_helper (GtkWidget * parent, GParamSpec *pspec G_GNUC_UNUSED, GtkWidget * dependent)
156{158{
157 GtkLockButton * button = GTK_LOCK_BUTTON (parent);159 GtkLockButton * button = GTK_LOCK_BUTTON (parent);
158 GPermission * permission = gtk_lock_button_get_permission (button);160 GPermission * permission = gtk_lock_button_get_permission (button);
@@ -171,7 +173,7 @@
171}173}
172174
173static void175static void
174polkit_perm_ready (GObject *source_object, GAsyncResult *res, gpointer user_data)176polkit_perm_ready (GObject *source_object G_GNUC_UNUSED, GAsyncResult *res, gpointer user_data)
175{177{
176 GError * error = NULL;178 GError * error = NULL;
177 GPermission * permission = polkit_permission_new_finish (res, &error);179 GPermission * permission = polkit_permission_new_finish (res, &error);
@@ -204,7 +206,7 @@
204}206}
205207
206static void208static void
207toggle_ntp (GtkWidget * radio, GParamSpec * pspec, IndicatorDatetimePanel * self)209toggle_ntp (GtkWidget * radio, GParamSpec * pspec G_GNUC_UNUSED, IndicatorDatetimePanel * self)
208{210{
209 gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio));211 gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio));
210212
@@ -224,7 +226,9 @@
224}226}
225227
226static void228static void
227tz_changed (CcTimezoneMap * map, CcTimezoneLocation * location, IndicatorDatetimePanel * self)229tz_changed (CcTimezoneMap * map G_GNUC_UNUSED,
230 CcTimezoneLocation * location,
231 IndicatorDatetimePanel * self)
228{232{
229 if (location == NULL)233 if (location == NULL)
230 return;234 return;
@@ -241,7 +245,9 @@
241}245}
242246
243static void247static void
244proxy_ready (GObject *object, GAsyncResult *res, IndicatorDatetimePanel * self)248proxy_ready (GObject *object G_GNUC_UNUSED,
249 GAsyncResult *res,
250 IndicatorDatetimePanel * self)
245{251{
246 GError * error = NULL;252 GError * error = NULL;
247 IndicatorDatetimePanelPrivate * priv = self->priv;253 IndicatorDatetimePanelPrivate * priv = self->priv;
@@ -459,7 +465,7 @@
459}465}
460466
461static gboolean467static gboolean
462format_time_text (GtkWidget * spinner, gpointer user_data)468format_time_text (GtkWidget * spinner, gpointer user_data G_GNUC_UNUSED)
463{469{
464 gboolean is_time = (gboolean)GPOINTER_TO_INT (g_object_get_data (G_OBJECT (spinner), "is-time"));470 gboolean is_time = (gboolean)GPOINTER_TO_INT (g_object_get_data (G_OBJECT (spinner), "is-time"));
465471
@@ -570,8 +576,10 @@
570}576}
571577
572static gboolean578static gboolean
573timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model,579timezone_selected (GtkEntryCompletion * widget G_GNUC_UNUSED,
574 GtkTreeIter * iter, IndicatorDatetimePanel * self)580 GtkTreeModel * model,
581 GtkTreeIter * iter,
582 IndicatorDatetimePanel * self)
575{583{
576 const gchar * name, * zone;584 const gchar * name, * zone;
577585
@@ -610,7 +618,9 @@
610}618}
611619
612static gboolean620static gboolean
613entry_focus_out (GtkEntry * entry, GdkEventFocus * event, IndicatorDatetimePanel * self)621entry_focus_out (GtkEntry * entry,
622 GdkEventFocus * event G_GNUC_UNUSED,
623 IndicatorDatetimePanel * self)
614{624{
615 // If the name left in the entry doesn't match the current timezone name,625 // If the name left in the entry doesn't match the current timezone name,
616 // show an error icon. It's always an error for the user to manually type in626 // show an error icon. It's always an error for the user to manually type in
@@ -809,12 +819,12 @@
809}819}
810820
811static void821static void
812indicator_datetime_panel_class_finalize (IndicatorDatetimePanelClass *klass)822indicator_datetime_panel_class_finalize (IndicatorDatetimePanelClass *klass G_GNUC_UNUSED)
813{823{
814}824}
815825
816static const char *826static const char *
817indicator_datetime_panel_get_help_uri (CcPanel *panel)827indicator_datetime_panel_get_help_uri (CcPanel *panel G_GNUC_UNUSED)
818{828{
819 return "help:ubuntu-help/clock";829 return "help:ubuntu-help/clock";
820}830}
@@ -845,6 +855,6 @@
845}855}
846856
847void857void
848g_io_module_unload (GIOModule *module)858g_io_module_unload (GIOModule *module G_GNUC_UNUSED)
849{859{
850}860}
851861
=== added file 'po/CMakeLists.txt'
--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ po/CMakeLists.txt 2013-10-30 22:00:17 +0000
@@ -0,0 +1,3 @@
1include (Translations)
2add_translations_directory ("${GETTEXT_PACKAGE}")
3add_translations_catalog ("${GETTEXT_PACKAGE}" ../src/ ../panel)
04
=== modified file 'po/POTFILES.in'
--- po/POTFILES.in 2013-06-19 04:13:16 +0000
+++ po/POTFILES.in 2013-10-30 22:00:17 +0000
@@ -1,7 +1,7 @@
1src/datetime-prefs.c
2src/datetime-prefs-locations.c
3src/service.c1src/service.c
4src/settings-shared.h2src/settings-shared.h
5src/utils.c3src/utils.c
4panel/datetime-prefs.c
5panel/datetime-prefs-locations.c
6[type: gettext/glade]data/datetime-dialog.ui6[type: gettext/glade]data/datetime-dialog.ui
7data/gnome-indicator-datetime-panel.desktop.in7data/gnome-indicator-datetime-panel.desktop.in
88
=== added file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/CMakeLists.txt 2013-10-30 22:00:17 +0000
@@ -0,0 +1,45 @@
1set (SERVICE_LIB "libindicatordatetimeservice")
2set (SERVICE_EXEC "indicator-datetime-service")
3
4add_definitions (-DTIMEZONE_FILE="/etc/timezone"
5 -DG_LOG_DOMAIN="Indicator-Datetime")
6
7# let service know how to launch gnome-control-center on the desktop
8if (BUILD_PANEL)
9 add_definitions (-DHAVE_CCPANEL)
10endif ()
11
12add_library (${SERVICE_LIB} STATIC
13 clock.c
14 clock.h
15 clock-live.c
16 clock-live.h
17 planner.c
18 planner.h
19 planner-eds.c
20 planner-eds.h
21 service.c
22 service.h
23 timezone.c
24 timezone.h
25 timezone-file.c
26 timezone-file.h
27 timezone-geoclue.c
28 timezone-geoclue.h
29 utils.c
30 utils.h
31 dbus-shared.h
32 settings-shared.h)
33include_directories (${SERVICE_DEPS_INCLUDE_DIRS})
34link_directories (${SERVICE_DEPS_LIBRARY_DIRS})
35
36add_executable (${SERVICE_EXEC} main.c)
37target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${GCOV_LIBS})
38install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR})
39
40# common properties
41set_property (TARGET ${SERVICE_LIB} ${SERVICE_EXEC}
42 APPEND_STRING PROPERTY COMPILE_FLAGS
43 " -g ${CC_WARNING_ARGS} ${GCOV_FLAGS}")
44
45
046
=== removed file 'src/Makefile.am'
--- src/Makefile.am 2013-10-17 21:32:44 +0000
+++ src/Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,88 +0,0 @@
1
2SHARED_CFLAGS = \
3 -Wall \
4 -Wextra -Wno-missing-field-initializers \
5 -Werror \
6 $(SERVICE_CFLAGS) \
7 $(COVERAGE_CFLAGS) \
8 -DTIMEZONE_FILE="\"/etc/timezone\"" \
9 -DG_LOG_DOMAIN=\"Indicator-Datetime\"
10
11###
12###
13###
14
15noinst_LIBRARIES = libindicator-datetime-service.a
16
17libindicator_datetime_service_a_CFLAGS = \
18 $(SHARED_CFLAGS)
19
20libindicator_datetime_service_a_SOURCES = \
21 clock.c \
22 clock.h \
23 clock-live.c \
24 clock-live.h \
25 planner.c \
26 planner.h \
27 planner-eds.c \
28 planner-eds.h \
29 service.c \
30 service.h \
31 timezone.c \
32 timezone.h \
33 timezone-file.c \
34 timezone-file.h \
35 timezone-geoclue.c \
36 timezone-geoclue.h \
37 utils.c \
38 utils.h \
39 dbus-shared.h \
40 settings-shared.h
41
42###
43###
44###
45
46libexec_PROGRAMS = indicator-datetime-service
47
48indicator_datetime_service_SOURCES = \
49 main.c
50
51indicator_datetime_service_CFLAGS = \
52 $(SHARED_CFLAGS)
53
54indicator_datetime_service_LDADD = \
55 libindicator-datetime-service.a \
56 $(SERVICE_LIBS)
57
58indicator_datetime_service_LDFLAGS = \
59 $(COVERAGE_LDFLAGS)
60
61###
62###
63###
64
65if BUILD_CCPANEL
66ccpaneldir = $(libdir)/control-center-1/panels/
67ccpanel_LTLIBRARIES = libindicator-datetime.la
68
69libindicator_datetime_la_SOURCES =\
70 datetime-prefs.c \
71 datetime-prefs-locations.c \
72 datetime-prefs-locations.h \
73 utils.c \
74 utils.h \
75 settings-shared.h
76libindicator_datetime_la_CFLAGS = \
77 -Wall \
78 -Werror \
79 $(PREF_CFLAGS) \
80 $(COVERAGE_CFLAGS) \
81 -DTIMEZONE_FILE="\"/etc/timezone\"" \
82 -DPKGDATADIR="\"$(pkgdatadir)\""
83libindicator_datetime_la_LIBADD = \
84 $(PREF_LIBS)
85libindicator_datetime_la_LDFLAGS = \
86 $(COVERAGE_LDFLAGS) \
87 -module -avoid-version
88endif
890
=== modified file 'src/clock-live.c'
--- src/clock-live.c 2013-10-23 18:14:25 +0000
+++ src/clock-live.c 2013-10-30 22:00:17 +0000
@@ -20,8 +20,6 @@
20#include <glib.h>20#include <glib.h>
21#include <gio/gio.h>21#include <gio/gio.h>
2222
23#include "config.h"
24
25#include "clock-live.h"23#include "clock-live.h"
26#include "settings-shared.h"24#include "settings-shared.h"
27#include "timezone-file.h"25#include "timezone-file.h"
@@ -54,7 +52,7 @@
54 indicator_datetime_clock_live,52 indicator_datetime_clock_live,
55 G_TYPE_OBJECT,53 G_TYPE_OBJECT,
56 G_IMPLEMENT_INTERFACE (INDICATOR_TYPE_DATETIME_CLOCK,54 G_IMPLEMENT_INTERFACE (INDICATOR_TYPE_DATETIME_CLOCK,
57 indicator_datetime_clock_interface_init));55 indicator_datetime_clock_interface_init))
5856
59/***57/***
60**** Timezones58**** Timezones
6159
=== modified file 'src/main.c'
--- src/main.c 2013-10-28 16:19:49 +0000
+++ src/main.c 2013-10-30 22:00:17 +0000
@@ -17,8 +17,6 @@
17 * with this program. If not, see <http://www.gnu.org/licenses/>.17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */18 */
1919
20#include "config.h"
21
22#include <locale.h>20#include <locale.h>
23#include <stdlib.h> /* exit() */21#include <stdlib.h> /* exit() */
2422
2523
=== modified file 'src/planner-eds.c'
--- src/planner-eds.c 2013-10-10 02:24:43 +0000
+++ src/planner-eds.c 2013-10-30 22:00:17 +0000
@@ -17,8 +17,6 @@
17 * with this program. If not, see <http://www.gnu.org/licenses/>.17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */18 */
1919
20#include "config.h"
21
22#include <libical/ical.h>20#include <libical/ical.h>
23#include <libical/icaltime.h>21#include <libical/icaltime.h>
24#include <libecal/libecal.h>22#include <libecal/libecal.h>
2523
=== modified file 'src/service.c'
--- src/service.c 2013-10-23 14:42:49 +0000
+++ src/service.c 2013-10-30 22:00:17 +0000
@@ -18,8 +18,6 @@
18 * with this program. If not, see <http://www.gnu.org/licenses/>.18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */19 */
2020
21#include "config.h"
22
23#include <string.h> /* strstr() */21#include <string.h> /* strstr() */
2422
25#include <glib/gi18n.h>23#include <glib/gi18n.h>
@@ -1531,7 +1529,7 @@
1531 }1529 }
15321530
1533 /* if that appointment's an alarm, dispatch its url */1531 /* if that appointment's an alarm, dispatch its url */
1534 g_debug ("%s: uri '%s'; matching appt is %p", G_STRFUNC, uid, appt);1532 g_debug ("%s: uri '%s'; matching appt is %p", G_STRFUNC, uid, (void*)appt);
1535 if (appt && appointment_has_alarm_url (appt))1533 if (appt && appointment_has_alarm_url (appt))
1536 dispatch_alarm_url (appt);1534 dispatch_alarm_url (appt);
1537 }1535 }
15381536
=== modified file 'src/timezone-file.c'
--- src/timezone-file.c 2013-09-09 17:43:31 +0000
+++ src/timezone-file.c 2013-10-30 22:00:17 +0000
@@ -17,8 +17,6 @@
17 * with this program. If not, see <http://www.gnu.org/licenses/>.17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */18 */
1919
20#include "config.h"
21
22#include <gio/gio.h> /* GFile, GFileMonitor */20#include <gio/gio.h> /* GFile, GFileMonitor */
2321
24#include "timezone-file.h"22#include "timezone-file.h"
2523
=== modified file 'src/timezone-geoclue.c'
--- src/timezone-geoclue.c 2013-09-09 17:43:31 +0000
+++ src/timezone-geoclue.c 2013-10-30 22:00:17 +0000
@@ -17,8 +17,6 @@
17 * with this program. If not, see <http://www.gnu.org/licenses/>.17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */18 */
1919
20#include "config.h"
21
22#include <geoclue/geoclue-master.h>20#include <geoclue/geoclue-master.h>
23#include <geoclue/geoclue-master-client.h>21#include <geoclue/geoclue-master-client.h>
2422
@@ -72,7 +70,7 @@
72 GeoclueAccuracy * accuracy G_GNUC_UNUSED,70 GeoclueAccuracy * accuracy G_GNUC_UNUSED,
73 gpointer gself)71 gpointer gself)
74{72{
75 return on_address_changed(address, timestamp, addy_data, accuracy, NULL, gself);73 on_address_changed(address, timestamp, addy_data, accuracy, NULL, gself);
76}74}
7775
78static void76static void
7977
=== modified file 'src/utils.c'
--- src/utils.c 2013-10-03 21:16:24 +0000
+++ src/utils.c 2013-10-30 22:00:17 +0000
@@ -20,10 +20,6 @@
20with this program. If not, see <http://www.gnu.org/licenses/>.20with this program. If not, see <http://www.gnu.org/licenses/>.
21*/21*/
2222
23#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
26
27#include <glib/gi18n-lib.h>23#include <glib/gi18n-lib.h>
28#include <gio/gio.h>24#include <gio/gio.h>
29#include <locale.h>25#include <locale.h>
@@ -104,9 +100,9 @@
104 split_settings_location (tz_name, &old_zone, &old_name);100 split_settings_location (tz_name, &old_zone, &old_name);
105 g_free (tz_name);101 g_free (tz_name);
106102
107 // new_name is always just a sanitized version of a timezone.103 /* new_name is always just a sanitized version of a timezone.
108 // old_name is potentially a saved "pretty" version of a timezone name from104 old_name is potentially a saved "pretty" version of a timezone name from
109 // geonames. So we prefer to use it if available and the zones match.105 geonames. So we prefer to use it if available and the zones match. */
110106
111 if (g_strcmp0 (old_zone, new_zone) == 0) {107 if (g_strcmp0 (old_zone, new_zone) == 0) {
112 rv = old_name;108 rv = old_name;
113109
=== added file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/CMakeLists.txt 2013-10-30 22:00:17 +0000
@@ -0,0 +1,23 @@
1# build the necessary schemas
2set_directory_properties (PROPERTIES
3 ADDITIONAL_MAKE_CLEAN_FILES gschemas.compiled)
4set_source_files_properties (gschemas.compiled GENERATED)
5
6# GSettings:
7# compile the indicator-datetime schema into a gschemas.compiled file in this directory,
8# and help the tests to find that file by setting -DSCHEMA_DIR
9set (SCHEMA_DIR ${CMAKE_CURRENT_BINARY_DIR})
10add_definitions(-DSCHEMA_DIR="${SCHEMA_DIR}")
11execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas
12 OUTPUT_VARIABLE COMPILE_SCHEMA_EXECUTABLE
13 OUTPUT_STRIP_TRAILING_WHITESPACE)
14add_custom_command (OUTPUT gschemas.compiled
15 DEPENDS ${CMAKE_SOURCE_DIR}/data/com.canonical.indicator.session.gschema.xml
16 COMMAND cp -f ${CMAKE_SOURCE_DIR}/data/*gschema.xml ${SCHEMA_DIR}
17 COMMAND ${COMPILE_SCHEMA_EXECUTABLE} ${SCHEMA_DIR})
18
19# look for hearder in our src dir, and also in the directories where we autogenerate files...
20include_directories (${CMAKE_SOURCE_DIR}/src)
21include_directories (${CMAKE_CURRENT_BINARY_DIR} ${SERVICE_INCLUDE_DIRS})
22
23
024
=== removed file 'tests/Makefile.am'
--- tests/Makefile.am 2013-09-07 14:48:46 +0000
+++ tests/Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,58 +0,0 @@
1TESTS =
2CLEANFILES =
3BUILT_SOURCES =
4check_PROGRAMS =
5
6###
7###
8###
9
10# stock UMB tests on user-visible strings
11include $(srcdir)/Makefile.am.strings
12
13check_LIBRARIES = libgtest.a
14nodist_libgtest_a_SOURCES = \
15 $(GTEST_SOURCE)/gtest-all.cc \
16 $(GTEST_SOURCE)/gtest_main.cc
17
18AM_CPPFLAGS = $(GTEST_CPPFLAGS) -I${top_srcdir}/src -Wall -Werror
19AM_CXXFLAGS = $(GTEST_CXXFLAGS)
20
21###
22###
23###
24
25TEST_LIBS = \
26 libgtest.a \
27 $(SERVICE_LIBS) \
28 $(COVERAGE_LDFLAGS) \
29 $(XORG_GTEST_LDFLAGS)
30
31TEST_CPPFLAGS = \
32 $(AM_CPPFLAGS) \
33 $(SERVICE_CFLAGS)
34
35BUILT_SOURCES += gschemas.compiled
36CLEANFILES += gschemas.compiled
37gschemas.compiled: Makefile
38 @glib-compile-schemas --targetdir=$(abs_builddir) $(top_builddir)/data
39
40###
41###
42###
43
44TESTS += test-indicator
45check_PROGRAMS += test-indicator
46test_indicator_SOURCES = test-indicator.cc
47test_indicator_LDADD = $(TEST_LIBS)
48test_indicator_CPPFLAGS = $(TEST_CPPFLAGS) -DSCHEMA_DIR="\"$(top_builddir)/tests/\""
49
50###
51###
52###
53
54TESTS += test-utils
55check_PROGRAMS += test-utils
56test_utils_SOURCES = test-utils.cc
57test_utils_LDADD = $(top_builddir)/src/libindicator-datetime-service.a $(TEST_LIBS)
58test_utils_CPPFLAGS = $(TEST_CPPFLAGS) -DSCHEMA_DIR="\"$(top_builddir)/tests/\""

Subscribers

People subscribed via source and target branches