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
1=== added file 'CMakeLists.txt'
2--- CMakeLists.txt 1970-01-01 00:00:00 +0000
3+++ CMakeLists.txt 2013-10-30 22:00:17 +0000
4@@ -0,0 +1,103 @@
5+project (indicator-datetime C CXX)
6+cmake_minimum_required (VERSION 2.8.9)
7+
8+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
9+
10+set (PROJECT_VERSION "14.04.0")
11+set (PACKAGE ${CMAKE_PROJECT_NAME})
12+set (GETTEXT_PACKAGE "indicator-datetime")
13+add_definitions (-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}"
14+ -DGNOMELOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
15+
16+option (enable_tests "Build the package's automatic tests." ON)
17+option (enable_lcov "Generate lcov code coverage reports." ON)
18+
19+##
20+## GNU standard installation directories
21+##
22+
23+include (GNUInstallDirs)
24+if (EXISTS "/etc/debian_version") # Workaround for libexecdir on debian
25+ set (CMAKE_INSTALL_LIBEXECDIR "${CMAKE_INSTALL_LIBDIR}")
26+ set (CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
27+endif ()
28+set (CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
29+set (CMAKE_INSTALL_FULL_PKGLIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
30+
31+##
32+## Check for prerequisites
33+##
34+
35+find_package (PkgConfig REQUIRED)
36+include (FindPkgConfig)
37+
38+pkg_check_modules (SERVICE_DEPS REQUIRED
39+ glib-2.0>=2.36
40+ gio-unix-2.0>=2.36
41+ geoclue>=0.12
42+ libical>=0.48
43+ libecal-1.2>=3.5
44+ libedataserver-1.2>=3.5
45+ libnotify>=0.7.6
46+ url-dispatcher-1>=1
47+ json-glib-1.0>=0.16.2)
48+include_directories (${SERVICE_INCLUDE_DIRS})
49+
50+pkg_check_modules (PANEL_DEPS
51+ glib-2.0>=2.36
52+ gio-unix-2.0>=2.36
53+ gtk+-3.0>=3.1.4
54+ timezonemap
55+ libgnome-control-center
56+ polkit-gobject-1)
57+if (PANEL_DEPS_FOUND)
58+ set (BUILD_PANEL 1)
59+endif ()
60+
61+##
62+## custom targets
63+##
64+
65+set (ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION})
66+add_custom_target (dist
67+ COMMAND bzr export --root=${ARCHIVE_NAME} ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz
68+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
69+
70+add_custom_target (clean-coverage
71+ COMMAND find ${CMAKE_BINARY_DIR} -name '*.gcda' | xargs rm -f)
72+
73+add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 --inline-suppr
74+ ${CMAKE_SOURCE_DIR}/src
75+ ${CMAKE_SOURCE_DIR}/tests)
76+
77+##
78+## Actual building
79+##
80+
81+set (CC_WARNING_ARGS " -Wall -Wshadow -Wextra -Wunused -Wformat=2 -Wno-missing-field-initializers")
82+
83+include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src)
84+include_directories (${CMAKE_CURRENT_BINARY_DIR}/src)
85+
86+# testing & coverage
87+if (${enable_tests})
88+ set (GTEST_SOURCE_DIR /usr/src/gtest/src)
89+ set (GTEST_INCLUDE_DIR ${GTEST_SOURCE_DIR}/..)
90+ set (GTEST_LIBS -lpthread)
91+ enable_testing ()
92+ if (${enable_lcov})
93+ include(GCov)
94+ endif ()
95+endif ()
96+
97+# actually build things
98+add_subdirectory (src)
99+if (BUILD_PANEL)
100+ add_subdirectory (panel)
101+endif ()
102+add_subdirectory (data)
103+add_subdirectory (po)
104+if (${enable_tests})
105+ add_subdirectory (tests)
106+endif ()
107+
108
109=== added file 'INSTALL'
110--- INSTALL 1970-01-01 00:00:00 +0000
111+++ INSTALL 2013-10-30 22:00:17 +0000
112@@ -0,0 +1,75 @@
113+#
114+# Copyright (C) 2013 Canonical Ltd
115+#
116+# This program is free software: you can redistribute it and/or modify
117+# it under the terms of the GNU General Public License version 3 as
118+# published by the Free Software Foundation.
119+#
120+# This program is distributed in the hope that it will be useful,
121+# but WITHOUT ANY WARRANTY; without even the implied warranty of
122+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
123+# GNU General Public License for more details.
124+#
125+# You should have received a copy of the GNU General Public License
126+# along with this program. If not, see <http://www.gnu.org/licenses/>.
127+#
128+
129+BUILD DEPENDENCIES
130+==================
131+
132+build dependencies for indicator-datetime-service
133+ * glib-2.0 >= 2.36
134+ * gio-unix-2.0 >= 2.36
135+ * geoclue >= 0.12
136+ * libical >= 0.48
137+ * libecal-1.2 >= 3.5
138+ * libedataserver-1.2 >= 3.5
139+ * libnotify >= 0.7.6
140+ * url-dispatcher-1 >= 1
141+ * json-glib-1.0 >= 0.16.2
142+
143+
144+Additional build dependencies for the gnome-control-center panel:
145+ * gtk+-3.0>=3.1.4
146+ * timezonemap
147+ * libgnome-control-center
148+ * polkit-gobject-1
149+
150+Build dependencies for testing / code coverage:
151+ * gcovr (gcovr, 2.4 or later)
152+ * lcov (lcov, 1.9 or later)
153+ * google test (libgtest-dev, 1.6.0 or later)
154+ * cppcheck (cppcheck)
155+
156+
157+Building the code
158+-----------------
159+ 1. $ cd indicator-datetime-X.Y.Z
160+ 2. $ mkdir build
161+ 3. $ cd build
162+ 4. $ cmake ..
163+ or
164+ $ cmake -DCMAKE_INSTALL_PREFIX=/your/install/prefix/here ..
165+ or
166+ $ cmake -GNinja ..
167+ 5. $ make
168+
169+Running the tests
170+-----------------
171+ 1. $ cd indicator-datetime-X.Y.Z
172+ 2. $ mkdir build
173+ 3. $ cd build
174+ 4. $ cmake ..
175+ 5. $ make
176+ 6. $ make test
177+ 7. $ make cppcheck
178+
179+Generating Test Coverage Reports
180+--------------------------------
181+ 1. $ cd indicator-datetime-X.Y.Z
182+ 2. $ mkdir build-coverage
183+ 3. $ cd build-coverage
184+ 4. $ cmake -DCMAKE_BUILD_TYPE=coverage ..
185+ 5. $ make
186+ 6. $ make coverage-html
187+
188
189=== removed file 'Makefile.am'
190--- Makefile.am 2013-06-28 21:41:31 +0000
191+++ Makefile.am 1970-01-01 00:00:00 +0000
192@@ -1,39 +0,0 @@
193-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
194-
195-SUBDIRS = po data src
196-
197-if BUILD_TESTS
198-SUBDIRS += tests
199-# build src first
200-tests: src
201-endif
202-
203-EXTRA_DIST = autogen.sh
204-
205-dist-hook:
206- @if test -d "$(top_srcdir)/.bzr"; \
207- then \
208- echo Creating ChangeLog && \
209- ( cd "$(top_srcdir)" && \
210- echo '# Generated by Makefile. Do not edit.'; echo; \
211- $(top_srcdir)/build-aux/missing --run bzr log --gnu-changelog ) > ChangeLog.tmp \
212- && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
213- || (rm -f ChangeLog.tmp; \
214- echo Failed to generate ChangeLog >&2 ); \
215- else \
216- echo Failed to generate ChangeLog: not a branch >&2; \
217- fi
218- @if test -d "$(top_srcdir)/.bzr"; \
219- then \
220- echo Creating AUTHORS && \
221- ( cd "$(top_srcdir)" && \
222- echo '# Generated by Makefile. Do not edit.'; echo; \
223- $(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 \
224- && mv -f AUTHORS.tmp $(top_distdir)/AUTHORS \
225- || (rm -f AUTHORS.tmp; \
226- echo Failed to generate AUTHORS >&2 ); \
227- else \
228- echo Failed to generate AUTHORS: not a branch >&2; \
229- fi
230-
231-include $(top_srcdir)/Makefile.am.coverage
232
233=== removed file 'Makefile.am.coverage'
234--- Makefile.am.coverage 2012-03-27 22:17:43 +0000
235+++ Makefile.am.coverage 1970-01-01 00:00:00 +0000
236@@ -1,48 +0,0 @@
237-
238-# Coverage targets
239-
240-.PHONY: clean-gcno clean-gcda \
241- coverage-html generate-coverage-html clean-coverage-html \
242- coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
243-
244-clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
245-
246-if HAVE_GCOV
247-
248-clean-gcno:
249- @echo Removing old coverage instrumentation
250- -find -name '*.gcno' -print | xargs -r rm
251-
252-clean-gcda:
253- @echo Removing old coverage results
254- -find -name '*.gcda' -print | xargs -r rm
255-
256-coverage-html: clean-gcda
257- -$(MAKE) $(AM_MAKEFLAGS) -k check
258- $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
259-
260-generate-coverage-html:
261- @echo Collecting coverage data
262- $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
263- LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
264-
265-clean-coverage-html: clean-gcda
266- -$(LCOV) --directory $(top_builddir) -z
267- -rm -rf coverage.info coveragereport
268-
269-if HAVE_GCOVR
270-
271-coverage-gcovr: clean-gcda
272- -$(MAKE) $(AM_MAKEFLAGS) -k check
273- $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr
274-
275-generate-coverage-gcovr:
276- @echo Generating coverage GCOVR report
277- $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
278-
279-clean-coverage-gcovr: clean-gcda
280- -rm -rf $(top_builddir)/coverage.xml
281-
282-endif # HAVE_GCOVR
283-
284-endif # HAVE_GCOV
285
286=== removed file 'autogen.sh'
287--- autogen.sh 2010-03-04 18:01:39 +0000
288+++ autogen.sh 1970-01-01 00:00:00 +0000
289@@ -1,11 +0,0 @@
290-#!/bin/sh
291-
292-PKG_NAME="indicator-datetime"
293-
294-which gnome-autogen.sh || {
295- echo "You need gnome-common from GNOME Git"
296- exit 1
297-}
298-
299-USE_GNOME2_MACROS=1 \
300-. gnome-autogen.sh $@
301
302=== added directory 'cmake'
303=== added file 'cmake/FindIntltool.cmake'
304--- cmake/FindIntltool.cmake 1970-01-01 00:00:00 +0000
305+++ cmake/FindIntltool.cmake 2013-10-30 22:00:17 +0000
306@@ -0,0 +1,23 @@
307+# FindIntltool.cmake
308+#
309+# Jim Nelson <jim@yorba.org>
310+# Copyright 2012 Yorba Foundation
311+
312+find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge)
313+
314+if (INTLTOOL_MERGE_EXECUTABLE)
315+ set (INTLTOOL_MERGE_FOUND TRUE)
316+else (INTLTOOL_MERGE_EXECUTABLE)
317+ set (INTLTOOL_MERGE_FOUND FALSE)
318+endif (INTLTOOL_MERGE_EXECUTABLE)
319+
320+if (INTLTOOL_MERGE_FOUND)
321+ macro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
322+ add_custom_target (geary.desktop ALL
323+ ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir}
324+ ${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.desktop.in ${desktop_id}.desktop
325+ )
326+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/geary.desktop DESTINATION /usr/share/applications)
327+ endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
328+endif (INTLTOOL_MERGE_FOUND)
329+
330
331=== added file 'cmake/GCov.cmake'
332--- cmake/GCov.cmake 1970-01-01 00:00:00 +0000
333+++ cmake/GCov.cmake 2013-10-30 22:00:17 +0000
334@@ -0,0 +1,50 @@
335+if (CMAKE_BUILD_TYPE MATCHES coverage)
336+ set(GCOV_FLAGS "${GCOV_FLAGS} --coverage")
337+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCOV_FLAGS}")
338+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${GCOV_FLAGS}")
339+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GCOV_FLAGS}")
340+ set(GCOV_LIBS ${GCOV_LIBS} gcov)
341+
342+ find_program(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin")
343+ if (NOT GCOVR_EXECUTABLE)
344+ message(STATUS "Gcovr binary was not found, can not generate XML coverage info.")
345+ else ()
346+ message(STATUS "Gcovr found, can generate XML coverage info.")
347+ add_custom_target (coverage-xml
348+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
349+ COMMAND "${GCOVR_EXECUTABLE}" --exclude="test.*" -x -r "${CMAKE_SOURCE_DIR}"
350+ --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml)
351+ endif()
352+
353+ find_program(LCOV_EXECUTABLE lcov HINTS ${LCOV_ROOT} "${GCOVR_ROOT}/bin")
354+ find_program(GENHTML_EXECUTABLE genhtml HINTS ${GENHTML_ROOT})
355+ if (NOT LCOV_EXECUTABLE)
356+ message(STATUS "Lcov binary was not found, can not generate HTML coverage info.")
357+ else ()
358+ if(NOT GENHTML_EXECUTABLE)
359+ message(STATUS "Genthml binary not found, can not generate HTML coverage info.")
360+ else()
361+ message(STATUS "Lcov and genhtml found, can generate HTML coverage info.")
362+ add_custom_target (coverage-html
363+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
364+ COMMAND "${CMAKE_CTEST_COMMAND}" --force-new-ctest-process --verbose
365+ COMMAND "${LCOV_EXECUTABLE}" --directory ${CMAKE_BINARY_DIR} --capture | ${CMAKE_SOURCE_DIR}/trim-lcov.py > dconf-lcov.info
366+ COMMAND LANG=C "${GENHTML_EXECUTABLE}" --prefix ${CMAKE_BINARY_DIR} --output-directory lcov-html --legend --show-details dconf-lcov.info
367+ COMMAND ${CMAKE_COMMAND} -E echo ""
368+ COMMAND ${CMAKE_COMMAND} -E echo "file://${CMAKE_BINARY_DIR}/lcov-html/index.html"
369+ COMMAND ${CMAKE_COMMAND} -E echo "")
370+ #COMMAND "${LCOV_EXECUTABLE}" --directory ${CMAKE_BINARY_DIR} --capture --output-file coverage.info --no-checksum
371+ #COMMAND "${GENHTML_EXECUTABLE}" --prefix ${CMAKE_BINARY_DIR} --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
372+ #COMMAND ${CMAKE_COMMAND} -E echo "\\#define foo \\\"bar\\\""
373+ #)
374+ endif()
375+ endif()
376+endif()
377+
378+
379+ #$(MAKE) $(AM_MAKEFLAGS) check
380+ #lcov --directory $(top_builddir) --capture --test-name dconf | $(top_srcdir)/trim-lcov.py > dconf-lcov.info
381+ #LANG=C genhtml --prefix $(top_builddir) --output-directory lcov-html --legend --show-details dconf-lcov.info
382+ #@echo
383+ #@echo " file://$(abs_top_builddir)/lcov-html/index.html"
384+ #@echo
385
386=== added file 'cmake/GdbusCodegen.cmake'
387--- cmake/GdbusCodegen.cmake 1970-01-01 00:00:00 +0000
388+++ cmake/GdbusCodegen.cmake 2013-10-30 22:00:17 +0000
389@@ -0,0 +1,36 @@
390+cmake_minimum_required(VERSION 2.6)
391+if(POLICY CMP0011)
392+ cmake_policy(SET CMP0011 NEW)
393+endif(POLICY CMP0011)
394+
395+find_program(GDBUS_CODEGEN NAMES gdbus-codegen DOC "gdbus-codegen executable")
396+if(NOT GDBUS_CODEGEN)
397+ message(FATAL_ERROR "Excutable gdbus-codegen not found")
398+endif()
399+
400+macro(add_gdbus_codegen outfiles name prefix service_xml)
401+ add_custom_command(
402+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
403+ COMMAND "${GDBUS_CODEGEN}"
404+ --interface-prefix "${prefix}"
405+ --generate-c-code "${name}"
406+ "${service_xml}"
407+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
408+ DEPENDS ${ARGN} "${service_xml}"
409+ )
410+ list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
411+endmacro(add_gdbus_codegen)
412+
413+macro(add_gdbus_codegen_with_namespace outfiles name prefix namespace service_xml)
414+ add_custom_command(
415+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
416+ COMMAND "${GDBUS_CODEGEN}"
417+ --interface-prefix "${prefix}"
418+ --generate-c-code "${name}"
419+ --c-namespace "${namespace}"
420+ "${service_xml}"
421+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
422+ DEPENDS ${ARGN} "${service_xml}"
423+ )
424+ list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
425+endmacro(add_gdbus_codegen_with_namespace)
426
427=== added file 'cmake/Translations.cmake'
428--- cmake/Translations.cmake 1970-01-01 00:00:00 +0000
429+++ cmake/Translations.cmake 2013-10-30 22:00:17 +0000
430@@ -0,0 +1,41 @@
431+# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
432+
433+macro(add_translations_directory NLS_PACKAGE)
434+ add_custom_target (i18n ALL)
435+ find_program (MSGFMT_EXECUTABLE msgfmt)
436+ file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
437+ foreach (PO_INPUT ${PO_FILES})
438+ get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
439+ set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
440+ add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
441+
442+ install (FILES ${MO_OUTPUT} DESTINATION
443+ ${CMAKE_INSTALL_LOCALEDIR}/${PO_INPUT_BASE}/LC_MESSAGES
444+ RENAME ${NLS_PACKAGE}.mo)
445+ endforeach (PO_INPUT ${PO_FILES})
446+endmacro(add_translations_directory)
447+
448+
449+macro(add_translations_catalog NLS_PACKAGE)
450+ add_custom_target (pot COMMENT “Building translation catalog.”)
451+ find_program (XGETTEXT_EXECUTABLE xgettext)
452+
453+
454+ set(C_SOURCE "")
455+
456+ foreach(FILES_INPUT ${ARGN})
457+ file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c)
458+ foreach(C_FILE ${SOURCE_FILES})
459+ set(C_SOURCE ${C_SOURCE} ${C_FILE})
460+ endforeach()
461+ file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala)
462+ foreach(C_FILE ${SOURCE_FILES})
463+ set(C_SOURCE ${C_SOURCE} ${C_FILE})
464+ endforeach()
465+ endforeach()
466+
467+ add_custom_command (TARGET pot COMMAND
468+ ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
469+ ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --keyword="N_" --from-code=UTF-8
470+ )
471+endmacro()
472
473=== added file 'cmake/UseGSettings.cmake'
474--- cmake/UseGSettings.cmake 1970-01-01 00:00:00 +0000
475+++ cmake/UseGSettings.cmake 2013-10-30 22:00:17 +0000
476@@ -0,0 +1,23 @@
477+# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them.
478+
479+macro(add_schema SCHEMA_NAME)
480+
481+ set(PKG_CONFIG_EXECUTABLE pkg-config)
482+ set(GSETTINGS_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/glib-2.0/schemas")
483+
484+ # Run the validator and error if it fails
485+ execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_compile_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
486+ execute_process (COMMAND ${_glib_compile_schemas} --dry-run --schema-file=${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
487+
488+ if (_schemas_invalid)
489+ message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
490+ endif (_schemas_invalid)
491+
492+ # Actually install and recomple schemas
493+ message (STATUS "${GSETTINGS_DIR} is the GSettings install dir")
494+ install (FILES ${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
495+
496+ install (CODE "message (STATUS \"Compiling GSettings schemas\")")
497+ install (CODE "execute_process (COMMAND ${_glib_compile_schemas} ${GSETTINGS_DIR})")
498+endmacro()
499+
500
501=== removed file 'configure.ac'
502--- configure.ac 2013-10-16 22:14:11 +0000
503+++ configure.ac 1970-01-01 00:00:00 +0000
504@@ -1,192 +0,0 @@
505-AC_INIT([indicator-datetime],
506- [13.10.0],
507- [http://bugs.launchpad.net/indicator-datetime],
508- [indicator-datetime],
509- [http://launchpad.net/indicator-datetime])
510-AC_COPYRIGHT([Copyright 2009-2011 Canonical])
511-
512-AC_PREREQ([2.64])
513-
514-AC_CONFIG_HEADERS([config.h])
515-AC_CONFIG_SRCDIR([configure.ac])
516-AC_CONFIG_MACRO_DIR([m4])
517-AC_CONFIG_AUX_DIR([build-aux])
518-
519-AM_INIT_AUTOMAKE([check-news 1.11 -Wall])
520-AM_MAINTAINER_MODE([enable])
521-
522-AM_SILENT_RULES([yes])
523-
524-# Check for programs
525-AC_PROG_CC
526-AM_PROG_CC_C_O
527-AC_PROG_CXX
528-AC_HEADER_STDC
529-AM_PROG_AR
530-
531-# Initialize libtool
532-LT_PREREQ([2.2])
533-LT_INIT([disable-static])
534-
535-AC_CHECK_LIB([m],[pow])
536-
537-AC_ARG_ENABLE([deprecations],
538- [AS_HELP_STRING([--enable-deprecations],
539- [allow deprecated API usage @<:@default=yes@:>@])],
540- [],
541- [enable_deprecations=yes])
542-AS_IF([test "x$enable_deprecations" = xno],
543- [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES"]
544-)
545-
546-PKG_PROG_PKG_CONFIG
547-
548-###########################
549-# Dependencies
550-###########################
551-
552-GLIB_REQUIRED_VERSION=2.35.4
553-GIO_REQUIRED_VERSION=2.25.11
554-GEOCLUE_REQUIRED_VERSION=0.12.0
555-ICAL_REQUIRED_VERSION=0.48
556-ECAL_REQUIRED_VERSION=3.5
557-EDS_REQUIRED_VERSION=3.5
558-LIBNOTIFY_REQUIRED_VERSION=0.7.6
559-URL_DISPATCHER_1_REQUIRED_VERSION=1
560-JSON_GLIB_REQUIRED_VERSION=0.16.2
561-
562-GTK3_REQUIRED_VERSION=3.1.4
563-
564-PKG_CHECK_MODULES(SERVICE, [glib-2.0 >= $GLIB_REQUIRED_VERSION
565- gio-2.0 >= $GIO_REQUIRED_VERSION
566- geoclue >= $GEOCLUE_REQUIRED_VERSION
567- libical >= $ICAL_REQUIRED_VERSION
568- libecal-1.2 >= $ECAL_REQUIRED_VERSION
569- libedataserver-1.2 >= $EDS_REQUIRED_VERSION
570- libnotify >= $LIBNOTIFY_REQUIRED_VERSION
571- url-dispatcher-1 >= $URL_DISPATCHER_1_REQUIRED_VERSION
572- json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION])
573-
574-###########################
575-# Control Center panel
576-###########################
577-
578-AC_ARG_WITH([ccpanel],
579- AS_HELP_STRING([--with-ccpanel], [enable Control Center panel]),,
580- with_ccpanel=auto)
581-
582-if test x"$with_ccpanel" != x"no" ; then
583- PKG_CHECK_MODULES([PREF],
584- [gio-2.0 >= $GIO_REQUIRED_VERSION
585- gtk+-3.0 >= $GTK3_REQUIRED_VERSION
586- timezonemap
587- libgnome-control-center
588- polkit-gobject-1],
589- [have_ccpanel=yes],
590- [have_ccpanel=no])
591- if test x${have_ccpanel} = xyes; then
592- AC_DEFINE(HAVE_CCPANEL, 1, [Define to 1 to enable Control Center panel])
593- PKG_CHECK_MODULES(LIBMAP, gio-2.0 >= $GIO_REQUIRED_VERSION
594- gtk+-3.0 >= $GTK3_REQUIRED_VERSION)
595- fi
596- if test x${with_ccpanel} = xyes && test x${have_ccpanel} = xno; then
597- AC_MSG_ERROR([Control Center panel configured but not found])
598- fi
599-else
600- have_ccpanel=no
601-fi
602-AM_CONDITIONAL(BUILD_CCPANEL, test x${have_ccpanel} = xyes)
603-
604-###########################
605-# Grab the GSettings Macros
606-###########################
607-
608-GLIB_GSETTINGS
609-
610-###########################
611-# gcov coverage reporting
612-###########################
613-
614-m4_include([m4/gcov.m4])
615-AC_TDD_GCOV
616-AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
617-AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
618-AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
619-AC_SUBST(COVERAGE_CFLAGS)
620-AC_SUBST(COVERAGE_LDFLAGS)
621-
622-###########################
623-# Google Test framework
624-###########################
625-
626-AC_ARG_ENABLE([tests],
627- [AS_HELP_STRING([--disable-tests], [Disable test scripts and tools (default=auto)])],
628- [enable_tests=${enableval}],
629- [enable_tests=auto])
630-if test "x$enable_tests" != "xno"; then
631- m4_include([m4/gtest.m4])
632- CHECK_GTEST
633- CHECK_XORG_GTEST
634- if test "x$enable_tests" = "xauto"; then
635- enable_tests=${have_gtest}
636- elif test "x$enable_tests" = "xyes" && test "x$have_gtest" != "xyes"; then
637- AC_MSG_ERROR([tests were requested but gtest is not installed.])
638- fi
639-fi
640-AM_CONDITIONAL([BUILD_TESTS],[test "x$enable_tests" = "xyes"])
641-
642-##############################
643-# Custom Junk
644-##############################
645-
646-AC_DEFUN([AC_DEFINE_PATH], [
647- test "x$prefix" = xNONE && prefix="$ac_default_prefix"
648- test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
649- ac_define_path=`eval echo [$]$2`
650- ac_define_path=`eval echo [$]ac_define_path`
651- $1="$ac_define_path"
652- AC_SUBST($1)
653- ifelse($3, ,
654- AC_DEFINE_UNQUOTED($1, "$ac_define_path"),
655- AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3))
656-])
657-
658-###########################
659-# Internationalization
660-###########################
661-IT_PROG_INTLTOOL([0.41.0])
662-
663-GETTEXT_PACKAGE=indicator-datetime
664-AC_SUBST(GETTEXT_PACKAGE)
665-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default get text domain])
666-AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory])
667-
668-AM_GLIB_GNU_GETTEXT
669-
670-###########################
671-# Files
672-###########################
673-
674-AC_CONFIG_FILES([
675-Makefile
676-src/Makefile
677-data/Makefile
678-tests/Makefile
679-po/Makefile.in
680-])
681-AC_OUTPUT
682-
683-###########################
684-# Results
685-###########################
686-
687-AC_MSG_NOTICE([
688-
689-Date and Time Indicator Configuration:
690-
691- Prefix: $prefix
692- CC Panel: $have_ccpanel
693- CC Panel Dir: $CCPANELDIR
694- Unit Tests: $enable_tests
695- gcov: $use_gcov
696-])
697
698=== added file 'data/CMakeLists.txt'
699--- data/CMakeLists.txt 1970-01-01 00:00:00 +0000
700+++ data/CMakeLists.txt 2013-10-30 22:00:17 +0000
701@@ -0,0 +1,66 @@
702+##
703+## GSettings schema
704+##
705+
706+include (UseGSettings)
707+set (SCHEMA_NAME "com.canonical.indicator.datetime.gschema.xml")
708+set (SCHEMA_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME}")
709+add_schema (${SCHEMA_FILE})
710+
711+
712+##
713+## DBus Service File
714+##
715+
716+# where to install
717+set (DBUS_SERVICE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/dbus-1/services")
718+message (STATUS "${DBUS_SERVICE_DIR} is the DBus Service File install dir")
719+
720+set (SERVICE_NAME "${CMAKE_PROJECT_NAME}.service")
721+set (SERVICE_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SERVICE_NAME}")
722+set (SERVICE_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SERVICE_NAME}.in")
723+
724+# build it
725+set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}")
726+configure_file ("${SERVICE_FILE_IN}" "${SERVICE_FILE}")
727+
728+# install it
729+install (FILES "${SERVICE_FILE}"
730+ DESTINATION "${DBUS_SERVICE_DIR}")
731+
732+
733+##
734+## Unity Indicator File
735+##
736+
737+# where to install
738+set (UNITY_INDICATOR_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/unity/indicators")
739+message (STATUS "${UNITY_INDICATOR_DIR} is the Unity Indicator install dir")
740+
741+set (UNITY_INDICATOR_NAME "com.canonical.indicator.datetime")
742+set (UNITY_INDICATOR_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${UNITY_INDICATOR_NAME}")
743+
744+install (FILES "${UNITY_INDICATOR_FILE}"
745+ DESTINATION "${UNITY_INDICATOR_DIR}")
746+
747+
748+##
749+## gnome-control-center panel: .ui and .desktop files
750+##
751+
752+if (BUILD_PANEL)
753+
754+ # the .ui file
755+ install (FILES "datetime-dialog.ui"
756+ DESTINATION "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}")
757+
758+ # the .desktop file
759+ set (DESKTOP_NAME "gnome-indicator-datetime-panel.desktop")
760+ set (DESKTOP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_NAME}")
761+ set (DESKTOP_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${DESKTOP_NAME}.in")
762+ set (ENV{LC_ALL} "C")
763+ execute_process (COMMAND intltool-merge -quiet --desktop-style --utf8 "${CMAKE_SOURCE_DIR}/po" "${DESKTOP_FILE_IN}" "${DESKTOP_FILE}")
764+ install (FILES ${DESKTOP_FILE}
765+ DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
766+
767+endif ()
768
769=== removed file 'data/Makefile.am'
770--- data/Makefile.am 2013-06-28 21:41:31 +0000
771+++ data/Makefile.am 1970-01-01 00:00:00 +0000
772@@ -1,45 +0,0 @@
773-BUILT_SOURCES=
774-CLEANFILES=
775-EXTRA_DIST=
776-
777-#
778-# the indicator bus file
779-#
780-
781-indicatorsdir = $(prefix)/share/unity/indicators
782-dist_indicators_DATA = com.canonical.indicator.datetime
783-
784-#
785-# the gsettings
786-#
787-
788-gsettings_SCHEMAS = com.canonical.indicator.datetime.gschema.xml
789-@GSETTINGS_RULES@
790-EXTRA_DIST += $(gsettings_SCHEMAS)
791-
792-#
793-# the dbus service file
794-#
795-
796-dbus_servicesdir = $(datadir)/dbus-1/services
797-dbus_services_DATA = indicator-datetime.service
798-dbus_services_in = $(dbus_services_DATA:.service=.service.in)
799-$(dbus_services_DATA): $(dbus_services_in)
800- $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
801-BUILT_SOURCES += $(dbus_services_DATA)
802-CLEANFILES += $(dbus_services_DATA)
803-EXTRA_DIST += $(dbus_services_in)
804-
805-#
806-# the gnome-control-center panel
807-#
808-
809-if BUILD_CCPANEL
810- pkgdata_DATA = datetime-dialog.ui
811- @INTLTOOL_DESKTOP_RULE@
812- desktopdir = $(datadir)/applications
813- desktop_DATA = gnome-indicator-datetime-panel.desktop
814- EXTRA_DIST += $(desktop_DATA)
815- CLEANFILES += $(desktop_DATA)
816-endif
817-EXTRA_DIST += datetime-dialog.ui $(desktop_DATA:.desktop=.desktop.in)
818
819=== modified file 'data/indicator-datetime.service.in'
820--- data/indicator-datetime.service.in 2011-01-17 17:41:28 +0000
821+++ data/indicator-datetime.service.in 2013-10-30 22:00:17 +0000
822@@ -1,3 +1,3 @@
823 [D-BUS Service]
824 Name=com.canonical.indicator.datetime
825-Exec=@libexecdir@/indicator-datetime-service
826+Exec=@pkglibexecdir@/indicator-datetime-service
827
828=== modified file 'debian/control'
829--- debian/control 2013-10-16 22:14:11 +0000
830+++ debian/control 2013-10-30 22:00:17 +0000
831@@ -2,9 +2,10 @@
832 Section: misc
833 Priority: optional
834 Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
835-Build-Depends: debhelper (>= 9),
836- quilt,
837- dh-autoreconf,
838+Build-Depends: cmake,
839+ dbus,
840+ debhelper (>= 9),
841+ dh-translations,
842 intltool (>= 0.35.0),
843 gnome-common,
844 libxorg-gtest-dev,
845
846=== modified file 'debian/indicator-datetime.install'
847--- debian/indicator-datetime.install 2013-08-27 14:52:26 +0000
848+++ debian/indicator-datetime.install 2013-10-30 22:00:17 +0000
849@@ -1,5 +1,5 @@
850 usr/share/glib-2.0/schemas/*
851 usr/share/dbus-1/services/*
852 usr/share/unity/indicators/*
853-usr/lib/*/indicator-datetime-service
854+usr/lib/*/indicator-datetime/indicator-datetime-service
855 usr/share/locale/*
856
857=== modified file 'debian/rules'
858--- debian/rules 2013-09-02 14:08:49 +0000
859+++ debian/rules 2013-10-30 22:00:17 +0000
860@@ -3,17 +3,11 @@
861 LDFLAGS += -Wl,-z,defs -Wl,--as-needed
862
863 %:
864- dh $@ --with quilt,autoreconf
865-
866-override_dh_autoreconf:
867- NOCONFIGURE=1 dh_autoreconf ./autogen.sh
868-
869-override_dh_auto_configure:
870- dh_auto_configure -- --disable-static --disable-silent-rules
871+ dh $@ --with translations
872
873 override_dh_install:
874 cd po; intltool-update --pot --verbose
875- dh_install -X.la --fail-missing
876+ dh_install --fail-missing
877 # Language packs
878 for d in $$(find debian/indicator-datetime -type f \( -name "*.desktop" -o -name "*.directory" \) ); do \
879 sed -ri '/^(Name|GenericName|Comment|X-GNOME-FullName)\[/d' $$d; \
880
881=== added directory 'panel'
882=== added file 'panel/CMakeLists.txt'
883--- panel/CMakeLists.txt 1970-01-01 00:00:00 +0000
884+++ panel/CMakeLists.txt 2013-10-30 22:00:17 +0000
885@@ -0,0 +1,25 @@
886+set (PANEL_LIB "indicator-datetime")
887+
888+add_definitions (-DPKGDATADIR="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}")
889+
890+add_library (${PANEL_LIB} SHARED
891+ datetime-prefs.c
892+ datetime-prefs-locations.c
893+ datetime-prefs-locations.h
894+ ${CMAKE_SOURCE_DIR}/src/utils.c
895+ ${CMAKE_SOURCE_DIR}/src/utils.h
896+ ${CMAKE_SOURCE_DIR}/src/settings-shared.h)
897+
898+include_directories (${PANEL_DEPS_INCLUDE_DIRS})
899+
900+link_directories (${PANEL_DEPS_LIBRARY_DIRS})
901+
902+set_property (TARGET ${PANEL_LIB}
903+ APPEND_STRING PROPERTY COMPILE_FLAGS
904+ " -g ${CC_WARNING_ARGS} ${GCOV_FLAGS}")
905+
906+target_link_libraries (${PANEL_LIB} ${PANEL_DEPS_LIBRARIES} ${GCOV_LIBS})
907+
908+install (TARGETS ${PANEL_LIB}
909+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/control-center-1/panels)
910+
911
912=== renamed file 'src/datetime-prefs-locations.c' => 'panel/datetime-prefs-locations.c'
913--- src/datetime-prefs-locations.c 2013-10-26 20:37:14 +0000
914+++ panel/datetime-prefs-locations.c 2013-10-30 22:00:17 +0000
915@@ -109,7 +109,9 @@
916 }
917
918 static void
919-handle_sort(GtkWidget * button, GtkTreeView * tree_view, GCompareFunc compare)
920+handle_sort(GtkWidget * button G_GNUC_UNUSED,
921+ GtkTreeView * tree_view,
922+ GCompareFunc compare)
923 {
924 GtkTreeModel * model = gtk_tree_view_get_model (tree_view);
925 GSList * l;
926@@ -180,7 +182,7 @@
927 ***/
928
929 static void
930-handle_add (GtkWidget * button, GtkTreeView * tree)
931+handle_add (GtkWidget * button G_GNUC_UNUSED, GtkTreeView * tree)
932 {
933 GtkListStore * store = GTK_LIST_STORE (gtk_tree_view_get_model (tree));
934
935@@ -193,7 +195,7 @@
936 }
937
938 static void
939-handle_remove (GtkWidget * button, GtkTreeView * tree)
940+handle_remove (GtkWidget * button G_GNUC_UNUSED, GtkTreeView * tree)
941 {
942 GtkListStore * store = GTK_LIST_STORE (gtk_tree_view_get_model (tree));
943 GtkTreeSelection * selection = gtk_tree_view_get_selection (tree);
944@@ -290,7 +292,9 @@
945 }
946
947 static void
948-handle_edit (GtkCellRendererText * renderer, gchar * path, gchar * new_text,
949+handle_edit (GtkCellRendererText * renderer G_GNUC_UNUSED,
950+ gchar * path,
951+ gchar * new_text,
952 GtkListStore * store)
953 {
954 GtkTreeIter iter;
955@@ -388,8 +392,10 @@
956 }
957
958 static void
959-handle_edit_started (GtkCellRendererText * renderer, GtkCellEditable * editable,
960- gchar * path, CcTimezoneCompletion * completion)
961+handle_edit_started (GtkCellRendererText * renderer G_GNUC_UNUSED,
962+ GtkCellEditable * editable,
963+ gchar * path,
964+ CcTimezoneCompletion * completion)
965 {
966 if (GTK_IS_ENTRY (editable)) {
967 GtkEntry *entry = GTK_ENTRY (editable);
968@@ -548,7 +554,7 @@
969 }
970
971 static void
972-dialog_closed (GtkWidget * dlg, GObject * store)
973+dialog_closed (GtkWidget * dlg, GObject * store G_GNUC_UNUSED)
974 {
975 /* Cleanup a tad */
976 guint time_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dlg), "time-id"));
977
978=== renamed file 'src/datetime-prefs-locations.h' => 'panel/datetime-prefs-locations.h'
979=== renamed file 'src/datetime-prefs.c' => 'panel/datetime-prefs.c'
980--- src/datetime-prefs.c 2013-09-07 12:10:53 +0000
981+++ panel/datetime-prefs.c 2013-10-30 22:00:17 +0000
982@@ -83,7 +83,9 @@
983
984 /* Turns the boolean property into a string gsettings */
985 static GVariant *
986-bind_hours_set (const GValue * value, const GVariantType * type, gpointer user_data)
987+bind_hours_set (const GValue * value,
988+ const GVariantType * type G_GNUC_UNUSED,
989+ gpointer user_data)
990 {
991 const gchar * output = NULL;
992 gboolean is_12hour_button = (gboolean)GPOINTER_TO_INT(user_data);
993@@ -121,7 +123,7 @@
994 }
995
996 static void
997-widget_dependency_cb (GtkWidget * parent, GParamSpec *pspec, GtkWidget * dependent)
998+widget_dependency_cb (GtkWidget * parent, GParamSpec *pspec G_GNUC_UNUSED, GtkWidget * dependent)
999 {
1000 gboolean active, sensitive;
1001 g_object_get (G_OBJECT (parent),
1002@@ -141,7 +143,7 @@
1003 }
1004
1005 static void
1006-polkit_dependency_cb (GPermission * permission, GParamSpec *pspec, GtkWidget * dependent)
1007+polkit_dependency_cb (GPermission * permission, GParamSpec *pspec G_GNUC_UNUSED, GtkWidget * dependent)
1008 {
1009 gboolean allowed = FALSE;
1010
1011@@ -152,7 +154,7 @@
1012 }
1013
1014 static void
1015-add_polkit_dependency_helper (GtkWidget * parent, GParamSpec *pspec, GtkWidget * dependent)
1016+add_polkit_dependency_helper (GtkWidget * parent, GParamSpec *pspec G_GNUC_UNUSED, GtkWidget * dependent)
1017 {
1018 GtkLockButton * button = GTK_LOCK_BUTTON (parent);
1019 GPermission * permission = gtk_lock_button_get_permission (button);
1020@@ -171,7 +173,7 @@
1021 }
1022
1023 static void
1024-polkit_perm_ready (GObject *source_object, GAsyncResult *res, gpointer user_data)
1025+polkit_perm_ready (GObject *source_object G_GNUC_UNUSED, GAsyncResult *res, gpointer user_data)
1026 {
1027 GError * error = NULL;
1028 GPermission * permission = polkit_permission_new_finish (res, &error);
1029@@ -204,7 +206,7 @@
1030 }
1031
1032 static void
1033-toggle_ntp (GtkWidget * radio, GParamSpec * pspec, IndicatorDatetimePanel * self)
1034+toggle_ntp (GtkWidget * radio, GParamSpec * pspec G_GNUC_UNUSED, IndicatorDatetimePanel * self)
1035 {
1036 gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio));
1037
1038@@ -224,7 +226,9 @@
1039 }
1040
1041 static void
1042-tz_changed (CcTimezoneMap * map, CcTimezoneLocation * location, IndicatorDatetimePanel * self)
1043+tz_changed (CcTimezoneMap * map G_GNUC_UNUSED,
1044+ CcTimezoneLocation * location,
1045+ IndicatorDatetimePanel * self)
1046 {
1047 if (location == NULL)
1048 return;
1049@@ -241,7 +245,9 @@
1050 }
1051
1052 static void
1053-proxy_ready (GObject *object, GAsyncResult *res, IndicatorDatetimePanel * self)
1054+proxy_ready (GObject *object G_GNUC_UNUSED,
1055+ GAsyncResult *res,
1056+ IndicatorDatetimePanel * self)
1057 {
1058 GError * error = NULL;
1059 IndicatorDatetimePanelPrivate * priv = self->priv;
1060@@ -459,7 +465,7 @@
1061 }
1062
1063 static gboolean
1064-format_time_text (GtkWidget * spinner, gpointer user_data)
1065+format_time_text (GtkWidget * spinner, gpointer user_data G_GNUC_UNUSED)
1066 {
1067 gboolean is_time = (gboolean)GPOINTER_TO_INT (g_object_get_data (G_OBJECT (spinner), "is-time"));
1068
1069@@ -570,8 +576,10 @@
1070 }
1071
1072 static gboolean
1073-timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model,
1074- GtkTreeIter * iter, IndicatorDatetimePanel * self)
1075+timezone_selected (GtkEntryCompletion * widget G_GNUC_UNUSED,
1076+ GtkTreeModel * model,
1077+ GtkTreeIter * iter,
1078+ IndicatorDatetimePanel * self)
1079 {
1080 const gchar * name, * zone;
1081
1082@@ -610,7 +618,9 @@
1083 }
1084
1085 static gboolean
1086-entry_focus_out (GtkEntry * entry, GdkEventFocus * event, IndicatorDatetimePanel * self)
1087+entry_focus_out (GtkEntry * entry,
1088+ GdkEventFocus * event G_GNUC_UNUSED,
1089+ IndicatorDatetimePanel * self)
1090 {
1091 // If the name left in the entry doesn't match the current timezone name,
1092 // show an error icon. It's always an error for the user to manually type in
1093@@ -809,12 +819,12 @@
1094 }
1095
1096 static void
1097-indicator_datetime_panel_class_finalize (IndicatorDatetimePanelClass *klass)
1098+indicator_datetime_panel_class_finalize (IndicatorDatetimePanelClass *klass G_GNUC_UNUSED)
1099 {
1100 }
1101
1102 static const char *
1103-indicator_datetime_panel_get_help_uri (CcPanel *panel)
1104+indicator_datetime_panel_get_help_uri (CcPanel *panel G_GNUC_UNUSED)
1105 {
1106 return "help:ubuntu-help/clock";
1107 }
1108@@ -845,6 +855,6 @@
1109 }
1110
1111 void
1112-g_io_module_unload (GIOModule *module)
1113+g_io_module_unload (GIOModule *module G_GNUC_UNUSED)
1114 {
1115 }
1116
1117=== added file 'po/CMakeLists.txt'
1118--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
1119+++ po/CMakeLists.txt 2013-10-30 22:00:17 +0000
1120@@ -0,0 +1,3 @@
1121+include (Translations)
1122+add_translations_directory ("${GETTEXT_PACKAGE}")
1123+add_translations_catalog ("${GETTEXT_PACKAGE}" ../src/ ../panel)
1124
1125=== modified file 'po/POTFILES.in'
1126--- po/POTFILES.in 2013-06-19 04:13:16 +0000
1127+++ po/POTFILES.in 2013-10-30 22:00:17 +0000
1128@@ -1,7 +1,7 @@
1129-src/datetime-prefs.c
1130-src/datetime-prefs-locations.c
1131 src/service.c
1132 src/settings-shared.h
1133 src/utils.c
1134+panel/datetime-prefs.c
1135+panel/datetime-prefs-locations.c
1136 [type: gettext/glade]data/datetime-dialog.ui
1137 data/gnome-indicator-datetime-panel.desktop.in
1138
1139=== added file 'src/CMakeLists.txt'
1140--- src/CMakeLists.txt 1970-01-01 00:00:00 +0000
1141+++ src/CMakeLists.txt 2013-10-30 22:00:17 +0000
1142@@ -0,0 +1,45 @@
1143+set (SERVICE_LIB "libindicatordatetimeservice")
1144+set (SERVICE_EXEC "indicator-datetime-service")
1145+
1146+add_definitions (-DTIMEZONE_FILE="/etc/timezone"
1147+ -DG_LOG_DOMAIN="Indicator-Datetime")
1148+
1149+# let service know how to launch gnome-control-center on the desktop
1150+if (BUILD_PANEL)
1151+ add_definitions (-DHAVE_CCPANEL)
1152+endif ()
1153+
1154+add_library (${SERVICE_LIB} STATIC
1155+ clock.c
1156+ clock.h
1157+ clock-live.c
1158+ clock-live.h
1159+ planner.c
1160+ planner.h
1161+ planner-eds.c
1162+ planner-eds.h
1163+ service.c
1164+ service.h
1165+ timezone.c
1166+ timezone.h
1167+ timezone-file.c
1168+ timezone-file.h
1169+ timezone-geoclue.c
1170+ timezone-geoclue.h
1171+ utils.c
1172+ utils.h
1173+ dbus-shared.h
1174+ settings-shared.h)
1175+include_directories (${SERVICE_DEPS_INCLUDE_DIRS})
1176+link_directories (${SERVICE_DEPS_LIBRARY_DIRS})
1177+
1178+add_executable (${SERVICE_EXEC} main.c)
1179+target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${GCOV_LIBS})
1180+install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR})
1181+
1182+# common properties
1183+set_property (TARGET ${SERVICE_LIB} ${SERVICE_EXEC}
1184+ APPEND_STRING PROPERTY COMPILE_FLAGS
1185+ " -g ${CC_WARNING_ARGS} ${GCOV_FLAGS}")
1186+
1187+
1188
1189=== removed file 'src/Makefile.am'
1190--- src/Makefile.am 2013-10-17 21:32:44 +0000
1191+++ src/Makefile.am 1970-01-01 00:00:00 +0000
1192@@ -1,88 +0,0 @@
1193-
1194-SHARED_CFLAGS = \
1195- -Wall \
1196- -Wextra -Wno-missing-field-initializers \
1197- -Werror \
1198- $(SERVICE_CFLAGS) \
1199- $(COVERAGE_CFLAGS) \
1200- -DTIMEZONE_FILE="\"/etc/timezone\"" \
1201- -DG_LOG_DOMAIN=\"Indicator-Datetime\"
1202-
1203-###
1204-###
1205-###
1206-
1207-noinst_LIBRARIES = libindicator-datetime-service.a
1208-
1209-libindicator_datetime_service_a_CFLAGS = \
1210- $(SHARED_CFLAGS)
1211-
1212-libindicator_datetime_service_a_SOURCES = \
1213- clock.c \
1214- clock.h \
1215- clock-live.c \
1216- clock-live.h \
1217- planner.c \
1218- planner.h \
1219- planner-eds.c \
1220- planner-eds.h \
1221- service.c \
1222- service.h \
1223- timezone.c \
1224- timezone.h \
1225- timezone-file.c \
1226- timezone-file.h \
1227- timezone-geoclue.c \
1228- timezone-geoclue.h \
1229- utils.c \
1230- utils.h \
1231- dbus-shared.h \
1232- settings-shared.h
1233-
1234-###
1235-###
1236-###
1237-
1238-libexec_PROGRAMS = indicator-datetime-service
1239-
1240-indicator_datetime_service_SOURCES = \
1241- main.c
1242-
1243-indicator_datetime_service_CFLAGS = \
1244- $(SHARED_CFLAGS)
1245-
1246-indicator_datetime_service_LDADD = \
1247- libindicator-datetime-service.a \
1248- $(SERVICE_LIBS)
1249-
1250-indicator_datetime_service_LDFLAGS = \
1251- $(COVERAGE_LDFLAGS)
1252-
1253-###
1254-###
1255-###
1256-
1257-if BUILD_CCPANEL
1258-ccpaneldir = $(libdir)/control-center-1/panels/
1259-ccpanel_LTLIBRARIES = libindicator-datetime.la
1260-
1261-libindicator_datetime_la_SOURCES =\
1262- datetime-prefs.c \
1263- datetime-prefs-locations.c \
1264- datetime-prefs-locations.h \
1265- utils.c \
1266- utils.h \
1267- settings-shared.h
1268-libindicator_datetime_la_CFLAGS = \
1269- -Wall \
1270- -Werror \
1271- $(PREF_CFLAGS) \
1272- $(COVERAGE_CFLAGS) \
1273- -DTIMEZONE_FILE="\"/etc/timezone\"" \
1274- -DPKGDATADIR="\"$(pkgdatadir)\""
1275-libindicator_datetime_la_LIBADD = \
1276- $(PREF_LIBS)
1277-libindicator_datetime_la_LDFLAGS = \
1278- $(COVERAGE_LDFLAGS) \
1279- -module -avoid-version
1280-endif
1281
1282=== modified file 'src/clock-live.c'
1283--- src/clock-live.c 2013-10-23 18:14:25 +0000
1284+++ src/clock-live.c 2013-10-30 22:00:17 +0000
1285@@ -20,8 +20,6 @@
1286 #include <glib.h>
1287 #include <gio/gio.h>
1288
1289-#include "config.h"
1290-
1291 #include "clock-live.h"
1292 #include "settings-shared.h"
1293 #include "timezone-file.h"
1294@@ -54,7 +52,7 @@
1295 indicator_datetime_clock_live,
1296 G_TYPE_OBJECT,
1297 G_IMPLEMENT_INTERFACE (INDICATOR_TYPE_DATETIME_CLOCK,
1298- indicator_datetime_clock_interface_init));
1299+ indicator_datetime_clock_interface_init))
1300
1301 /***
1302 **** Timezones
1303
1304=== modified file 'src/main.c'
1305--- src/main.c 2013-10-28 16:19:49 +0000
1306+++ src/main.c 2013-10-30 22:00:17 +0000
1307@@ -17,8 +17,6 @@
1308 * with this program. If not, see <http://www.gnu.org/licenses/>.
1309 */
1310
1311-#include "config.h"
1312-
1313 #include <locale.h>
1314 #include <stdlib.h> /* exit() */
1315
1316
1317=== modified file 'src/planner-eds.c'
1318--- src/planner-eds.c 2013-10-10 02:24:43 +0000
1319+++ src/planner-eds.c 2013-10-30 22:00:17 +0000
1320@@ -17,8 +17,6 @@
1321 * with this program. If not, see <http://www.gnu.org/licenses/>.
1322 */
1323
1324-#include "config.h"
1325-
1326 #include <libical/ical.h>
1327 #include <libical/icaltime.h>
1328 #include <libecal/libecal.h>
1329
1330=== modified file 'src/service.c'
1331--- src/service.c 2013-10-23 14:42:49 +0000
1332+++ src/service.c 2013-10-30 22:00:17 +0000
1333@@ -18,8 +18,6 @@
1334 * with this program. If not, see <http://www.gnu.org/licenses/>.
1335 */
1336
1337-#include "config.h"
1338-
1339 #include <string.h> /* strstr() */
1340
1341 #include <glib/gi18n.h>
1342@@ -1531,7 +1529,7 @@
1343 }
1344
1345 /* if that appointment's an alarm, dispatch its url */
1346- g_debug ("%s: uri '%s'; matching appt is %p", G_STRFUNC, uid, appt);
1347+ g_debug ("%s: uri '%s'; matching appt is %p", G_STRFUNC, uid, (void*)appt);
1348 if (appt && appointment_has_alarm_url (appt))
1349 dispatch_alarm_url (appt);
1350 }
1351
1352=== modified file 'src/timezone-file.c'
1353--- src/timezone-file.c 2013-09-09 17:43:31 +0000
1354+++ src/timezone-file.c 2013-10-30 22:00:17 +0000
1355@@ -17,8 +17,6 @@
1356 * with this program. If not, see <http://www.gnu.org/licenses/>.
1357 */
1358
1359-#include "config.h"
1360-
1361 #include <gio/gio.h> /* GFile, GFileMonitor */
1362
1363 #include "timezone-file.h"
1364
1365=== modified file 'src/timezone-geoclue.c'
1366--- src/timezone-geoclue.c 2013-09-09 17:43:31 +0000
1367+++ src/timezone-geoclue.c 2013-10-30 22:00:17 +0000
1368@@ -17,8 +17,6 @@
1369 * with this program. If not, see <http://www.gnu.org/licenses/>.
1370 */
1371
1372-#include "config.h"
1373-
1374 #include <geoclue/geoclue-master.h>
1375 #include <geoclue/geoclue-master-client.h>
1376
1377@@ -72,7 +70,7 @@
1378 GeoclueAccuracy * accuracy G_GNUC_UNUSED,
1379 gpointer gself)
1380 {
1381- return on_address_changed(address, timestamp, addy_data, accuracy, NULL, gself);
1382+ on_address_changed(address, timestamp, addy_data, accuracy, NULL, gself);
1383 }
1384
1385 static void
1386
1387=== modified file 'src/utils.c'
1388--- src/utils.c 2013-10-03 21:16:24 +0000
1389+++ src/utils.c 2013-10-30 22:00:17 +0000
1390@@ -20,10 +20,6 @@
1391 with this program. If not, see <http://www.gnu.org/licenses/>.
1392 */
1393
1394-#ifdef HAVE_CONFIG_H
1395-#include "config.h"
1396-#endif
1397-
1398 #include <glib/gi18n-lib.h>
1399 #include <gio/gio.h>
1400 #include <locale.h>
1401@@ -104,9 +100,9 @@
1402 split_settings_location (tz_name, &old_zone, &old_name);
1403 g_free (tz_name);
1404
1405- // new_name is always just a sanitized version of a timezone.
1406- // old_name is potentially a saved "pretty" version of a timezone name from
1407- // geonames. So we prefer to use it if available and the zones match.
1408+ /* new_name is always just a sanitized version of a timezone.
1409+ old_name is potentially a saved "pretty" version of a timezone name from
1410+ geonames. So we prefer to use it if available and the zones match. */
1411
1412 if (g_strcmp0 (old_zone, new_zone) == 0) {
1413 rv = old_name;
1414
1415=== added file 'tests/CMakeLists.txt'
1416--- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
1417+++ tests/CMakeLists.txt 2013-10-30 22:00:17 +0000
1418@@ -0,0 +1,23 @@
1419+# build the necessary schemas
1420+set_directory_properties (PROPERTIES
1421+ ADDITIONAL_MAKE_CLEAN_FILES gschemas.compiled)
1422+set_source_files_properties (gschemas.compiled GENERATED)
1423+
1424+# GSettings:
1425+# compile the indicator-datetime schema into a gschemas.compiled file in this directory,
1426+# and help the tests to find that file by setting -DSCHEMA_DIR
1427+set (SCHEMA_DIR ${CMAKE_CURRENT_BINARY_DIR})
1428+add_definitions(-DSCHEMA_DIR="${SCHEMA_DIR}")
1429+execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas
1430+ OUTPUT_VARIABLE COMPILE_SCHEMA_EXECUTABLE
1431+ OUTPUT_STRIP_TRAILING_WHITESPACE)
1432+add_custom_command (OUTPUT gschemas.compiled
1433+ DEPENDS ${CMAKE_SOURCE_DIR}/data/com.canonical.indicator.session.gschema.xml
1434+ COMMAND cp -f ${CMAKE_SOURCE_DIR}/data/*gschema.xml ${SCHEMA_DIR}
1435+ COMMAND ${COMPILE_SCHEMA_EXECUTABLE} ${SCHEMA_DIR})
1436+
1437+# look for hearder in our src dir, and also in the directories where we autogenerate files...
1438+include_directories (${CMAKE_SOURCE_DIR}/src)
1439+include_directories (${CMAKE_CURRENT_BINARY_DIR} ${SERVICE_INCLUDE_DIRS})
1440+
1441+
1442
1443=== removed file 'tests/Makefile.am'
1444--- tests/Makefile.am 2013-09-07 14:48:46 +0000
1445+++ tests/Makefile.am 1970-01-01 00:00:00 +0000
1446@@ -1,58 +0,0 @@
1447-TESTS =
1448-CLEANFILES =
1449-BUILT_SOURCES =
1450-check_PROGRAMS =
1451-
1452-###
1453-###
1454-###
1455-
1456-# stock UMB tests on user-visible strings
1457-include $(srcdir)/Makefile.am.strings
1458-
1459-check_LIBRARIES = libgtest.a
1460-nodist_libgtest_a_SOURCES = \
1461- $(GTEST_SOURCE)/gtest-all.cc \
1462- $(GTEST_SOURCE)/gtest_main.cc
1463-
1464-AM_CPPFLAGS = $(GTEST_CPPFLAGS) -I${top_srcdir}/src -Wall -Werror
1465-AM_CXXFLAGS = $(GTEST_CXXFLAGS)
1466-
1467-###
1468-###
1469-###
1470-
1471-TEST_LIBS = \
1472- libgtest.a \
1473- $(SERVICE_LIBS) \
1474- $(COVERAGE_LDFLAGS) \
1475- $(XORG_GTEST_LDFLAGS)
1476-
1477-TEST_CPPFLAGS = \
1478- $(AM_CPPFLAGS) \
1479- $(SERVICE_CFLAGS)
1480-
1481-BUILT_SOURCES += gschemas.compiled
1482-CLEANFILES += gschemas.compiled
1483-gschemas.compiled: Makefile
1484- @glib-compile-schemas --targetdir=$(abs_builddir) $(top_builddir)/data
1485-
1486-###
1487-###
1488-###
1489-
1490-TESTS += test-indicator
1491-check_PROGRAMS += test-indicator
1492-test_indicator_SOURCES = test-indicator.cc
1493-test_indicator_LDADD = $(TEST_LIBS)
1494-test_indicator_CPPFLAGS = $(TEST_CPPFLAGS) -DSCHEMA_DIR="\"$(top_builddir)/tests/\""
1495-
1496-###
1497-###
1498-###
1499-
1500-TESTS += test-utils
1501-check_PROGRAMS += test-utils
1502-test_utils_SOURCES = test-utils.cc
1503-test_utils_LDADD = $(top_builddir)/src/libindicator-datetime-service.a $(TEST_LIBS)
1504-test_utils_CPPFLAGS = $(TEST_CPPFLAGS) -DSCHEMA_DIR="\"$(top_builddir)/tests/\""

Subscribers

People subscribed via source and target branches