[Xfce4-commits] <xfconf:signal-bindings> Merge branch 'master' into signal-bindings
Nick Schermer
noreply at xfce.org
Sat Sep 26 13:26:01 CEST 2009
Updating branch refs/heads/signal-bindings
to 9dbeb372a154415b5273ba17e95868d8d1937a72 (commit)
from c70ded58be9a196c06853d09f9f1e9e973177b0f (commit)
commit 9dbeb372a154415b5273ba17e95868d8d1937a72
Author: Nick Schermer <nick at xfce.org>
Date: Thu Sep 24 20:05:18 2009 +0200
Merge branch 'master' into signal-bindings
autogen.sh | 32 +------------
configure.ac.in | 50 +++++--------------
docs/reference/Makefile.am | 6 ++-
docs/reference/tmpl/xfconf-channel.sgml | 5 ++
po/lv.po | 32 ++++++------
po/{xfconf.pot => sk.po} | 63 ++++++++++++------------
tests/Makefile.inc | 3 +-
tests/test-template.sh.in | 35 ++++++++++++--
tests/tests-common.h | 15 ------
xfconf-query/main.c | 18 +++---
xfconf/Makefile.am | 6 ++-
xfconf/xfconf-cache.c | 82 +++++++++++++++++++++++++++++--
xfconfd/main.c | 23 ++++++++-
13 files changed, 215 insertions(+), 155 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 170897e..126c86b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -18,36 +18,6 @@ EOF
exit 1
}
-# verify that po/LINGUAS is present
-(test -f po/LINGUAS) >/dev/null 2>&1 || {
- cat >&2 <<EOF
-autogen.sh: The file po/LINGUAS could not be found. Please check your snapshot
- or try to checkout again.
-EOF
- exit 1
-}
-
-echo 'dnl *** This file is automatically generated from configure.ac.in ***' \
- >configure.ac
-echo 'dnl *** DO NOT EDIT! ***' >>configure.ac
-echo >>configure.ac
-
-# substitute revision and linguas
-linguas=$(sed -e '/^#/d' po/LINGUAS)
-if [ -d .git/svn ]; then
- revision=$(git svn find-rev trunk 2>/dev/null ||
- git svn find-rev origin/trunk 2>/dev/null ||
- git svn find-rev HEAD 2>/dev/null ||
- git svn find-rev master 2>/dev/null)
-elif [ -d .svn ]; then
- revision=$(LC_ALL=C svn info $0 | awk '/^Revision: / {printf "%05d\n", $2}')
-else
- revision=UNKNOWN
-fi
-sed -e "s/@LINGUAS@/${linguas}/g" \
- -e "s/@REVISION@/${revision}/g" \
- < "configure.ac.in" >> "configure.ac"
-
-xdt-autogen $@
+XDT_AUTOGEN_REQUIRED_VERSION=4.7.2 xdt-autogen $@
# vi:set ts=2 sw=2 et ai:
diff --git a/configure.ac.in b/configure.ac.in
index 02736db..dde86cc 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -12,9 +12,11 @@ m4_define([xfconf_version_major], [4])
m4_define([xfconf_version_minor], [7])
m4_define([xfconf_version_micro], [0])
m4_define([xfconf_version_nano], [])
-m4_define([xfconf_version_build], [r at REVISION@])
-m4_define([xfconf_version_tag], [svn])
-m4_define([xfconf_version], [xfconf_version_major().xfconf_version_minor().xfconf_version_micro()ifelse(xfconf_version_nano(), [], [], [.xfconf_version_nano()])ifelse(xfconf_version_tag(), [svn], [xfconf_version_tag()-xfconf_version_build()], [xfconf_version_tag()])])
+m4_define([xfconf_version_build], [@REVISION@])
+m4_define([xfconf_version_tag], [git])
+m4_define([xfconf_version], [xfconf_version_major().xfconf_version_minor().xfconf_version_micro()ifelse(xfconf_version_nano(), [], [], [.xfconf_version_nano()])ifelse(xfconf_version_tag(), [git], [xfconf_version_tag()-xfconf_version_build()], [xfconf_version_tag()])])
+
+m4_define([xfconf_default_debug], [ifelse(xfconf_version_tag(), [git], [yes], [minimum])])
dnl init autoconf
AC_INIT([xfconf], [xfconf_version], [http://bugzilla.xfce.org/])
@@ -154,12 +156,10 @@ if test "x$xfconf_backend_perchannel_xml" = "xyes"; then
fi
dnl check for debugging support
-XDT_FEATURE_DEBUG
-dnl if test "x$enable_debug" = "xfull"; then
-dnl if test "x$CC" = "xgcc"; then
-dnl CFLAGS="$CFLAGS -fno-strict-aliasing"
-dnl fi
-dnl fi
+XDT_FEATURE_DEBUG([xfconf_default_debug])
+dnl gtk-doc is broken
+XDT_SUPPORTED_FLAGS([GTK_DOC_EXTRA_CFLAGS], [-Wno-sign-compare])
+AC_SUBST([GTK_DOC_EXTRA_CFLAGS])
AC_ARG_ENABLE([checks],
AC_HELP_STRING([--enable-checks],
@@ -171,34 +171,10 @@ if test "x$enable_checks" = "xyes"; then
fi
dnl check whether the compiler supports the visibility attribute
-AC_ARG_ENABLE([visibility],
- AC_HELP_STRING([--disable-visibility],
- [Don't use ELF visibility attributes]),
- [], [enable_visibility=yes])
-have_gnuc_visibility=no
-if test "x$enable_visibility" != "xno"; then
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Wall -Werror"
- AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
- AC_COMPILE_IFELSE(AC_LANG_SOURCE(
- [
- void __attribute__ ((visibility("default"))) test_default (void) {}
- void __attribute__ ((visibility("hidden"))) test_hidden (void) {}
- int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
- ]),
- [
- have_gnuc_visibility=yes
- AC_MSG_RESULT([yes])
- ],
- [
- AC_MSG_RESULT([no])
- ])
- CFLAGS="$save_CFLAGS"
-fi
-if test "x$have_gnuc_visibility" = "xyes"; then
- CPPFLAGS="$CPPFLAGS -DHAVE_GNUC_VISIBILITY"
-fi
-AM_CONDITIONAL([HAVE_GNUC_VISIBILITY], [test "x$have_gnuc_visibility" = "xyes"])
+XDT_FEATURE_VISIBILITY
+
+dnl add -O1 and --as-needed to LDFLAGS if supported
+XDT_FEATURE_LINKER_OPTS
AC_ARG_ENABLE([profiling],
AC_HELP_STRING([--enable-profiling],
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 1b22f66..510d7f5 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -58,7 +58,8 @@ INCLUDES = \
$(GLIB_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(DBUS_CFLAGS) \
- $(DBUS_GLIB_CFLAGS)
+ $(DBUS_GLIB_CFLAGS) \
+ $(GTK_DOC_EXTRA_CFLAGS)
GTKDOC_LIBS = \
$(top_builddir)/xfconf/libxfconf-$(LIBXFCONF_VERSION_API).la \
@@ -78,4 +79,7 @@ if MAINTAINER_MODE
xsltproc -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
endif
+# required for gtk-doc
+dist-hook: all
+
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/docs/reference/tmpl/xfconf-channel.sgml b/docs/reference/tmpl/xfconf-channel.sgml
index 44b5451..bf16414 100644
--- a/docs/reference/tmpl/xfconf-channel.sgml
+++ b/docs/reference/tmpl/xfconf-channel.sgml
@@ -40,6 +40,11 @@ configuration keys with the same names.
</para>
+<!-- ##### ARG XfconfChannel:is-singleton ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG XfconfChannel:property-base ##### -->
<para>
diff --git a/po/lv.po b/po/lv.po
index 98fb44c..7405991 100644
--- a/po/lv.po
+++ b/po/lv.po
@@ -1,22 +1,23 @@
# xconf Latvian Translation.
# Copyright (C) 2009 Xfce team
# This file is distributed under the same license as the xconf package.
-# Rihards Prieditis <rprieditis at gmail.com>, 2009.
#
+# Rihards Prieditis <rprieditis at gmail.com>, 2009.
msgid ""
msgstr ""
"Project-Id-Version: xconf\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-04-07 23:25+0200\n"
-"PO-Revision-Date: 2009-05-03 15:25+0300\n"
-"Last-Translator: Rihards Priedītis <rprieditis at gmail.com>\n"
-"Language-Team: latvian <rprieditis at gmail.com>\n"
+"PO-Revision-Date: 2009-09-18 18:27+0100\n"
+"Last-Translator: Rihards Prieditis <rprieditis at gmail.com>\n"
+"Language-Team: Latvian <translation-team-lv at lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n"
"X-Poedit-Language: Latvian\n"
"X-Poedit-Country: Latvia\n"
+"X-Generator: Lokalize 1.0\n"
#: xfconfd/xfconf-backend-perchannel-xml.c:280
#, c-format
@@ -45,23 +46,23 @@ msgstr "NeizdevÄs noÅemt kanÄlu \"%s\": %s"
#: xfconfd/xfconf-backend-perchannel-xml.c:1293
#, c-format
msgid "Invalid type for <property>: \"%s\""
-msgstr "Nederīgs tips priekš <īpašības>: \"%s\""
+msgstr "Nederīgs tips priekš <property>: \"%s\""
#: xfconfd/xfconf-backend-perchannel-xml.c:1309
#: xfconfd/xfconf-backend-perchannel-xml.c:1385
#, c-format
msgid "Unable to parse value of type \"%s\" from \"%s\""
-msgstr "NevarÄja parsÄt vÄrtibas tipu \"%s\" no \"%s\""
+msgstr "NevarÄja parsÄt vÄrtÄ«bas tipu \"%s\" no \"%s\""
#: xfconfd/xfconf-backend-perchannel-xml.c:1365
#, c-format
msgid "The type attribute of <value> cannot be an array"
-msgstr "Tipa atribÅ«ts <vÄrtÄ«ba> nevar bÅ«t masivs"
+msgstr "Tipa atribūts <value> nevar būt masīvs"
#: xfconfd/xfconf-backend-perchannel-xml.c:1374
#, c-format
msgid "Invalid type for <value>: \"%s\""
-msgstr "NederÄ«gs tips priekÅ¡ <vÄrtÄ«bas>: \"%s\""
+msgstr "Nederīgs tips priekš <value>: \"%s\""
#: xfconfd/xfconf-backend-perchannel-xml.c:1662
#: xfconfd/xfconf-backend-perchannel-xml.c:1907
@@ -92,7 +93,7 @@ msgstr "Saknes elements (\"/\") nav derīgs īpašības nosaukums"
#: xfconfd/xfconf-backend.c:126
#, c-format
msgid "Property names can only include the ASCII characters A-Z, a-z, 0-9, '_', '-', '<' and '>', as well as '/' as a separator"
-msgstr "ĪpaÅ¡Ä«bas nosaukumos var iekļaut tikai ASCII rakstzÄ«mes A-Z, a-z, 0-9, '_', '-', '<' un '>', kÄ arÄ« '/', kÄ atdalÄ«tÄju"
+msgstr "ĪpaÅ¡Ä«bas nosaukumos var iekļaut tikai ASCII rakstzÄ«mes A-Z, a-z, 0-9, '_', '-', '<' and '>', kÄ arÄ« '/', kÄ atdalÄ«tÄju"
#: xfconfd/xfconf-backend.c:135
#, c-format
@@ -117,7 +118,7 @@ msgstr "KanÄla nosaukumos var lietot tikai ASCII rakstzÄ«mes A-Z, a-z, 0-9, '_'
#: xfconfd/xfconf-backend.c:398
#, c-format
msgid "The property name can only be empty or \"/\" if a recursive reset was specified"
-msgstr "ĪpaÅ¡Ä«bas nosaukums nevar bÅ«t tukÅ¡s, vai \"/\", ja rekursÄ«vÄ atiestatÄ«Å¡ana norÄdÄ«ta"
+msgstr "ĪpaÅ¡Ä«bas nosaukums nevar bÅ«t tukÅ¡s, vai \"/\", ja rekursÄ«vÄ atstatÄ«Å¡ana norÄdÄ«ta"
#: xfconfd/main.c:132
msgid "Prints the xfconfd version."
@@ -125,7 +126,7 @@ msgstr "IzdrukÄt xconfd versiju."
#: xfconfd/main.c:134
msgid "Configuration backends to use. The first backend specified is opened read/write; the others, read-only."
-msgstr "Kuru konfigurÄcijas aizmuguri izmantot. PirmÄ norÄdÄ«tÄ aizmugure tiek atvÄrta rakstÄ«t/lasÄ«tl; citas tikai lasÄ«t."
+msgstr "Kuru konfigurÄcijas aizmuguri izmantot. PirmÄ norÄdÄ«tÄ aizmugure tiek atvÄrta rakstÄ«t/lasÄ«t; citas tikai lasÄ«t."
#: xfconfd/main.c:154
msgid "Xfce Configuration Daemon"
@@ -133,11 +134,11 @@ msgstr "Xfce konfigurÄcijas dÄmons"
#: xfconfd/main.c:160
msgid "Xfce configuration daemon"
-msgstr "Xfgce konfigurÄcijas dÄmons"
+msgstr "Xfce konfigurÄcijas dÄmons"
#: xfconfd/main.c:162
msgid "Report bugs to http://bugs.xfce.org/\n"
-msgstr "ZiÅot par kļudÄm uz http://bugs.xfce.org/\n"
+msgstr "ZiÅot par kļūdÄm uz http://bugs.xfce.org/\n"
#: xfconfd/main.c:165
#, c-format
@@ -213,7 +214,7 @@ msgstr "NorÄdiet Ä«paÅ¡Ä«bas vÄrtÄ«bas tipu"
#: xfconf-query/main.c:223
msgid "Reset property"
-msgstr "Atiestatīt īpašību"
+msgstr "Atstatīt īpašību"
#: xfconf-query/main.c:227
msgid "Recursive (use with -r)"
@@ -323,3 +324,4 @@ msgstr "NevarÄja atvÄrt importa failu \"%s\": %s\n"
msgid "Could not parse import file \"%s\": %s\n"
msgstr "NevarÄja parsÄt importa failu \"%s\": %s\n"
+
diff --git a/po/xfconf.pot b/po/sk.po
similarity index 82%
copy from po/xfconf.pot
copy to po/sk.po
index d49939f..33710a9 100644
--- a/po/xfconf.pot
+++ b/po/sk.po
@@ -1,25 +1,24 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
-#
+# Slovak translations for Xfconf package.
+# Copyright (C) 2008 xfconf's Stephan Arts, Brian Tarricone
+# This file is distributed under the same license as the Xfconf package.
+# Robert Hartl <hartl.robert at gmail.com>, 2009.
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
+"Project-Id-Version: 4.6.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-04-07 23:25+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
-"Language-Team: LANGUAGE <LL at li.org>\n"
+"PO-Revision-Date: 2009-09-17 20:09+0200\n"
+"Last-Translator: Robert Hartl <hartl.robert at gmail.com>\n"
+"Language-Team: slovak <sk-i18n at lists.linux.sk>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
#: xfconfd/xfconf-backend-perchannel-xml.c:280
#, c-format
msgid "Unable to create configuration directory \"%s\""
-msgstr ""
+msgstr "Nedá sa vytvoriť adresár konfigurácie \"%s\""
#: xfconfd/xfconf-backend-perchannel-xml.c:328 xfconfd/xfconf-daemon.c:244
#, c-format
@@ -64,27 +63,27 @@ msgstr ""
#: xfconfd/xfconf-backend-perchannel-xml.c:1907
#, c-format
msgid "Channel \"%s\" does not exist"
-msgstr ""
+msgstr "Kánal \"%s\" neexistuje"
#: xfconfd/xfconf-backend-perchannel-xml.c:1965
#, c-format
msgid "Unable to write channel \"%s\": %s"
-msgstr ""
+msgstr "Nemožno zapÃsaÅ¥ kanál \"%s\": %s"
#: xfconfd/xfconf-backend-factory.c:75
#, c-format
msgid "Unable to find Xfconf backend of type \"%s\""
-msgstr ""
+msgstr "Nedá sa nájsť backend Xfconf typu \"%s\""
#: xfconfd/xfconf-backend.c:103
#, c-format
msgid "Property names must start with a '/' character"
-msgstr ""
+msgstr "Názvy vlastnostà musia zaÄÃnaÅ¥ znakom '/'"
#: xfconfd/xfconf-backend.c:112
#, c-format
msgid "The root element ('/') is not a valid property name"
-msgstr ""
+msgstr "KoreÅový element ('/') nie je platný názov vlastnosti"
#: xfconfd/xfconf-backend.c:126
#, c-format
@@ -101,12 +100,12 @@ msgstr ""
#: xfconfd/xfconf-backend.c:146
#, c-format
msgid "Property names cannot end with a '/' character"
-msgstr ""
+msgstr "Názvy vlastnostà nemôžu konÄiÅ¥ znakom '/'"
#: xfconfd/xfconf-backend.c:163
#, c-format
msgid "Channel name cannot be an empty string"
-msgstr ""
+msgstr "Názov kanála nemôže byť prázdny reťazec"
#: xfconfd/xfconf-backend.c:176
#, c-format
@@ -124,7 +123,7 @@ msgstr ""
#: xfconfd/main.c:132
msgid "Prints the xfconfd version."
-msgstr ""
+msgstr "Zobrazà verziu xfconfd"
#: xfconfd/main.c:134
msgid ""
@@ -134,25 +133,25 @@ msgstr ""
#: xfconfd/main.c:154
msgid "Xfce Configuration Daemon"
-msgstr ""
+msgstr "KonfiguraÄný démon Xfce"
#: xfconfd/main.c:160
msgid "Xfce configuration daemon"
-msgstr ""
+msgstr "KonfiguraÄný démon Xfce"
#: xfconfd/main.c:162
msgid "Report bugs to http://bugs.xfce.org/\n"
-msgstr ""
+msgstr "Chyby hláste na http://bugs.xfce.org/\n"
#: xfconfd/main.c:165
#, c-format
msgid "Error parsing options: %s\n"
-msgstr ""
+msgstr "Chyba pri analýze volieb: %s\n"
#: xfconfd/xfconf-daemon.c:460
#, c-format
msgid "Another Xfconf daemon is already running"
-msgstr ""
+msgstr "Už je spustený iný démon služby Xfconf"
#: xfconfd/xfconf-daemon.c:496
#, c-format
@@ -162,17 +161,17 @@ msgstr ""
#: xfconf-query/main.c:92
#, c-format
msgid "Property '%s' changed: %s\n"
-msgstr ""
+msgstr "Vlastnosť '%s' bola zmenená: %s\n"
#: xfconf-query/main.c:97
#, c-format
msgid "Property '%s' changed\n"
-msgstr ""
+msgstr "Vlastnosť '%s' bola zmenená\n"
#: xfconf-query/main.c:102
#, c-format
msgid "Property '%s' removed\n"
-msgstr ""
+msgstr "Vlastnosť '%s' bola odstránená\n"
#: xfconf-query/main.c:111
#, c-format
@@ -186,7 +185,7 @@ msgstr ""
#: xfconf-query/main.c:191
msgid "Version information"
-msgstr ""
+msgstr "Informácie o verzii"
#: xfconf-query/main.c:195
msgid "The channel to query/modify"
@@ -206,7 +205,7 @@ msgstr ""
#: xfconf-query/main.c:211
msgid "Verbose output"
-msgstr ""
+msgstr "Podrobný výstup"
#: xfconf-query/main.c:215
msgid "Create a new property if it does not already exist"
@@ -222,7 +221,7 @@ msgstr ""
#: xfconf-query/main.c:227
msgid "Recursive (use with -r)"
-msgstr ""
+msgstr "RekurzÃvne (použiÅ¥ s parametrom -r)"
#: xfconf-query/main.c:231
msgid "Force array even if only one element"
@@ -244,7 +243,7 @@ msgstr ""
#: xfconf-query/main.c:379 xfconf-query/main.c:397
msgid "(unknown)"
-msgstr ""
+msgstr "(neznámy)"
#: xfconf-query/main.c:388
#, c-format
diff --git a/tests/Makefile.inc b/tests/Makefile.inc
index 408b15f..59fda73 100644
--- a/tests/Makefile.inc
+++ b/tests/Makefile.inc
@@ -1,10 +1,9 @@
check_SCRIPTS = $(addsuffix .sh,$(check_PROGRAMS))
TESTS = $(check_SCRIPTS)
-TESTS_ENVIRONMENT = XDG_CONFIG_HOME="$(top_builddir)/tests/test-xdg_config_home"
+TESTS_ENVIRONMENT = XDG_CONFIG_HOME="$(top_builddir)/tests/test-xdg_config_home" XFCONFD="$(top_builddir)/xfconfd/xfconfd"
AM_CFLAGS = \
- -DXFCONFD=\"$(top_builddir)/xfconfd/xfconfd\" \
-I$(top_srcdir) \
-I$(top_srcdir)/tests \
$(GLIB_CFLAGS) \
diff --git a/tests/test-template.sh.in b/tests/test-template.sh.in
index c1753a2..5d2a3a6 100644
--- a/tests/test-template.sh.in
+++ b/tests/test-template.sh.in
@@ -1,15 +1,42 @@
#!/bin/bash
+cleanup() {
+ if [ "$XFCONFD_PID" ]; then
+ kill -TERM $XFCONFD_PID 2>/dev/null
+ sleep 1
+ kill -KILL $XFCONFD_PID 2>/dev/null
+ fi
+
+ kill -TERM $DBUS_SESSION_BUS_PID 2>/dev/null
+ sleep 1
+ kill -KILL $DBUS_SESSION_BUS_PID 2>/dev/null
+}
+
+die() {
+ [ "$1" ] && echo "$1" >&2
+ cleanup
+ exit 1
+}
+
+unset DBUS_SESSION_BUS_ADDRESS
+unset DBUS_SESSION_BUS_PID
+unset XFCONFD_PID
+
eval `dbus-launch --sh-syntax`
export DBUS_SESSION_BUS_ADDRESS
export DBUS_SESSION_BUS_PID
+[ "$DBUS_SESSION_BUS_PID" ] || die "DBus failed to start"
+
+trap "die Interrupted" INT
+
+eval `$XFCONFD --daemon 2>/dev/null` || die "Failed to start xfconfd"
+
export XDG_CONFIG_HOME # make sure it's exported from the makefile
export XDG_CONFIG_DIRS=""
-./@TEST_NAME@
-ret=$?
+./@TEST_NAME@ || die "Test Failed"
-kill -TERM $DBUS_SESSION_BUS_PID
+cleanup
-exit $ret
+exit 0
diff --git a/tests/tests-common.h b/tests/tests-common.h
index 6ab0710..da526e9 100644
--- a/tests/tests-common.h
+++ b/tests/tests-common.h
@@ -55,8 +55,6 @@
} \
}G_STMT_END
-static GPid xfconfd_pid = -1;
-
/* don't use static to avoid compiler warnings in tests that don't use
* all of them */
const gchar *test_string_property = "/test/stringtest/string";
@@ -78,19 +76,12 @@ static void xfconf_tests_end(void);
static gboolean
xfconf_tests_start(void)
{
- gchar *argv[2] = { XFCONFD, NULL };
DBusConnection *dbus_conn;
DBusMessage *msg, *ret;
DBusError derror;
GTimeVal start, now;
GError *error = NULL;
- if(!g_spawn_async(NULL, argv, NULL, 0, NULL, NULL, &xfconfd_pid, &error)) {
- g_critical("Failed to launch xfconfd (%s): %s", XFCONFD, error->message);
- g_error_free(error);
- return FALSE;
- }
-
/* wait until xfconfd finishes starting */
dbus_error_init(&derror);
dbus_conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
@@ -135,12 +126,6 @@ static void
xfconf_tests_end(void)
{
xfconf_shutdown();
-
- if(xfconfd_pid != -1) {
- kill(xfconfd_pid, SIGTERM);
- waitpid(xfconfd_pid, NULL, 0);
- xfconfd_pid = -1;
- }
}
#endif /* __XFCONF_TESTS_COMMON_H__ */
diff --git a/xfconf-query/main.c b/xfconf-query/main.c
index a2b306f..fd6bdc4 100644
--- a/xfconf-query/main.c
+++ b/xfconf-query/main.c
@@ -277,13 +277,13 @@ main(int argc, char **argv)
if(!g_option_context_parse(context, &argc, &argv, &cli_error))
{
- g_print("option parsing failed: %s\n", cli_error->message);
+ g_printerr("option parsing failed: %s\n", cli_error->message);
return 1;
}
if(version)
{
- g_print("xfconf-query %s\n", PACKAGE_VERSION);
+ g_print("xfconf-query %s\n", PACKAGE_VERSION);
return 0;
}
@@ -309,31 +309,31 @@ main(int argc, char **argv)
/** Check if the property is specified */
if(!property_name && !list && !export_file && !import_file && !monitor)
{
- g_print("No property specified, aborting...\n");
+ g_printerr("No property specified, aborting...\n");
return 1;
}
if (create && reset)
{
- g_print("--create and --reset options can not be used together,\naborting...\n");
+ g_printerr("--create and --reset options can not be used together,\naborting...\n");
return 1;
}
if ((create || reset) && (list))
{
- g_print("--create and --reset options can not be used together with\n --list\naborting...\n");
+ g_printerr("--create and --reset options can not be used together with\n --list\naborting...\n");
return 1;
}
if (import_file && export_file)
{
- g_print("--import and --export options can not be used together,\naborting...\n");
+ g_printerr("--import and --export options can not be used together,\naborting...\n");
return 1;
}
if ((import_file || export_file) && (list || property_name || create || reset))
{
- g_print("--import and --export options can not be used together with\n --create, --reset, --property and --list,\naborting...\n");
+ g_printerr("--import and --export options can not be used together with\n --create, --reset, --property and --list,\naborting...\n");
return 1;
}
@@ -368,8 +368,8 @@ main(int argc, char **argv)
if(!xfconf_channel_get_property(channel, property_name, &value))
{
- g_print(_("Property \"%s\" does not exist on channel \"%s\".\n"),
- property_name, channel_name);
+ g_printerr(_("Property \"%s\" does not exist on channel \"%s\".\n"),
+ property_name, channel_name);
return 1;
}
diff --git a/xfconf/Makefile.am b/xfconf/Makefile.am
index b7382eb..1db6a77 100644
--- a/xfconf/Makefile.am
+++ b/xfconf/Makefile.am
@@ -13,7 +13,7 @@ libxfconf_0_la_SOURCES = \
$(libxfconfinclude_HEADERS) \
xfconf-binding.c \
xfconf-cache.c \
- xfconc-cache.h \
+ xfconf-cache.h \
xfconf-channel.c \
xfconf-dbus-bindings.h \
xfconf-private.h \
@@ -70,7 +70,9 @@ CLEANFILES = \
endif
-
EXTRA_DIST = \
abicheck.sh \
xfconf.symbols
+
+# required for gtk-doc
+dist-hook: all
diff --git a/xfconf/xfconf-cache.c b/xfconf/xfconf-cache.c
index 67f9edb..31fca97 100644
--- a/xfconf/xfconf-cache.c
+++ b/xfconf/xfconf-cache.c
@@ -436,8 +436,8 @@ xfconf_cache_property_removed(DBusGProxy *proxy,
g_tree_remove(cache->properties, property);
- g_signal_emit(G_OBJECT(cache), signals[SIG_PROPERTY_CHANGED],
- g_quark_from_string(property), property, &value);
+ g_signal_emit(G_OBJECT(cache), signals[SIG_PROPERTY_CHANGED], 0,
+ cache->channel_name, property, &value);
}
@@ -484,7 +484,7 @@ xfconf_cache_set_property_reply_handler(DBusGProxy *proxy,
if(old_item->item)
xfconf_cache_item_update(item, &old_item->item->value);
else {
- g_tree_remove(cache->properties, item);
+ g_tree_remove(cache->properties, old_item->property);
item = NULL;
}
@@ -506,6 +506,7 @@ out:
+#if 0
static void
xfconf_cache_reset_property_reply_handler(DBusGProxy *proxy,
DBusGProxyCall *call,
@@ -535,6 +536,7 @@ out:
xfconf_cache_mutex_unlock(&cache->cache_lock);
}
+#endif
static void
xfconf_cache_destroyed(gpointer data,
@@ -794,17 +796,42 @@ xfconf_cache_set(XfconfCache *cache,
return TRUE;
}
+typedef struct
+{
+ gchar *property_base;
+ gsize property_base_len;
+ GSList *matches;
+} XfconfCacheRecurseData;
+
+static gboolean
+xfconf_cache_collect_properties_recursive(gpointer key,
+ gpointer value,
+ gpointer user_data)
+{
+ gchar *property_name = key;
+ XfconfCacheRecurseData *rdata = user_data;
+
+ if(!g_ascii_strncasecmp(rdata->property_base, property_name, rdata->property_base_len))
+ rdata->matches = g_slist_prepend(rdata->matches, property_name);
+
+ return FALSE;
+}
+
gboolean
xfconf_cache_reset(XfconfCache *cache,
const gchar *property_base,
gboolean recursive,
GError **error)
{
+ gboolean ret = FALSE;
DBusGProxy *proxy = _xfconf_get_dbus_g_proxy();
+#if 0
XfconfCacheOldItem *old_item = NULL;
+#endif
xfconf_cache_mutex_lock(&cache->cache_lock);
+#if 0
/* it's not really feasible here to look up all the old/new values
* here, so we're just gonna rely on the normal signals from the
* daemon to notify us of changes */
@@ -819,11 +846,56 @@ xfconf_cache_reset(XfconfCache *cache,
G_TYPE_STRING, property_base,
G_TYPE_BOOLEAN, recursive,
G_TYPE_INVALID);
- g_hash_table_insert(cache->pending_calls, old_item->call, old_item);
+ if(old_item->call) {
+ g_hash_table_insert(cache->pending_calls, old_item->call, old_item);
+ ret = TRUE;
+ } else {
+ if(error) {
+ g_set_error(error, DBUS_GERROR, DBUS_GERROR_FAILED,
+ _("Failed to make ResetProperty DBus call"));
+ }
+ }
+#else
+ /* unfortunately, doing the above asynchronously makes
+ * xfconf_channel_has_property() break, because we have no idea at
+ * this point if a reset is going to remove the property or reset
+ * it to a default. so, we have to do this sync. sad. */
+
+ ret = xfconf_client_reset_property(proxy, cache->channel_name,
+ property_base, recursive, error);
+
+ if(ret) {
+ /* here we just evict the entry from the cache if we have one.
+ * unfortunately i think it's the best we can do here. this is
+ * pretty slow because we have to traverse the entire tree if
+ * recursive==TRUE. */
+
+ g_tree_remove(cache->properties, property_base);
+
+ if(recursive) {
+ XfconfCacheRecurseData rdata;
+ GSList *l;
+
+ rdata.property_base = g_strdup_printf("%s/", property_base);
+ rdata.property_base_len = strlen(rdata.property_base);
+ rdata.matches = NULL;
+
+ g_tree_foreach(cache->properties,
+ xfconf_cache_collect_properties_recursive,
+ &rdata);
+
+ for(l = rdata.matches; l; l = l->next)
+ g_tree_remove(cache->properties, l->data);
+
+ g_free(rdata.property_base);
+ g_slist_free(rdata.matches);
+ }
+ }
+#endif
xfconf_cache_mutex_unlock(&cache->cache_lock);
- return TRUE;
+ return ret;
}
void
diff --git a/xfconfd/main.c b/xfconfd/main.c
index 7ca223e..cbdc269 100644
--- a/xfconfd/main.c
+++ b/xfconfd/main.c
@@ -127,12 +127,16 @@ main(int argc,
GOptionContext *opt_ctx;
gchar **backends = NULL;
gboolean print_version = FALSE;
+ gboolean do_daemon = FALSE;
GOptionEntry options[] = {
- { "version", 'V', 0, G_OPTION_ARG_NONE, &print_version,
+ { "version", 'V', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &print_version,
N_("Prints the xfconfd version."), NULL },
- { "backends", 'b', 0, G_OPTION_ARG_STRING_ARRAY, &backends,
+ { "backends", 'b', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING_ARRAY, &backends,
N_("Configuration backends to use. The first backend specified " \
"is opened read/write; the others, read-only."), NULL },
+ { "daemon", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &do_daemon,
+ N_("Fork into background after starting; only useful for " \
+ "testing purposes"), NULL },
{ NULL, 0, 0, 0, 0, NULL, NULL },
};
@@ -208,6 +212,21 @@ main(int argc,
return EXIT_FAILURE;
}
g_strfreev(backends);
+
+ if(do_daemon) {
+ pid_t child_pid;
+
+ child_pid = fork();
+ if(child_pid < 0) {
+ g_printerr("Failed to fork()\n");
+ return 1;
+ } else if(child_pid > 0) {
+ fprintf(stdout, "XFCONFD_PID=%d; export XFCONFD_PID;", child_pid);
+ exit(0);
+ }
+
+ close(fileno(stdout));
+ }
g_main_loop_run(mloop);
More information about the Xfce4-commits
mailing list