aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am22
-rw-r--r--src/Makefile.in239
-rw-r--r--src/datetime-prefs-locations.c18
-rw-r--r--src/datetime-prefs-locations.h2
-rw-r--r--src/datetime-prefs.c39
-rw-r--r--src/datetime-service.c53
-rw-r--r--src/indicator-datetime.c20
-rw-r--r--src/timezone-completion.c697
-rw-r--r--src/timezone-completion.h66
9 files changed, 233 insertions, 923 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 254022e..a31cb4b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,8 @@
+if BUILD_CCPANEL
ccpaneldir = $(CCPANELDIR)
ccpanel_LTLIBRARIES = libindicator-datetime.la
+endif
libexec_PROGRAMS = indicator-datetime-service
@@ -17,10 +19,13 @@ indicator_datetime_service_CFLAGS = \
-Wall \
-Werror \
$(SERVICE_CFLAGS) \
+ $(COVERAGE_CFLAGS) \
-DTIMEZONE_FILE="\"/etc/timezone\"" \
-DG_LOG_DOMAIN=\"Indicator-Datetime\"
indicator_datetime_service_LDADD = \
$(SERVICE_LIBS)
+indicator_datetime_service_LDFLAGS = \
+ $(COVERAGE_LDFLAGS)
datetimelibdir = $(INDICATORDIR)
datetimelib_LTLIBRARIES = libdatetime.la
@@ -33,45 +38,48 @@ libdatetime_la_SOURCES = \
indicator-datetime.c
libdatetime_la_CFLAGS = \
$(INDICATOR_CFLAGS) \
+ $(COVERAGE_CFLAGS) \
-Wall -Werror \
-DTIMEZONE_FILE="\"/etc/timezone\"" \
-DG_LOG_DOMAIN=\"Indicator-Datetime\"
libdatetime_la_LIBADD = \
$(INDICATOR_LIBS)
libdatetime_la_LDFLAGS = \
+ $(COVERAGE_LDFLAGS) \
-module \
-avoid-version
+if BUILD_CCPANEL
libindicator_datetime_la_SOURCES =\
datetime-prefs.c \
datetime-prefs-locations.c \
datetime-prefs-locations.h \
- timezone-completion.c \
- timezone-completion.h \
utils.c \
utils.h \
settings-shared.h
libindicator_datetime_la_CFLAGS = \
-Wall \
-Werror \
- -I$(top_srcdir)/libmap \
$(PREF_CFLAGS) \
+ $(COVERAGE_CFLAGS) \
-DTIMEZONE_FILE="\"/etc/timezone\"" \
-DPKGDATADIR="\"$(pkgdatadir)\""
libindicator_datetime_la_LIBADD = \
- $(top_builddir)/libmap/libmap.la \
$(PREF_LIBS)
-libindicator_datetime_la_LDFLAGS = -module -avoid-version
+libindicator_datetime_la_LDFLAGS = \
+ $(COVERAGE_LDFLAGS) \
+ -module -avoid-version
+endif
gen-%.xml.c: %.xml
@echo "Building $@ from $<"
- @echo "const char * _$(subst -,_,$(subst .,_,$(basename $<))) = " > $@
+ @echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@
@sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@
@echo ";" >> $@
gen-%.xml.h: %.xml
@echo "Building $@ from $<"
- @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $<)));" > $@
+ @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<))));" > $@
BUILT_SOURCES = \
gen-datetime-service.xml.c \
diff --git a/src/Makefile.in b/src/Makefile.in
index 406797d..83c5ec2 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -42,7 +42,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/intltool.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/gcov.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
@@ -70,6 +71,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
am__installdirs = "$(DESTDIR)$(ccpaneldir)" \
"$(DESTDIR)$(datetimelibdir)" "$(DESTDIR)$(libexecdir)"
LTLIBRARIES = $(ccpanel_LTLIBRARIES) $(datetimelib_LTLIBRARIES)
@@ -78,26 +85,29 @@ libdatetime_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_libdatetime_la_OBJECTS = libdatetime_la-utils.lo \
libdatetime_la-indicator-datetime.lo
libdatetime_la_OBJECTS = $(am_libdatetime_la_OBJECTS)
-AM_V_lt = $(am__v_lt_$(V))
-am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
libdatetime_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libdatetime_la_CFLAGS) $(CFLAGS) $(libdatetime_la_LDFLAGS) \
$(LDFLAGS) -o $@
-libindicator_datetime_la_DEPENDENCIES = \
- $(top_builddir)/libmap/libmap.la $(am__DEPENDENCIES_1)
-am_libindicator_datetime_la_OBJECTS = \
- libindicator_datetime_la-datetime-prefs.lo \
- libindicator_datetime_la-datetime-prefs-locations.lo \
- libindicator_datetime_la-timezone-completion.lo \
- libindicator_datetime_la-utils.lo
+@BUILD_CCPANEL_TRUE@libindicator_datetime_la_DEPENDENCIES = \
+@BUILD_CCPANEL_TRUE@ $(am__DEPENDENCIES_1)
+am__libindicator_datetime_la_SOURCES_DIST = datetime-prefs.c \
+ datetime-prefs-locations.c datetime-prefs-locations.h utils.c \
+ utils.h settings-shared.h
+@BUILD_CCPANEL_TRUE@am_libindicator_datetime_la_OBJECTS = libindicator_datetime_la-datetime-prefs.lo \
+@BUILD_CCPANEL_TRUE@ libindicator_datetime_la-datetime-prefs-locations.lo \
+@BUILD_CCPANEL_TRUE@ libindicator_datetime_la-utils.lo
libindicator_datetime_la_OBJECTS = \
$(am_libindicator_datetime_la_OBJECTS)
libindicator_datetime_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libindicator_datetime_la_CFLAGS) $(CFLAGS) \
$(libindicator_datetime_la_LDFLAGS) $(LDFLAGS) -o $@
+@BUILD_CCPANEL_TRUE@am_libindicator_datetime_la_rpath = -rpath \
+@BUILD_CCPANEL_TRUE@ $(ccpaneldir)
PROGRAMS = $(libexec_PROGRAMS)
am_indicator_datetime_service_OBJECTS = \
indicator_datetime_service-datetime-interface.$(OBJEXT) \
@@ -109,8 +119,8 @@ indicator_datetime_service_OBJECTS = \
indicator_datetime_service_DEPENDENCIES = $(am__DEPENDENCIES_1)
indicator_datetime_service_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(indicator_datetime_service_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
+ $(indicator_datetime_service_CFLAGS) $(CFLAGS) \
+ $(indicator_datetime_service_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
@@ -121,27 +131,27 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(libdatetime_la_SOURCES) \
$(libindicator_datetime_la_SOURCES) \
$(indicator_datetime_service_SOURCES)
DIST_SOURCES = $(libdatetime_la_SOURCES) \
- $(libindicator_datetime_la_SOURCES) \
+ $(am__libindicator_datetime_la_SOURCES_DIST) \
$(indicator_datetime_service_SOURCES)
ETAGS = etags
CTAGS = ctags
@@ -161,6 +171,9 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CCPANELDIR = @CCPANELDIR@
CFLAGS = @CFLAGS@
+COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
+COVERAGE_CXXFLAGS = @COVERAGE_CXXFLAGS@
+COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -177,6 +190,8 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+GCOVR = @GCOVR@
+GENHTML = @GENHTML@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
@@ -201,6 +216,11 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
INTLTOOL_MERGE = @INTLTOOL_MERGE@
INTLTOOL_PERL = @INTLTOOL_PERL@
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@
+INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@
+INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@
+INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@
+LCOV = @LCOV@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBMAP_CFLAGS = @LIBMAP_CFLAGS@
@@ -248,6 +268,7 @@ SERVICE_CFLAGS = @SERVICE_CFLAGS@
SERVICE_LIBS = @SERVICE_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SHTOOL = @SHTOOL@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
@@ -286,6 +307,8 @@ htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
+intltool__v_merge_options_ = @intltool__v_merge_options_@
+intltool__v_merge_options_0 = @intltool__v_merge_options_0@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
@@ -305,8 +328,8 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-ccpaneldir = $(CCPANELDIR)
-ccpanel_LTLIBRARIES = libindicator-datetime.la
+@BUILD_CCPANEL_TRUE@ccpaneldir = $(CCPANELDIR)
+@BUILD_CCPANEL_TRUE@ccpanel_LTLIBRARIES = libindicator-datetime.la
indicator_datetime_service_SOURCES = \
datetime-interface.c \
datetime-interface.h \
@@ -321,12 +344,16 @@ indicator_datetime_service_CFLAGS = \
-Wall \
-Werror \
$(SERVICE_CFLAGS) \
+ $(COVERAGE_CFLAGS) \
-DTIMEZONE_FILE="\"/etc/timezone\"" \
-DG_LOG_DOMAIN=\"Indicator-Datetime\"
indicator_datetime_service_LDADD = \
$(SERVICE_LIBS)
+indicator_datetime_service_LDFLAGS = \
+ $(COVERAGE_LDFLAGS)
+
datetimelibdir = $(INDICATORDIR)
datetimelib_LTLIBRARIES = libdatetime.la
libdatetime_la_SOURCES = \
@@ -339,6 +366,7 @@ libdatetime_la_SOURCES = \
libdatetime_la_CFLAGS = \
$(INDICATOR_CFLAGS) \
+ $(COVERAGE_CFLAGS) \
-Wall -Werror \
-DTIMEZONE_FILE="\"/etc/timezone\"" \
-DG_LOG_DOMAIN=\"Indicator-Datetime\"
@@ -347,32 +375,33 @@ libdatetime_la_LIBADD = \
$(INDICATOR_LIBS)
libdatetime_la_LDFLAGS = \
+ $(COVERAGE_LDFLAGS) \
-module \
-avoid-version
-libindicator_datetime_la_SOURCES = \
- datetime-prefs.c \
- datetime-prefs-locations.c \
- datetime-prefs-locations.h \
- timezone-completion.c \
- timezone-completion.h \
- utils.c \
- utils.h \
- settings-shared.h
-
-libindicator_datetime_la_CFLAGS = \
- -Wall \
- -Werror \
- -I$(top_srcdir)/libmap \
- $(PREF_CFLAGS) \
- -DTIMEZONE_FILE="\"/etc/timezone\"" \
- -DPKGDATADIR="\"$(pkgdatadir)\""
-
-libindicator_datetime_la_LIBADD = \
- $(top_builddir)/libmap/libmap.la \
- $(PREF_LIBS)
+@BUILD_CCPANEL_TRUE@libindicator_datetime_la_SOURCES = \
+@BUILD_CCPANEL_TRUE@ datetime-prefs.c \
+@BUILD_CCPANEL_TRUE@ datetime-prefs-locations.c \
+@BUILD_CCPANEL_TRUE@ datetime-prefs-locations.h \
+@BUILD_CCPANEL_TRUE@ utils.c \
+@BUILD_CCPANEL_TRUE@ utils.h \
+@BUILD_CCPANEL_TRUE@ settings-shared.h
+
+@BUILD_CCPANEL_TRUE@libindicator_datetime_la_CFLAGS = \
+@BUILD_CCPANEL_TRUE@ -Wall \
+@BUILD_CCPANEL_TRUE@ -Werror \
+@BUILD_CCPANEL_TRUE@ $(PREF_CFLAGS) \
+@BUILD_CCPANEL_TRUE@ $(COVERAGE_CFLAGS) \
+@BUILD_CCPANEL_TRUE@ -DTIMEZONE_FILE="\"/etc/timezone\"" \
+@BUILD_CCPANEL_TRUE@ -DPKGDATADIR="\"$(pkgdatadir)\""
+
+@BUILD_CCPANEL_TRUE@libindicator_datetime_la_LIBADD = \
+@BUILD_CCPANEL_TRUE@ $(PREF_LIBS)
+
+@BUILD_CCPANEL_TRUE@libindicator_datetime_la_LDFLAGS = \
+@BUILD_CCPANEL_TRUE@ $(COVERAGE_LDFLAGS) \
+@BUILD_CCPANEL_TRUE@ -module -avoid-version
-libindicator_datetime_la_LDFLAGS = -module -avoid-version
BUILT_SOURCES = \
gen-datetime-service.xml.c \
gen-datetime-service.xml.h
@@ -480,10 +509,10 @@ clean-datetimelibLTLIBRARIES:
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
-libdatetime.la: $(libdatetime_la_OBJECTS) $(libdatetime_la_DEPENDENCIES)
+libdatetime.la: $(libdatetime_la_OBJECTS) $(libdatetime_la_DEPENDENCIES) $(EXTRA_libdatetime_la_DEPENDENCIES)
$(AM_V_CCLD)$(libdatetime_la_LINK) -rpath $(datetimelibdir) $(libdatetime_la_OBJECTS) $(libdatetime_la_LIBADD) $(LIBS)
-libindicator-datetime.la: $(libindicator_datetime_la_OBJECTS) $(libindicator_datetime_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libindicator_datetime_la_LINK) -rpath $(ccpaneldir) $(libindicator_datetime_la_OBJECTS) $(libindicator_datetime_la_LIBADD) $(LIBS)
+libindicator-datetime.la: $(libindicator_datetime_la_OBJECTS) $(libindicator_datetime_la_DEPENDENCIES) $(EXTRA_libindicator_datetime_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libindicator_datetime_la_LINK) $(am_libindicator_datetime_la_rpath) $(libindicator_datetime_la_OBJECTS) $(libindicator_datetime_la_LIBADD) $(LIBS)
install-libexecPROGRAMS: $(libexec_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
@@ -527,7 +556,7 @@ clean-libexecPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-indicator-datetime-service$(EXEEXT): $(indicator_datetime_service_OBJECTS) $(indicator_datetime_service_DEPENDENCIES)
+indicator-datetime-service$(EXEEXT): $(indicator_datetime_service_OBJECTS) $(indicator_datetime_service_DEPENDENCIES) $(EXTRA_indicator_datetime_service_DEPENDENCIES)
@rm -f indicator-datetime-service$(EXEEXT)
$(AM_V_CCLD)$(indicator_datetime_service_LINK) $(indicator_datetime_service_OBJECTS) $(indicator_datetime_service_LDADD) $(LIBS)
@@ -545,144 +574,119 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdatetime_la-utils.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libindicator_datetime_la-datetime-prefs-locations.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libindicator_datetime_la-datetime-prefs.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libindicator_datetime_la-timezone-completion.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libindicator_datetime_la-utils.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
libdatetime_la-utils.lo: utils.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdatetime_la_CFLAGS) $(CFLAGS) -MT libdatetime_la-utils.lo -MD -MP -MF $(DEPDIR)/libdatetime_la-utils.Tpo -c -o libdatetime_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdatetime_la-utils.Tpo $(DEPDIR)/libdatetime_la-utils.Plo
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='libdatetime_la-utils.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='libdatetime_la-utils.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdatetime_la_CFLAGS) $(CFLAGS) -c -o libdatetime_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdatetime_la_CFLAGS) $(CFLAGS) -c -o libdatetime_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
libdatetime_la-indicator-datetime.lo: indicator-datetime.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdatetime_la_CFLAGS) $(CFLAGS) -MT libdatetime_la-indicator-datetime.lo -MD -MP -MF $(DEPDIR)/libdatetime_la-indicator-datetime.Tpo -c -o libdatetime_la-indicator-datetime.lo `test -f 'indicator-datetime.c' || echo '$(srcdir)/'`indicator-datetime.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdatetime_la-indicator-datetime.Tpo $(DEPDIR)/libdatetime_la-indicator-datetime.Plo
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='indicator-datetime.c' object='libdatetime_la-indicator-datetime.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='indicator-datetime.c' object='libdatetime_la-indicator-datetime.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdatetime_la_CFLAGS) $(CFLAGS) -c -o libdatetime_la-indicator-datetime.lo `test -f 'indicator-datetime.c' || echo '$(srcdir)/'`indicator-datetime.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdatetime_la_CFLAGS) $(CFLAGS) -c -o libdatetime_la-indicator-datetime.lo `test -f 'indicator-datetime.c' || echo '$(srcdir)/'`indicator-datetime.c
libindicator_datetime_la-datetime-prefs.lo: datetime-prefs.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -MT libindicator_datetime_la-datetime-prefs.lo -MD -MP -MF $(DEPDIR)/libindicator_datetime_la-datetime-prefs.Tpo -c -o libindicator_datetime_la-datetime-prefs.lo `test -f 'datetime-prefs.c' || echo '$(srcdir)/'`datetime-prefs.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libindicator_datetime_la-datetime-prefs.Tpo $(DEPDIR)/libindicator_datetime_la-datetime-prefs.Plo
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-prefs.c' object='libindicator_datetime_la-datetime-prefs.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='datetime-prefs.c' object='libindicator_datetime_la-datetime-prefs.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-datetime-prefs.lo `test -f 'datetime-prefs.c' || echo '$(srcdir)/'`datetime-prefs.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-datetime-prefs.lo `test -f 'datetime-prefs.c' || echo '$(srcdir)/'`datetime-prefs.c
libindicator_datetime_la-datetime-prefs-locations.lo: datetime-prefs-locations.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -MT libindicator_datetime_la-datetime-prefs-locations.lo -MD -MP -MF $(DEPDIR)/libindicator_datetime_la-datetime-prefs-locations.Tpo -c -o libindicator_datetime_la-datetime-prefs-locations.lo `test -f 'datetime-prefs-locations.c' || echo '$(srcdir)/'`datetime-prefs-locations.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libindicator_datetime_la-datetime-prefs-locations.Tpo $(DEPDIR)/libindicator_datetime_la-datetime-prefs-locations.Plo
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-prefs-locations.c' object='libindicator_datetime_la-datetime-prefs-locations.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='datetime-prefs-locations.c' object='libindicator_datetime_la-datetime-prefs-locations.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-datetime-prefs-locations.lo `test -f 'datetime-prefs-locations.c' || echo '$(srcdir)/'`datetime-prefs-locations.c
-
-libindicator_datetime_la-timezone-completion.lo: timezone-completion.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -MT libindicator_datetime_la-timezone-completion.lo -MD -MP -MF $(DEPDIR)/libindicator_datetime_la-timezone-completion.Tpo -c -o libindicator_datetime_la-timezone-completion.lo `test -f 'timezone-completion.c' || echo '$(srcdir)/'`timezone-completion.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libindicator_datetime_la-timezone-completion.Tpo $(DEPDIR)/libindicator_datetime_la-timezone-completion.Plo
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timezone-completion.c' object='libindicator_datetime_la-timezone-completion.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-timezone-completion.lo `test -f 'timezone-completion.c' || echo '$(srcdir)/'`timezone-completion.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-datetime-prefs-locations.lo `test -f 'datetime-prefs-locations.c' || echo '$(srcdir)/'`datetime-prefs-locations.c
libindicator_datetime_la-utils.lo: utils.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -MT libindicator_datetime_la-utils.lo -MD -MP -MF $(DEPDIR)/libindicator_datetime_la-utils.Tpo -c -o libindicator_datetime_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libindicator_datetime_la-utils.Tpo $(DEPDIR)/libindicator_datetime_la-utils.Plo
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='libindicator_datetime_la-utils.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='libindicator_datetime_la-utils.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
indicator_datetime_service-datetime-interface.o: datetime-interface.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -MT indicator_datetime_service-datetime-interface.o -MD -MP -MF $(DEPDIR)/indicator_datetime_service-datetime-interface.Tpo -c -o indicator_datetime_service-datetime-interface.o `test -f 'datetime-interface.c' || echo '$(srcdir)/'`datetime-interface.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-datetime-interface.Tpo $(DEPDIR)/indicator_datetime_service-datetime-interface.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-interface.c' object='indicator_datetime_service-datetime-interface.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='datetime-interface.c' object='indicator_datetime_service-datetime-interface.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-interface.o `test -f 'datetime-interface.c' || echo '$(srcdir)/'`datetime-interface.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-interface.o `test -f 'datetime-interface.c' || echo '$(srcdir)/'`datetime-interface.c
indicator_datetime_service-datetime-interface.obj: datetime-interface.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -MT indicator_datetime_service-datetime-interface.obj -MD -MP -MF $(DEPDIR)/indicator_datetime_service-datetime-interface.Tpo -c -o indicator_datetime_service-datetime-interface.obj `if test -f 'datetime-interface.c'; then $(CYGPATH_W) 'datetime-interface.c'; else $(CYGPATH_W) '$(srcdir)/datetime-interface.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-datetime-interface.Tpo $(DEPDIR)/indicator_datetime_service-datetime-interface.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-interface.c' object='indicator_datetime_service-datetime-interface.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='datetime-interface.c' object='indicator_datetime_service-datetime-interface.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-interface.obj `if test -f 'datetime-interface.c'; then $(CYGPATH_W) 'datetime-interface.c'; else $(CYGPATH_W) '$(srcdir)/datetime-interface.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-interface.obj `if test -f 'datetime-interface.c'; then $(CYGPATH_W) 'datetime-interface.c'; else $(CYGPATH_W) '$(srcdir)/datetime-interface.c'; fi`
indicator_datetime_service-gen-datetime-service.xml.o: gen-datetime-service.xml.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -MT indicator_datetime_service-gen-datetime-service.xml.o -MD -MP -MF $(DEPDIR)/indicator_datetime_service-gen-datetime-service.xml.Tpo -c -o indicator_datetime_service-gen-datetime-service.xml.o `test -f 'gen-datetime-service.xml.c' || echo '$(srcdir)/'`gen-datetime-service.xml.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-gen-datetime-service.xml.Tpo $(DEPDIR)/indicator_datetime_service-gen-datetime-service.xml.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gen-datetime-service.xml.c' object='indicator_datetime_service-gen-datetime-service.xml.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gen-datetime-service.xml.c' object='indicator_datetime_service-gen-datetime-service.xml.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-gen-datetime-service.xml.o `test -f 'gen-datetime-service.xml.c' || echo '$(srcdir)/'`gen-datetime-service.xml.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-gen-datetime-service.xml.o `test -f 'gen-datetime-service.xml.c' || echo '$(srcdir)/'`gen-datetime-service.xml.c
indicator_datetime_service-gen-datetime-service.xml.obj: gen-datetime-service.xml.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -MT indicator_datetime_service-gen-datetime-service.xml.obj -MD -MP -MF $(DEPDIR)/indicator_datetime_service-gen-datetime-service.xml.Tpo -c -o indicator_datetime_service-gen-datetime-service.xml.obj `if test -f 'gen-datetime-service.xml.c'; then $(CYGPATH_W) 'gen-datetime-service.xml.c'; else $(CYGPATH_W) '$(srcdir)/gen-datetime-service.xml.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-gen-datetime-service.xml.Tpo $(DEPDIR)/indicator_datetime_service-gen-datetime-service.xml.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gen-datetime-service.xml.c' object='indicator_datetime_service-gen-datetime-service.xml.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gen-datetime-service.xml.c' object='indicator_datetime_service-gen-datetime-service.xml.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-gen-datetime-service.xml.obj `if test -f 'gen-datetime-service.xml.c'; then $(CYGPATH_W) 'gen-datetime-service.xml.c'; else $(CYGPATH_W) '$(srcdir)/gen-datetime-service.xml.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-gen-datetime-service.xml.obj `if test -f 'gen-datetime-service.xml.c'; then $(CYGPATH_W) 'gen-datetime-service.xml.c'; else $(CYGPATH_W) '$(srcdir)/gen-datetime-service.xml.c'; fi`
indicator_datetime_service-datetime-service.o: datetime-service.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -MT indicator_datetime_service-datetime-service.o -MD -MP -MF $(DEPDIR)/indicator_datetime_service-datetime-service.Tpo -c -o indicator_datetime_service-datetime-service.o `test -f 'datetime-service.c' || echo '$(srcdir)/'`datetime-service.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-datetime-service.Tpo $(DEPDIR)/indicator_datetime_service-datetime-service.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-service.c' object='indicator_datetime_service-datetime-service.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='datetime-service.c' object='indicator_datetime_service-datetime-service.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-service.o `test -f 'datetime-service.c' || echo '$(srcdir)/'`datetime-service.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-service.o `test -f 'datetime-service.c' || echo '$(srcdir)/'`datetime-service.c
indicator_datetime_service-datetime-service.obj: datetime-service.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -MT indicator_datetime_service-datetime-service.obj -MD -MP -MF $(DEPDIR)/indicator_datetime_service-datetime-service.Tpo -c -o indicator_datetime_service-datetime-service.obj `if test -f 'datetime-service.c'; then $(CYGPATH_W) 'datetime-service.c'; else $(CYGPATH_W) '$(srcdir)/datetime-service.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-datetime-service.Tpo $(DEPDIR)/indicator_datetime_service-datetime-service.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-service.c' object='indicator_datetime_service-datetime-service.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='datetime-service.c' object='indicator_datetime_service-datetime-service.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-service.obj `if test -f 'datetime-service.c'; then $(CYGPATH_W) 'datetime-service.c'; else $(CYGPATH_W) '$(srcdir)/datetime-service.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-service.obj `if test -f 'datetime-service.c'; then $(CYGPATH_W) 'datetime-service.c'; else $(CYGPATH_W) '$(srcdir)/datetime-service.c'; fi`
indicator_datetime_service-utils.o: utils.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -MT indicator_datetime_service-utils.o -MD -MP -MF $(DEPDIR)/indicator_datetime_service-utils.Tpo -c -o indicator_datetime_service-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-utils.Tpo $(DEPDIR)/indicator_datetime_service-utils.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='indicator_datetime_service-utils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='indicator_datetime_service-utils.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
indicator_datetime_service-utils.obj: utils.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -MT indicator_datetime_service-utils.obj -MD -MP -MF $(DEPDIR)/indicator_datetime_service-utils.Tpo -c -o indicator_datetime_service-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-utils.Tpo $(DEPDIR)/indicator_datetime_service-utils.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='indicator_datetime_service-utils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='indicator_datetime_service-utils.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@@ -791,10 +795,15 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
mostlyclean-generic:
clean-generic:
@@ -905,13 +914,13 @@ uninstall-am: uninstall-ccpanelLTLIBRARIES \
gen-%.xml.c: %.xml
@echo "Building $@ from $<"
- @echo "const char * _$(subst -,_,$(subst .,_,$(basename $<))) = " > $@
+ @echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@
@sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@
@echo ";" >> $@
gen-%.xml.h: %.xml
@echo "Building $@ from $<"
- @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $<)));" > $@
+ @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<))));" > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/datetime-prefs-locations.c b/src/datetime-prefs-locations.c
index d865efe..b734a69 100644
--- a/src/datetime-prefs-locations.c
+++ b/src/datetime-prefs-locations.c
@@ -27,11 +27,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
+#include <timezonemap/timezone-completion.h>
#include "datetime-prefs-locations.h"
#include "settings-shared.h"
#include "utils.h"
-#include "timezone-completion.h"
#define DATETIME_DIALOG_UI_FILE PKGDATADIR "/datetime-dialog.ui"
@@ -182,8 +182,8 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model,
const gchar * zone, * name;
gtk_tree_model_get (model, iter,
- TIMEZONE_COMPLETION_ZONE, &zone,
- TIMEZONE_COMPLETION_NAME, &name,
+ CC_TIMEZONE_COMPLETION_ZONE, &zone,
+ CC_TIMEZONE_COMPLETION_NAME, &name,
-1);
if (zone == NULL || zone[0] == 0) {
@@ -191,8 +191,8 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model,
gdouble lon = 0.0, lat = 0.0;
gtk_tree_model_get (model, iter,
- TIMEZONE_COMPLETION_LONGITUDE, &strlon,
- TIMEZONE_COMPLETION_LATITUDE, &strlat,
+ CC_TIMEZONE_COMPLETION_LONGITUDE, &strlon,
+ CC_TIMEZONE_COMPLETION_LATITUDE, &strlat,
-1);
if (strlon != NULL && strlon[0] != 0) {
@@ -245,11 +245,11 @@ query_tooltip (GtkTreeView * tree, gint x, gint y, gboolean keyboard_mode,
static void
handle_edit_started (GtkCellRendererText * renderer, GtkCellEditable * editable,
- gchar * path, TimezoneCompletion * completion)
+ gchar * path, CcTimezoneCompletion * completion)
{
if (GTK_IS_ENTRY (editable)) {
GtkEntry *entry = GTK_ENTRY (editable);
- timezone_completion_watch_entry (completion, entry);
+ cc_timezone_completion_watch_entry (completion, entry);
GtkListStore * store = GTK_LIST_STORE (g_object_get_data (G_OBJECT (completion), "store"));
GtkTreeIter * store_iter = g_new(GtkTreeIter, 1);
@@ -263,7 +263,7 @@ static gboolean
update_times (GtkWidget * dlg)
{
/* For each entry, check zone in column 2 and set column 1 to it's time */
- TimezoneCompletion * completion = TIMEZONE_COMPLETION (g_object_get_data (G_OBJECT (dlg), "completion"));
+ CcTimezoneCompletion * completion = CC_TIMEZONE_COMPLETION (g_object_get_data (G_OBJECT (dlg), "completion"));
GtkListStore * store = GTK_LIST_STORE (g_object_get_data (G_OBJECT (completion), "store"));
GObject * cell = G_OBJECT (g_object_get_data (G_OBJECT (completion), "name-cell"));
@@ -439,7 +439,7 @@ datetime_setup_locations_dialog (CcTimezoneMap * map)
GObject * store = gtk_builder_get_object (builder, "locationsStore");
/* Configure tree */
- TimezoneCompletion * completion = timezone_completion_new ();
+ CcTimezoneCompletion * completion = cc_timezone_completion_new ();
g_object_set_data (G_OBJECT (completion), "tzmap", map);
g_object_set_data (G_OBJECT (completion), "store", store);
g_signal_connect (completion, "match-selected", G_CALLBACK (timezone_selected), dlg);
diff --git a/src/datetime-prefs-locations.h b/src/datetime-prefs-locations.h
index e312894..45d3b23 100644
--- a/src/datetime-prefs-locations.h
+++ b/src/datetime-prefs-locations.h
@@ -24,7 +24,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define __DATETIME_PREFS_LOCATIONS_H__
#include <gtk/gtk.h>
-#include "cc-timezone-map.h"
+#include <timezonemap/cc-timezone-map.h>
G_BEGIN_DECLS
diff --git a/src/datetime-prefs.c b/src/datetime-prefs.c
index 1b7ddd2..9fdfbed 100644
--- a/src/datetime-prefs.c
+++ b/src/datetime-prefs.c
@@ -34,13 +34,13 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <gtk/gtk.h>
#include <polkit/polkit.h>
#include <libgnome-control-center/cc-panel.h>
+#include <timezonemap/cc-timezone-map.h>
+#include <timezonemap/timezone-completion.h>
#include "dbus-shared.h"
#include "settings-shared.h"
#include "utils.h"
#include "datetime-prefs-locations.h"
-#include "timezone-completion.h"
-#include "cc-timezone-map.h"
#define DATETIME_DIALOG_UI_FILE PKGDATADIR "/datetime-dialog.ui"
@@ -69,7 +69,7 @@ struct _IndicatorDatetimePanelPrivate
gboolean user_edited_time;
gboolean changing_time;
GtkWidget * loc_dlg;
- TimezoneCompletion * completion;
+ CcTimezoneCompletion * completion;
};
struct _IndicatorDatetimePanelClass
@@ -243,15 +243,20 @@ sync_entry (IndicatorDatetimePanel * self, const gchar * location)
}
static void
-tz_changed (CcTimezoneMap * map, TzLocation * location, IndicatorDatetimePanel * self)
+tz_changed (CcTimezoneMap * map, CcTimezoneLocation * location, IndicatorDatetimePanel * self)
{
if (location == NULL)
return;
- g_dbus_proxy_call (self->priv->proxy, "SetTimezone", g_variant_new ("(s)", location->zone),
+ gchar * zone;
+ g_object_get (location, "zone", &zone, NULL);
+
+ g_dbus_proxy_call (self->priv->proxy, "SetTimezone", g_variant_new ("(s)", zone),
G_DBUS_CALL_FLAGS_NONE, -1, NULL, dbus_set_answered, "timezone");
- sync_entry (self, location->zone);
+ sync_entry (self, zone);
+
+ g_free (zone);
}
static void
@@ -585,8 +590,8 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model,
const gchar * name, * zone;
gtk_tree_model_get (model, iter,
- TIMEZONE_COMPLETION_NAME, &name,
- TIMEZONE_COMPLETION_ZONE, &zone,
+ CC_TIMEZONE_COMPLETION_NAME, &name,
+ CC_TIMEZONE_COMPLETION_ZONE, &zone,
-1);
if (zone == NULL || zone[0] == 0) {
@@ -594,8 +599,8 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model,
gdouble lon = 0.0, lat = 0.0;
gtk_tree_model_get (model, iter,
- TIMEZONE_COMPLETION_LONGITUDE, &strlon,
- TIMEZONE_COMPLETION_LATITUDE, &strlat,
+ CC_TIMEZONE_COMPLETION_LONGITUDE, &strlon,
+ CC_TIMEZONE_COMPLETION_LATITUDE, &strlat,
-1);
if (strlon != NULL && strlon[0] != 0) {
@@ -626,13 +631,17 @@ entry_focus_out (GtkEntry * entry, GdkEventFocus * event, IndicatorDatetimePanel
// If the name left in the entry doesn't match the current timezone name,
// show an error icon. It's always an error for the user to manually type in
// a timezone.
- TzLocation * location = cc_timezone_map_get_location (self->priv->tzmap);
+ CcTimezoneLocation * location = cc_timezone_map_get_location (self->priv->tzmap);
if (location == NULL)
return FALSE;
- gchar * name = get_current_zone_name (location->zone);
+ gchar * zone;
+ g_object_get (location, "zone", &zone, NULL);
+
+ gchar * name = get_current_zone_name (zone);
gboolean correct = (g_strcmp0 (gtk_entry_get_text (entry), name) == 0);
g_free (name);
+ g_free (zone);
gtk_entry_set_icon_from_stock (entry, GTK_ENTRY_ICON_SECONDARY,
correct ? NULL : GTK_STOCK_DIALOG_ERROR);
@@ -685,8 +694,8 @@ indicator_datetime_panel_init (IndicatorDatetimePanel * self)
cc_timezone_map_set_watermark (self->priv->tzmap, "Geonames.org");
/* And completion entry */
- self->priv->completion = timezone_completion_new ();
- timezone_completion_watch_entry (self->priv->completion, GTK_ENTRY (WIG ("timezoneEntry")));
+ self->priv->completion = cc_timezone_completion_new ();
+ cc_timezone_completion_watch_entry (self->priv->completion, GTK_ENTRY (WIG ("timezoneEntry")));
g_signal_connect (self->priv->completion, "match-selected", G_CALLBACK (timezone_selected), self);
g_signal_connect (WIG ("timezoneEntry"), "focus-out-event", G_CALLBACK (entry_focus_out), self);
@@ -789,7 +798,7 @@ indicator_datetime_panel_dispose (GObject * object)
}
if (self->priv->completion) {
- timezone_completion_watch_entry (self->priv->completion, NULL);
+ cc_timezone_completion_watch_entry (self->priv->completion, NULL);
g_object_unref (self->priv->completion);
self->priv->completion = NULL;
}
diff --git a/src/datetime-service.c b/src/datetime-service.c
index ed8c8e3..ef43594 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -31,7 +31,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <math.h>
#include <gconf/gconf-client.h>
-#include <libdbusmenu-gtk3/menuitem.h>
+#include <libdbusmenu-gtk/menuitem.h>
#include <libdbusmenu-glib/server.h>
#include <libdbusmenu-glib/client.h>
#include <libdbusmenu-glib/menuitem.h>
@@ -54,6 +54,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "settings-shared.h"
#include "utils.h"
+#ifdef HAVE_CCPANEL
+ #define SETTINGS_APP_INVOCATION "gnome-control-center indicator-datetime"
+#else
+ #define SETTINGS_APP_INVOCATION "gnome-control-center datetime"
+#endif
static void geo_create_client (GeoclueMaster * master, GeoclueMasterClient * client, gchar * path, GError * error, gpointer user_data);
static gboolean update_appointment_menu_items (gpointer user_data);
@@ -479,6 +484,24 @@ show_events_changed (void)
}
}
+static gboolean
+calendar_app_is_usable (void)
+{
+ /* confirm that it's installed... */
+ gchar *evo = g_find_program_in_path("evolution");
+ if (evo == NULL)
+ return FALSE;
+ g_debug ("found calendar app: '%s'", evo);
+ g_free (evo);
+
+ /* confirm that it's got an account set up... */
+ GSList *accounts_list = gconf_client_get_list (gconf, "/apps/evolution/mail/accounts", GCONF_VALUE_STRING, NULL);
+ const guint n = g_slist_length (accounts_list);
+ g_debug ("found %u evolution accounts", n);
+ g_slist_free (accounts_list);
+ return n > 0;
+}
+
/* Looks for the calendar application and enables the item if
we have one, starts ecal timer if events are turned on */
static gboolean
@@ -488,9 +511,7 @@ check_for_calendar (gpointer user_data)
dbusmenu_menuitem_property_set_bool(date, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
- gchar *evo = g_find_program_in_path("evolution");
- if (!get_greeter_mode () && evo != NULL) {
- g_debug("Found the calendar application: %s", evo);
+ if (!get_greeter_mode () && calendar_app_is_usable()) {
g_signal_connect (G_OBJECT(date), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
G_CALLBACK (activate_cb), "evolution -c calendar");
@@ -519,7 +540,6 @@ check_for_calendar (gpointer user_data)
g_signal_connect(calendar, "event::month-changed", G_CALLBACK(month_changed_cb), NULL);
g_signal_connect(calendar, "event::day-selected", G_CALLBACK(day_selected_cb), NULL);
g_signal_connect(calendar, "event::day-selected-double-click", G_CALLBACK(day_selected_double_click_cb), NULL);
- g_free(evo);
} else {
g_debug("Unable to find calendar app.");
dbusmenu_menuitem_property_set_bool(add_appointment, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
@@ -979,13 +999,19 @@ update_appointment_menu_items (gpointer user_data)
// Draw the correct icon for the appointment type and then tint it using mask fill.
// For now we'll create a circle
if (color_spec != NULL) {
- GdkColor color;
- gdk_color_parse (color_spec, &color);
g_debug("Creating a cairo surface: size, %d by %d", width, height);
cairo_surface_t *surface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, width, height );
- cairo_t *cr = cairo_create(surface);
- gdk_cairo_set_source_color(cr, &color);
+ cairo_t *cr = cairo_create(surface);
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkRGBA rgba;
+ if (gdk_rgba_parse (&rgba, color_spec))
+ gdk_cairo_set_source_rgba (cr, &rgba);
+#else
+ GdkColor color;
+ if (gdk_color_parse (color_spec, &color))
+ gdk_cairo_set_source_color (cr, &color);
+#endif
cairo_paint(cr);
cairo_set_source_rgba(cr, 0,0,0,0.5);
cairo_set_line_width(cr, 1);
@@ -1146,7 +1172,7 @@ build_menus (DbusmenuMenuitem * root)
dbusmenu_menuitem_property_set (settings, DBUSMENU_MENUITEM_PROP_LABEL, _("Time & Date Settingsā€¦"));
/* insensitive until we check for available apps */
dbusmenu_menuitem_property_set_bool(settings, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
- g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), "gnome-control-center indicator-datetime");
+ g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), SETTINGS_APP_INVOCATION);
dbusmenu_menuitem_child_append(root, settings);
g_idle_add(check_for_timeadmin, NULL);
}
@@ -1404,7 +1430,12 @@ geo_create_client (GeoclueMaster * master, GeoclueMasterClient * client, gchar *
geo_master = client;
- if (geo_master != NULL) {
+ if (error != NULL) {
+ g_warning("Unable to get a GeoClue client! '%s' Geolocation based timezone support will not be available.", error->message);
+ return;
+ }
+
+ if (geo_master == NULL) {
g_warning(_("Unable to get a GeoClue client! Geolocation based timezone support will not be available."));
return;
}
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 8e5f421..c847d47 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -41,9 +41,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libindicator/indicator-service-manager.h>
/* DBusMenu */
-#include <libdbusmenu-gtk3/menu.h>
+#include <libdbusmenu-gtk/menu.h>
#include <libido/libido.h>
-#include <libdbusmenu-gtk3/menuitem.h>
+#include <libdbusmenu-gtk/menuitem.h>
#include "utils.h"
#include "dbus-shared.h"
@@ -161,6 +161,7 @@ static void indicator_datetime_finalize (GObject *object);
static GtkLabel * get_label (IndicatorObject * io);
static GtkMenu * get_menu (IndicatorObject * io);
static const gchar * get_accessible_desc (IndicatorObject * io);
+static const gchar * get_name_hint (IndicatorObject * io);
static GVariant * bind_enum_set (const GValue * value, const GVariantType * type, gpointer user_data);
static gboolean bind_enum_get (GValue * value, GVariant * variant, gpointer user_data);
static gchar * generate_format_string_now (IndicatorDatetime * self);
@@ -200,6 +201,7 @@ indicator_datetime_class_init (IndicatorDatetimeClass *klass)
io_class->get_label = get_label;
io_class->get_menu = get_menu;
io_class->get_accessible_desc = get_accessible_desc;
+ io_class->get_name_hint = get_name_hint;
g_object_class_install_property (object_class,
PROP_SHOW_CLOCK,
@@ -1261,7 +1263,11 @@ new_appointment_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbu
mi_data->gmi = gtk_menu_item_new();
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
+#else
GtkWidget * hbox = gtk_hbox_new(FALSE, 4);
+#endif
/* Icon, probably someone's face or avatar on an IM */
mi_data->icon = gtk_image_new();
@@ -1472,7 +1478,11 @@ new_timezone_item(DbusmenuMenuitem * newitem,
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mi_data->gmi),
dbusmenu_menuitem_property_get_bool(newitem, TIMEZONE_MENUITEM_PROP_RADIO));
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkWidget * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
+#else
GtkWidget * hbox = gtk_hbox_new(FALSE, 4);
+#endif
/* Label, probably a username, chat room or mailbox name */
mi_data->label = gtk_label_new("");
@@ -1548,3 +1558,9 @@ get_accessible_desc (IndicatorObject * io)
}
return NULL;
}
+
+static const gchar *
+get_name_hint (IndicatorObject * io)
+{
+ return PACKAGE_NAME;
+}
diff --git a/src/timezone-completion.c b/src/timezone-completion.c
deleted file mode 100644
index f223bf4..0000000
--- a/src/timezone-completion.c
+++ /dev/null
@@ -1,697 +0,0 @@
-/* -*- Mode: C; coding: utf-8; indent-tabs-mode: nil; tab-width: 2 -*-
-
-Copyright 2011 Canonical Ltd.
-
-Authors:
- Michael Terry <michael.terry@canonical.com>
-
-This program is free software: you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 3, as published
-by the Free Software Foundation.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranties of
-MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <json-glib/json-glib.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkkeysyms.h>
-#include <glib/gi18n.h>
-#include "timezone-completion.h"
-#include "tz.h"
-
-enum {
- LAST_SIGNAL
-};
-
-/* static guint signals[LAST_SIGNAL] = { }; */
-
-struct _TimezoneCompletionPrivate
-{
- GtkTreeModel * initial_model;
- GtkEntry * entry;
- guint queued_request;
- guint changed_id;
- guint keypress_id;
- GCancellable * cancel;
- gchar * request_text;
- GHashTable * request_table;
-};
-
-#define GEONAME_URL "http://geoname-lookup.ubuntu.com/?query=%s&release=%s&lang=%s"
-
-/* Prototypes */
-static void timezone_completion_class_init (TimezoneCompletionClass *klass);
-static void timezone_completion_init (TimezoneCompletion *self);
-static void timezone_completion_dispose (GObject *object);
-static void timezone_completion_finalize (GObject *object);
-
-G_DEFINE_TYPE (TimezoneCompletion, timezone_completion, GTK_TYPE_ENTRY_COMPLETION);
-
-static gboolean
-match_func (GtkEntryCompletion *completion, const gchar *key,
- GtkTreeIter *iter, gpointer user_data)
-{
- // geonames does the work for us
- return TRUE;
-}
-
-static void
-save_and_use_model (TimezoneCompletion * completion, GtkTreeModel * model)
-{
- TimezoneCompletionPrivate * priv = completion->priv;
-
- g_hash_table_insert (priv->request_table, g_strdup (priv->request_text), g_object_ref_sink (model));
-
- if (model == priv->initial_model)
- gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (completion), NULL, NULL, NULL);
- else
- gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (completion), match_func, NULL, NULL);
-
- gtk_entry_completion_set_model (GTK_ENTRY_COMPLETION (completion), model);
-
- if (priv->entry != NULL) {
- gtk_entry_completion_complete (GTK_ENTRY_COMPLETION (completion));
-
- /* By this time, the changed signal has come and gone. We didn't give a
- model to use, so no popup appeared for user. Poke the entry again to show
- popup in 300ms. */
- g_signal_emit_by_name (priv->entry, "changed");
- }
-}
-
-static gint
-sort_zone (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b,
- gpointer user_data)
-{
- /* Anything that has text as a prefix goes first, in mostly sorted order.
- Then everything else goes after, in mostly sorted order. */
- const gchar *casefolded_text = (const gchar *)user_data;
-
- const gchar *namea = NULL, *nameb = NULL;
- gtk_tree_model_get (model, a, TIMEZONE_COMPLETION_NAME, &namea, -1);
- gtk_tree_model_get (model, b, TIMEZONE_COMPLETION_NAME, &nameb, -1);
-
- gchar *casefolded_namea = NULL, *casefolded_nameb = NULL;
- casefolded_namea = g_utf8_casefold (namea, -1);
- casefolded_nameb = g_utf8_casefold (nameb, -1);
-
- gboolean amatches = FALSE, bmatches = FALSE;
- amatches = strncmp (casefolded_text, casefolded_namea, strlen(casefolded_text)) == 0;
- bmatches = strncmp (casefolded_text, casefolded_nameb, strlen(casefolded_text)) == 0;
-
- gint rv;
- if (amatches && !bmatches)
- rv = -1;
- else if (bmatches && !amatches)
- rv = 1;
- else
- rv = g_utf8_collate (casefolded_namea, casefolded_nameb);
-
- g_free (casefolded_namea);
- g_free (casefolded_nameb);
- return rv;
-}
-
-static void
-json_parse_ready (GObject *object, GAsyncResult *res, gpointer user_data)
-{
- TimezoneCompletion * completion = TIMEZONE_COMPLETION (user_data);
- TimezoneCompletionPrivate * priv = completion->priv;
- GError * error = NULL;
- const gchar * prev_name = NULL;
- const gchar * prev_admin1 = NULL;
- const gchar * prev_country = NULL;
-
- json_parser_load_from_stream_finish (JSON_PARSER (object), res, &error);
-
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && priv->cancel) {
- g_cancellable_reset (priv->cancel);
- }
-
- if (error != NULL) {
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- save_and_use_model (completion, priv->initial_model);
- g_warning ("Could not parse geoname JSON data: %s", error->message);
- g_error_free (error);
- return;
- }
-
- GtkListStore * store = gtk_list_store_new (TIMEZONE_COMPLETION_LAST,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING);
-
- JsonReader * reader = json_reader_new (json_parser_get_root (JSON_PARSER (object)));
-
- if (!json_reader_is_array (reader)) {
- g_warning ("Could not parse geoname JSON data");
- save_and_use_model (completion, priv->initial_model);
- g_object_unref (G_OBJECT (reader));
- return;
- }
-
- gint i, count = json_reader_count_elements (reader);
- for (i = 0; i < count; ++i) {
- if (!json_reader_read_element (reader, i))
- continue;
-
- if (json_reader_is_object (reader)) {
- const gchar * name = NULL;
- const gchar * admin1 = NULL;
- const gchar * country = NULL;
- const gchar * longitude = NULL;
- const gchar * latitude = NULL;
- gboolean skip = FALSE;
- if (json_reader_read_member (reader, "name")) {
- name = json_reader_get_string_value (reader);
- json_reader_end_member (reader);
- }
- if (json_reader_read_member (reader, "admin1")) {
- admin1 = json_reader_get_string_value (reader);
- json_reader_end_member (reader);
- }
- if (json_reader_read_member (reader, "country")) {
- country = json_reader_get_string_value (reader);
- json_reader_end_member (reader);
- }
- if (json_reader_read_member (reader, "longitude")) {
- longitude = json_reader_get_string_value (reader);
- json_reader_end_member (reader);
- }
- if (json_reader_read_member (reader, "latitude")) {
- latitude = json_reader_get_string_value (reader);
- json_reader_end_member (reader);
- }
-
- if (g_strcmp0(name, prev_name) == 0 &&
- g_strcmp0(admin1, prev_admin1) == 0 &&
- g_strcmp0(country, prev_country) == 0) {
- // Sometimes the data will have duplicate entries that only differ
- // in longitude and latitude. e.g. "rio de janeiro", "wellington"
- skip = TRUE;
- }
-
- if (!skip) {
- GtkTreeIter iter;
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- TIMEZONE_COMPLETION_ZONE, NULL,
- TIMEZONE_COMPLETION_NAME, name,
- TIMEZONE_COMPLETION_ADMIN1, admin1,
- TIMEZONE_COMPLETION_COUNTRY, country,
- TIMEZONE_COMPLETION_LONGITUDE, longitude,
- TIMEZONE_COMPLETION_LATITUDE, latitude,
- -1);
- gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (store),
- TIMEZONE_COMPLETION_NAME, sort_zone,
- g_utf8_casefold(priv->request_text, -1),
- g_free);
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
- TIMEZONE_COMPLETION_NAME,
- GTK_SORT_ASCENDING);
- }
-
- prev_name = name;
- prev_admin1 = admin1;
- prev_country = country;
- }
-
- json_reader_end_element (reader);
- }
-
- if (strlen (priv->request_text) < 4) {
- gchar * lower_text = g_ascii_strdown (priv->request_text, -1);
- if (g_strcmp0 (lower_text, "ut") == 0 ||
- g_strcmp0 (lower_text, "utc") == 0) {
- GtkTreeIter iter;
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- TIMEZONE_COMPLETION_ZONE, "UTC",
- TIMEZONE_COMPLETION_NAME, "UTC",
- -1);
- }
- g_free (lower_text);
- }
-
- save_and_use_model (completion, GTK_TREE_MODEL (store));
- g_object_unref (G_OBJECT (reader));
-}
-
-static void
-geonames_data_ready (GObject *object, GAsyncResult *res, gpointer user_data)
-{
- TimezoneCompletion * completion = TIMEZONE_COMPLETION (user_data);
- TimezoneCompletionPrivate * priv = completion->priv;
- GError * error = NULL;
- GFileInputStream * stream;
-
- stream = g_file_read_finish (G_FILE (object), res, &error);
-
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && priv->cancel) {
- g_cancellable_reset (priv->cancel);
- }
-
- if (error != NULL) {
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- save_and_use_model (completion, priv->initial_model);
- g_warning ("Could not connect to geoname lookup server: %s", error->message);
- g_error_free (error);
- return;
- }
-
- JsonParser * parser = json_parser_new ();
- json_parser_load_from_stream_async (parser, G_INPUT_STREAM (stream), priv->cancel,
- json_parse_ready, user_data);
-}
-
-/* Returns message locale, with possible country info too like en_US */
-static gchar *
-get_locale (void)
-{
- /* Check LANGUAGE, LC_ALL, LC_MESSAGES, and LANG, treat as colon-separated */
- const gchar *env_names[] = {"LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG", NULL};
- const gchar *env = NULL;
- gint i;
-
- for (i = 0; env_names[i]; i++) {
- env = g_getenv (env_names[i]);
- if (env != NULL && env[0] != 0)
- break;
- }
-
- if (env == NULL)
- return NULL;
-
- /* Now, we split on colons as expected, but also on . and @ to filter out
- extra pieces of locale we don't care about as we only use first chunk. */
- gchar **split = g_strsplit_set (env, ":.@", 2);
- if (split == NULL)
- return NULL;
-
- if (split[0] == NULL) {
- g_strfreev (split);
- return NULL;
- }
-
- gchar *locale = g_strdup (split[0]);
- g_strfreev (split);
- return locale;
-}
-
-static gchar *
-get_version (void)
-{
- static gchar *version = NULL;
-
- if (version == NULL) {
- gchar *stdout = NULL;
- g_spawn_command_line_sync ("lsb_release -rs", &stdout, NULL, NULL, NULL);
-
- if (stdout != NULL)
- version = g_strstrip (stdout);
- else
- version = g_strdup("");
- }
-
- return version;
-}
-
-static gboolean
-request_zones (TimezoneCompletion * completion)
-{
- TimezoneCompletionPrivate * priv = completion->priv;
-
- priv->queued_request = 0;
-
- if (priv->entry == NULL) {
- return FALSE;
- }
-
- /* Cancel any ongoing request */
- if (priv->cancel) {
- g_cancellable_cancel (priv->cancel);
- g_cancellable_reset (priv->cancel);
- }
- g_free (priv->request_text);
-
- const gchar * text = gtk_entry_get_text (priv->entry);
- priv->request_text = g_strdup (text);
-
- gchar * escaped = g_uri_escape_string (text, NULL, FALSE);
- gchar * version = get_version ();
- gchar * locale = get_locale ();
- gchar * url = g_strdup_printf (GEONAME_URL, escaped, version, locale);
- g_free (locale);
- g_free (version);
- g_free (escaped);
-
- GFile * file = g_file_new_for_uri (url);
- g_free (url);
-
- g_file_read_async (file, G_PRIORITY_DEFAULT, priv->cancel,
- geonames_data_ready, completion);
-
- return FALSE;
-}
-
-static void
-entry_changed (GtkEntry * entry, TimezoneCompletion * completion)
-{
- TimezoneCompletionPrivate * priv = completion->priv;
-
- if (priv->queued_request) {
- g_source_remove (priv->queued_request);
- priv->queued_request = 0;
- }
-
- /* See if we've already got this one */
- const gchar * text = gtk_entry_get_text (priv->entry);
- gpointer data;
- if (g_hash_table_lookup_extended (priv->request_table, text, NULL, &data)) {
- gtk_entry_completion_set_model (GTK_ENTRY_COMPLETION (completion), GTK_TREE_MODEL (data));
- }
- else {
- priv->queued_request = g_timeout_add (300, (GSourceFunc)request_zones, completion);
- gtk_entry_completion_set_model (GTK_ENTRY_COMPLETION (completion), NULL);
- }
- gtk_entry_completion_complete (GTK_ENTRY_COMPLETION (completion));
-}
-
-static GtkWidget *
-get_descendent (GtkWidget * parent, GType type)
-{
- if (g_type_is_a (G_OBJECT_TYPE (parent), type))
- return parent;
-
- if (GTK_IS_CONTAINER (parent)) {
- GList * children = gtk_container_get_children (GTK_CONTAINER (parent));
- GList * iter;
- for (iter = children; iter; iter = iter->next) {
- GtkWidget * found = get_descendent (GTK_WIDGET (iter->data), type);
- if (found) {
- g_list_free (children);
- return found;
- }
- }
- g_list_free (children);
- }
-
- return NULL;
-}
-
-/**
- * The popup window and its GtkTreeView are private to our parent completion
- * object. We can't get access to discover if there is a highlighted item or
- * even if the window is showing right now. So this is a super hack to find
- * it by looking through our toplevel's window group and finding a window with
- * a GtkTreeView that points at our model. There should be only one ever, so
- * we'll use the first one we find.
- */
-static GtkTreeView *
-find_popup_treeview (GtkWidget * widget, GtkTreeModel * model)
-{
- GtkWidget * toplevel = gtk_widget_get_toplevel (widget);
- if (!GTK_IS_WINDOW (toplevel))
- return NULL;
-
- GtkWindowGroup * group = gtk_window_get_group (GTK_WINDOW (toplevel));
- GList * windows = gtk_window_group_list_windows (group);
- GList * iter;
- for (iter = windows; iter; iter = iter->next) {
- if (iter->data == toplevel)
- continue; // Skip our own window, we don't have it
- GtkWidget * view = get_descendent (GTK_WIDGET (iter->data), GTK_TYPE_TREE_VIEW);
- if (view != NULL) {
- GtkTreeModel * tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
- if (GTK_IS_TREE_MODEL_FILTER (tree_model))
- tree_model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (tree_model));
- if (tree_model == model) {
- g_list_free (windows);
- return GTK_TREE_VIEW (view);
- }
- }
- }
- g_list_free (windows);
-
- return NULL;
-}
-
-static gboolean
-entry_keypress (GtkEntry * entry, GdkEventKey *event, TimezoneCompletion * completion)
-{
- if (event->keyval == GDK_KEY_ISO_Enter ||
- event->keyval == GDK_KEY_KP_Enter ||
- event->keyval == GDK_KEY_Return) {
- /* Make sure that user has a selection to choose, otherwise ignore */
- GtkTreeModel * model = gtk_entry_completion_get_model (GTK_ENTRY_COMPLETION (completion));
- GtkTreeView * view = find_popup_treeview (GTK_WIDGET (entry), model);
- if (view == NULL) {
- // Just beep if popup hasn't appeared yet.
- gtk_widget_error_bell (GTK_WIDGET (entry));
- return TRUE;
- }
-
- GtkTreeSelection * sel = gtk_tree_view_get_selection (view);
- GtkTreeModel * sel_model = NULL;
- if (!gtk_tree_selection_get_selected (sel, &sel_model, NULL)) {
- // No selection, we should help them out and select first item in list
- GtkTreeIter iter;
- if (gtk_tree_model_get_iter_first (sel_model, &iter))
- gtk_tree_selection_select_iter (sel, &iter);
- // And fall through to normal handler code
- }
- }
-
- return FALSE;
-}
-
-void
-timezone_completion_watch_entry (TimezoneCompletion * completion, GtkEntry * entry)
-{
- TimezoneCompletionPrivate * priv = completion->priv;
-
- if (priv->queued_request) {
- g_source_remove (priv->queued_request);
- priv->queued_request = 0;
- }
- if (priv->entry) {
- g_signal_handler_disconnect (priv->entry, priv->changed_id);
- priv->changed_id = 0;
- g_signal_handler_disconnect (priv->entry, priv->keypress_id);
- priv->keypress_id = 0;
- g_object_remove_weak_pointer (G_OBJECT (priv->entry), (gpointer *)&priv->entry);
- gtk_entry_set_completion (priv->entry, NULL);
- }
-
- priv->entry = entry;
-
- if (entry) {
- guint id = g_signal_connect (entry, "changed", G_CALLBACK (entry_changed), completion);
- priv->changed_id = id;
-
- id = g_signal_connect (entry, "key-press-event", G_CALLBACK (entry_keypress), completion);
- priv->keypress_id = id;
-
- g_object_add_weak_pointer (G_OBJECT (entry), (gpointer *)&priv->entry);
-
- gtk_entry_set_completion (entry, GTK_ENTRY_COMPLETION (completion));
- }
-}
-
-static GtkListStore *
-get_initial_model (void)
-{
- TzDB * db = tz_load_db ();
- GPtrArray * locations = tz_get_locations (db);
-
- GtkListStore * store = gtk_list_store_new (TIMEZONE_COMPLETION_LAST,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING);
-
- gint i;
- for (i = 0; i < locations->len; ++i) {
- TzLocation * loc = g_ptr_array_index (locations, i);
- GtkTreeIter iter;
- gtk_list_store_append (store, &iter);
-
- /* FIXME: need something better than below for non-English locales */
- const gchar * last_bit = ((const gchar *)strrchr (loc->zone, '/')) + 1;
- if (last_bit == NULL)
- last_bit = loc->zone;
- gchar * name = g_strdup (last_bit);
- gchar * underscore;
- while ((underscore = strchr (name, '_'))) {
- *underscore = ' ';
- }
-
- gtk_list_store_set (store, &iter,
- TIMEZONE_COMPLETION_ZONE, loc->zone,
- TIMEZONE_COMPLETION_NAME, name,
- TIMEZONE_COMPLETION_COUNTRY, loc->country,
- -1);
-
- g_free (name);
- }
-
- GtkTreeIter iter;
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- TIMEZONE_COMPLETION_ZONE, "UTC",
- TIMEZONE_COMPLETION_NAME, "UTC",
- -1);
-
- tz_db_free (db);
- return store;
-}
-
-static void
-data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell,
- GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer user_data)
-{
- const gchar * name, * admin1, * country;
-
- gtk_tree_model_get (GTK_TREE_MODEL (tree_model), iter,
- TIMEZONE_COMPLETION_NAME, &name,
- TIMEZONE_COMPLETION_ADMIN1, &admin1,
- TIMEZONE_COMPLETION_COUNTRY, &country,
- -1);
-
- gchar * user_name;
- if (country == NULL || country[0] == 0) {
- user_name = g_strdup (name);
- } else if (admin1 == NULL || admin1[0] == 0) {
- user_name = g_strdup_printf ("%s <small>(%s)</small>", name, country);
- } else {
- user_name = g_strdup_printf ("%s <small>(%s, %s)</small>", name, admin1, country);
- }
-
- g_object_set (G_OBJECT (cell), "markup", user_name, NULL);
-}
-
-static void
-timezone_completion_class_init (TimezoneCompletionClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- g_type_class_add_private (klass, sizeof (TimezoneCompletionPrivate));
-
- object_class->dispose = timezone_completion_dispose;
- object_class->finalize = timezone_completion_finalize;
-
- return;
-}
-
-static void
-timezone_completion_init (TimezoneCompletion * self)
-{
- TimezoneCompletionPrivate *priv;
-
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
- TIMEZONE_COMPLETION_TYPE,
- TimezoneCompletionPrivate);
- priv = self->priv;
-
- priv->initial_model = GTK_TREE_MODEL (get_initial_model ());
-
- g_object_set (G_OBJECT (self),
- "text-column", TIMEZONE_COMPLETION_NAME,
- "popup-set-width", FALSE,
- NULL);
-
- priv->cancel = g_cancellable_new ();
-
- priv->request_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
-
- GtkCellRenderer * cell = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (self), cell, TRUE);
- gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (self), cell, data_func, NULL, NULL);
-
- return;
-}
-
-static void
-timezone_completion_dispose (GObject * object)
-{
- G_OBJECT_CLASS (timezone_completion_parent_class)->dispose (object);
-
- TimezoneCompletion * completion = TIMEZONE_COMPLETION (object);
- TimezoneCompletionPrivate * priv = completion->priv;
-
- if (priv->changed_id) {
- if (priv->entry)
- g_signal_handler_disconnect (priv->entry, priv->changed_id);
- priv->changed_id = 0;
- }
-
- if (priv->keypress_id) {
- if (priv->entry)
- g_signal_handler_disconnect (priv->entry, priv->keypress_id);
- priv->keypress_id = 0;
- }
-
- if (priv->entry != NULL) {
- gtk_entry_set_completion (priv->entry, NULL);
- g_object_remove_weak_pointer (G_OBJECT (priv->entry), (gpointer *)&priv->entry);
- priv->entry = NULL;
- }
-
- if (priv->initial_model != NULL) {
- g_object_unref (G_OBJECT (priv->initial_model));
- priv->initial_model = NULL;
- }
-
- if (priv->queued_request) {
- g_source_remove (priv->queued_request);
- priv->queued_request = 0;
- }
-
- if (priv->cancel != NULL) {
- g_cancellable_cancel (priv->cancel);
- g_object_unref (priv->cancel);
- priv->cancel = NULL;
- }
-
- if (priv->request_text != NULL) {
- g_free (priv->request_text);
- priv->request_text = NULL;
- }
-
- if (priv->request_table != NULL) {
- g_hash_table_destroy (priv->request_table);
- priv->request_table = NULL;
- }
-
- return;
-}
-
-static void
-timezone_completion_finalize (GObject * object)
-{
- G_OBJECT_CLASS (timezone_completion_parent_class)->finalize (object);
- return;
-}
-
-TimezoneCompletion *
-timezone_completion_new ()
-{
- TimezoneCompletion * self = g_object_new (TIMEZONE_COMPLETION_TYPE, NULL);
- return self;
-}
-
diff --git a/src/timezone-completion.h b/src/timezone-completion.h
deleted file mode 100644
index 1592d79..0000000
--- a/src/timezone-completion.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C; coding: utf-8; indent-tabs-mode: nil; tab-width: 2 -*-
-
-Copyright 2011 Canonical Ltd.
-
-Authors:
- Michael Terry <michael.terry@canonical.com>
-
-This program is free software: you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 3, as published
-by the Free Software Foundation.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranties of
-MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
-PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __TIMEZONE_COMPLETION_H__
-#define __TIMEZONE_COMPLETION_H__
-
-#include <glib.h>
-#include <glib-object.h>
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define TIMEZONE_COMPLETION_TYPE (timezone_completion_get_type ())
-#define TIMEZONE_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TIMEZONE_COMPLETION_TYPE, TimezoneCompletion))
-#define TIMEZONE_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TIMEZONE_COMPLETION_TYPE, TimezoneCompletionClass))
-#define IS_TIMEZONE_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TIMEZONE_COMPLETION_TYPE))
-#define IS_TIMEZONE_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TIMEZONE_COMPLETION_TYPE))
-#define TIMEZONE_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TIMEZONE_COMPLETION_TYPE, TimezoneCompletionClass))
-
-typedef struct _TimezoneCompletion TimezoneCompletion;
-typedef struct _TimezoneCompletionPrivate TimezoneCompletionPrivate;
-typedef struct _TimezoneCompletionClass TimezoneCompletionClass;
-
-struct _TimezoneCompletion {
- GtkEntryCompletion parent;
-
- TimezoneCompletionPrivate *priv;
-};
-
-struct _TimezoneCompletionClass {
- GtkEntryCompletionClass parent_class;
-};
-
-#define TIMEZONE_COMPLETION_ZONE 0
-#define TIMEZONE_COMPLETION_NAME 1
-#define TIMEZONE_COMPLETION_ADMIN1 2
-#define TIMEZONE_COMPLETION_COUNTRY 3
-#define TIMEZONE_COMPLETION_LONGITUDE 4
-#define TIMEZONE_COMPLETION_LATITUDE 5
-#define TIMEZONE_COMPLETION_LAST 6
-
-GType timezone_completion_get_type (void) G_GNUC_CONST;
-TimezoneCompletion * timezone_completion_new ();
-void timezone_completion_watch_entry (TimezoneCompletion * completion, GtkEntry * entry);
-
-G_END_DECLS
-
-#endif /* __TIMEZONE_COMPLETION_H__ */
-