diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2010-07-16 13:54:20 +1000 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2010-07-16 13:54:20 +1000 |
commit | 0aa8853161890069528ed10b8ecc22b4690569fa (patch) | |
tree | ace9e428643c2380271b3af0debbc8c47f9c20bd | |
parent | fbb4f0aa1ccd2d9ee53fbca918b161859740891d (diff) |
Convert GConf schema to GSettings schema
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | data/Makefile.am | 25 | ||||
-rw-r--r-- | data/org.freedesktop.Telepathy.Logger.gschema.xml.in | 20 | ||||
-rw-r--r-- | data/telepathy-logger.schemas | 32 | ||||
-rw-r--r-- | m4/gsettings.m4 | 93 |
6 files changed, 126 insertions, 52 deletions
@@ -48,6 +48,8 @@ Makefile.in /data/*.client /data/*.service +/data/org.freedesktop.Telepathy.Logger.gschema.valid +/data/org.freedesktop.Telepathy.Logger.gschema.xml /doc/reference/libtelepathy-logger/*.stamp /doc/reference/libtelepathy-logger/*.bak diff --git a/configure.ac b/configure.ac index c1c77a3..1e9688f 100644 --- a/configure.ac +++ b/configure.ac @@ -66,7 +66,7 @@ AC_COPYRIGHT([ ]) # Minimal version required -GLIB_REQUIRED=2.22.0 +GLIB_REQUIRED=2.25.11 DBUS_REQUIRED=1.1.0 DBUS_GLIB_REQUIRED=0.82 TELEPATHY_GLIB_REQUIRED=0.11.7 @@ -93,8 +93,7 @@ AC_PATH_XTRA IT_PROG_INTLTOOL([0.35.0]) GNOME_DOC_INIT([0.17.3]) AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool) -AC_PATH_PROG(GCONFTOOL, gconftool-2) -AM_GCONF_SOURCE_2 +GLIB_GSETTINGS GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal` AC_SUBST(GLIB_GENMARSHAL) @@ -159,7 +158,6 @@ AC_SUBST(ERROR_CFLAGS) # ----------------------------------------------------------- LIBTPL_MODULES=""" - gconf-2.0 gio-2.0 glib-2.0 >= $GLIB_REQUIRED gobject-2.0 diff --git a/data/Makefile.am b/data/Makefile.am index 07608da..179e08f 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,5 +1,9 @@ -schemasdir = $(GCONF_SCHEMA_FILE_DIR) -schemas_DATA = telepathy-logger.schemas +gsettings_files = \ + org.freedesktop.Telepathy.Logger.gschema.xml.in \ + $(NULL) +gsettings_SCHEMAS = $(gsettings_files:.xml.in=.xml) +@INTLTOOL_XML_NOMERGE_RULE@ +@GSETTINGS_RULES@ servicefiledir = $(datadir)/dbus-1/services servicefile_in_files = \ @@ -12,22 +16,11 @@ servicefile_DATA = $(servicefile_in_files:.service.in=.service) clientfiledir = $(datarootdir)/telepathy/clients clientfile_DATA = Logger.client -if GCONF_SCHEMAS_INSTALL -install-data-local: - if test -z "$(DESTDIR)" ; then \ - for p in $(schemas_DATA) ; do \ - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p ; \ - done \ - fi -else -install-data-local: -endif - EXTRA_DIST = \ - $(schemas_in_files) \ - $(schemas_DATA) \ + $(gsettings_files) \ $(clientfile_DATA) \ $(servicefile_in_files) -CLEANFILES = \ +CLEANFILES = \ + $(gsettings_SCHEMAS) \ $(servicefile_DATA) diff --git a/data/org.freedesktop.Telepathy.Logger.gschema.xml.in b/data/org.freedesktop.Telepathy.Logger.gschema.xml.in new file mode 100644 index 0000000..a7ecac6 --- /dev/null +++ b/data/org.freedesktop.Telepathy.Logger.gschema.xml.in @@ -0,0 +1,20 @@ +<schemalist> + <schema id="org.freedesktop.Telepathy.Logger" path="/apps/telepathy-logger/"> + <key name="enabled" type="b"> + <default>true</default> + <_summary>Enable logging</_summary> + <_description> + Globally enable or disable the Telepathy logger system. Setting it to + "false" will completely disable all logging. + </_description> + </key> + <key name="ignore-accounts" type="ao"> + <default>[]</default> + <_summary>Accounts for which logging is disabled</_summary> + <_description> + Disables logging for the named accounts, even when logging is globally + enabled. Object paths are Telepathy Account objects. + </_description> + </key> + </schema> +</schemalist> diff --git a/data/telepathy-logger.schemas b/data/telepathy-logger.schemas deleted file mode 100644 index 6f9b575..0000000 --- a/data/telepathy-logger.schemas +++ /dev/null @@ -1,32 +0,0 @@ -<gconfschemafile> - <schemalist> - - <schema> - <key>/schemas/apps/telepathy-logger/logging/turned_on</key> - <applyto>/apps/telepathy-logger/logging/turned_on</applyto> - <owner>telepathy-logger</owner> - <type>bool</type> - <default>TRUE</default> - <locale name="C"> - <short>Turn on/off logging</short> - <long>Globally enable or disable the telepathy logging system. -Setting it to "false" will completely disable any logging facility (it won't shut down the service)</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/telepathy-logger/logging/accounts/ignorelist</key> - <applyto>/apps/telepathy-logger/logging/accounts/ignorelist</applyto> - <owner>telepathy-logger</owner> - <type>list</type> - <list_type>string</list_type> - <default>[]</default> - <locale name="C"> - <short>A list of accounts for which logging is disabled</short> - <long>Disables logging for the named accounts, when logging is -globally enabled. Meaningful only if global logging is turned on/enabled</long> - </locale> - </schema> - -</schemalist> -</gconfschemafile> diff --git a/m4/gsettings.m4 b/m4/gsettings.m4 new file mode 100644 index 0000000..ac9945e --- /dev/null +++ b/m4/gsettings.m4 @@ -0,0 +1,93 @@ +dnl GLIB_GSETTINGS +dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether +dnl the schema should be compiled +dnl + +AC_DEFUN([GLIB_GSETTINGS], +[ + m4_pattern_allow([AM_V_GEN]) + AC_ARG_ENABLE(schemas-compile, + AC_HELP_STRING([--disable-schemas-compile], + [Disable regeneration of gschemas.compiled on install]), + [case ${enableval} in + yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;; + no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;; + esac]) + AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE]) + PKG_PROG_PKG_CONFIG([0.16]) + AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas]) + if test x$cross_compiling != xyes; then + GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0` + else + AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas) + fi + AC_SUBST(GLIB_COMPILE_SCHEMAS) + if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then + ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2]) + else + ifelse([$1],,[:],[$1]) + fi + + GSETTINGS_RULES=' +.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas + +mostlyclean-am: clean-gsettings-schemas + +gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE)) + +%.gschema.valid: %.gschema.xml $(gsettings__enum_file) + $(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@ + +all-am: $(gsettings_SCHEMAS:.xml=.valid) +uninstall-am: uninstall-gsettings-schemas +install-data-am: install-gsettings-schemas + +.SECONDARY: $(gsettings_SCHEMAS) + +gsettings__base_list = \ + sed "$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g" | \ + sed "$$!N;$$!N;$$!N;$$!N;s/\n/ /g" + +install-gsettings-schemas: $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file) + @$(NORMAL_INSTALL) + test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)" + @list='\''$(gsettings__enum_file) $(gsettings_SCHEMAS)'\''; test -n "$(gsettingsschemadir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(gsettings__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '\''$(DESTDIR)$(gsettingsschemadir)'\''"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(gsettingsschemadir)" || exit $$?; \ + done + test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir) + +uninstall-gsettings-schemas: + @$(NORMAL_UNINSTALL) + @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files + test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir) + +clean-gsettings-schemas: + rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file) + +ifdef gsettings_ENUM_NAMESPACE +$(gsettings__enum_file): $(gsettings_ENUM_FILES) + $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail " </@type@>" --ftail "</schemalist>" $(gsettings_ENUM_FILES) > [$]@.tmp && mv [$]@.tmp [$]@ +endif +' + _GSETTINGS_SUBST(GSETTINGS_RULES) +]) + +dnl _GSETTINGS_SUBST(VARIABLE) +dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST +AC_DEFUN([_GSETTINGS_SUBST], +[ +AC_SUBST([$1]) +m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) +] +) |