Commit Graph

34 Commits

Author SHA1 Message Date
David Zeuthen
69341e2ba9 glib-compile-schemas: Pass a C string, not a GString wrapper
Commit 5e6f762d61 (introducing UTF-8
validity checks for GVariant instances containing strsings) actually
uncovered a bug in glib-compile-schemas - a GString was passed when a
C string was expected.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 14:32:29 -04:00
Ryan Lortie
1b5b87bfa0 GSettings: Mark some strings for cat translation
<vuntz> *miaou*
2010-07-30 21:13:05 +02:00
Owen Taylor
015df7e369 [gschema-compile] fix segfault
If files are passed on the command line and we don't set override_files
at all, don't try to read from the array.
2010-07-28 15:15:57 -04:00
Ryan Lortie
a6f1bb4e17 Add support for vendor override files
You can drop a key-file in the schema directory that looks like:

[org.gtk.Example]
key='value'

to override the default value of 'key' in schema 'org.gtk.Example'.
2010-07-28 13:47:34 +02:00
Matthias Clasen
5f1490e94a Fix sparse warnings
These were listed in bug 623955
2010-07-10 17:21:32 -04:00
Ryan Lortie
a941660873 Bug 623402 - schema compiler reports wrong line
Don't reuse the GMarkupParseContext in order to avoid inaccurate line
number reports.  Fix a memory leak, too.
2010-07-02 11:14:28 -04:00
Ryan Lortie
7a44a2d223 Bug 623401 - schema compiler: process enums first
Process *.enum.xml before any *.gschema.xml files to ensure that all
enums have been defined.
2010-07-02 11:11:45 -04:00
Ryan Lortie
5383c7110f Bug 622124 - implement flags for GSettings
Add a <flags> tag to the schema file format and a flags='' attribute to
go along with.  Add some extra test cases for those.

Add new g_settings_{get,set}_flags() calls and support binding to
GParamSpecFlags properties.  Add test cases.
2010-07-01 19:06:02 -04:00
Ryan Lortie
40d5da99d6 GSettings: accept <flags> as an alias for <enum>
until we have proper support for flags...
2010-06-30 13:27:38 -04:00
Ryan Lortie
3628b0b499 GSettings: add <override>, tests, modify output
Add <override> tag, more tests, and actually output the results of these
new tags to the gschemas.compiled file.
2010-06-29 20:24:39 -04:00
Ryan Lortie
900a756e8f GSettings: new <schema> tags 'extends', 'list-of'
Add support for extends='' and list-of='' tags to the <schema> element.
The attributes are parsed and some sanity-checking is done but currently
nothing happens as a result.

Add some tests.
2010-06-29 15:58:35 -04:00
Ryan Lortie
101bfec676 glib-compile-schemas: fix small leak 2010-06-29 15:58:35 -04:00
Ryan Lortie
8a7d990698 Bug 622565 - compile-schemas fails when no schemas
Neutralise and deprecate the --uninstall option in the schema compiler
and remove it from gsettings.m4.

Make the new default behaviour a compromise between the old default
behaviour and the previous --uninstall option:

  - never return a failure code if no schema files are found

  - issue a warning instead

  - remove the gschemas.compiled file if it exists
2010-06-28 14:06:32 -04:00
Ryan Lortie
fc538894d3 GSettings: enum/choices/aliases/range test cases
Fix a small bug that one of the tests uncovered.
2010-06-17 00:03:44 -04:00
Ryan Lortie
597290d5c8 GSettings: major refactor. Add enums, range. 2010-06-16 18:17:53 -04:00
Ryan Lortie
3a062d2e33 GSettings: store (default, options) in gvdb
gvdb just dropped the ability to have a separate "options" field.  We
now store the options into a GVariant along with the default value.

For now, we use a small shim in GSettingsSchema in order not to touch
too much code.  A more complete rewrite will follow.

This represents a change to the schema file format with another likely
to follow.  glib-compile-schemas needs to be re-run after installing
this change.
2010-06-10 13:49:57 -04:00
Ryan Lortie
71c5e3f899 Bug 620496 - schema compiler: reject invalid paths
The GSettings schema compiler was accepting any string as a path.  It is
probably quite a common mistake to suspect that '/apps/foo' is a valid
path name when this will cause all sorts of trouble later.  Check for
this case and report the error.
2010-06-07 10:18:43 +02:00
Ryan Lortie
caae8ac57a Add --uninstall option to glib-compile-schemas
If --uninstall is given then don't give an error if the schema directory
is empty.  Instead, erase the gschemas.compiled file, if it exists.
This is the right thing to do in the 'make uninstall' rule, where the
schema directory could very well be left empty as a result.

Modify gsettings.m4 to use this option.
2010-05-19 16:02:05 -04:00
Matthias Clasen
2ed13de153 Fix issues with GSETTINGS_CHECK_RULE
Rename the --schema-files option to --schema-file, since it only
accepts one file at a time. Change the GSETTINGS_CHECK_RULE to
use it that way, too. And also make it work better with !srcdir
builds.

Bugs #616731 and #616864
2010-05-14 21:58:08 -04:00
Ryan Lortie
22ce6ed82d Add range restriction to gschema-compiler
Patch from Christian Persch, with minor modifications.

Bug #616102
2010-04-25 20:06:13 -05:00
Matthias Clasen
88ff21ee92 Be more careful about memory management
This was leading to crashes, e.g. bug 616432.
2010-04-21 18:08:05 -04:00
Matthias Clasen
89b718f7d3 Pedantic terminology fix
Elements are not function calls and attributes are not arguments...
2010-04-21 17:45:29 -04:00
Bastien Nocera
0b61a87c29 Allow passing multiple schemas to gschema-compile
To make test suites easier to implement

https://bugzilla.gnome.org/show_bug.cgi?id=616312
2010-04-21 14:38:08 +01:00
Matthias Clasen
64cc81f769 Add an --allow-any-name option
This will make it easier for people to keep their GConf key names
in the transition period.

Conflicts:

	gio/gschema-compile.c
2010-04-21 09:33:57 -04:00
Matthias Clasen
afff087785 Simplify gschema-compile test suite
Add --one-schema-file option to gschema-compile to allow easier test
setup. Simplify the test setup.

Bug #616276.
2010-04-20 23:28:49 -04:00
Matthias Clasen
bedf4c3259 Add documentation and translation for gsettings-tool 2010-04-20 22:55:15 -04:00
Ryan Lortie
f82839b8fe gschema-compile: output to srcdir by default
If the target directory is not explicitly set then output to the source
directory.  Closes bug #616311 reported by Bastien Nocera.
2010-04-20 17:27:17 -04:00
Ryan Lortie
3c54cc074d gschema-compile: return quickly on parse error
Suggested by Christian Persch in #616102
2010-04-20 10:37:33 -04:00
Christian Persch
27d2dbacd4 Use g_set_error_literal where appropriate 2010-04-19 14:18:59 -04:00
Matthias Clasen
4a605693fc Don't segfault when <default> is missing
Also add a framework for schema compiler tests.

Fixes bug 616086.
2010-04-19 11:49:12 -04:00
Tor Lillqvist
a96360ad68 Avoid non-portable <glob.h> API
And thus we can build gschema-compile on all platforms, and run it in
tests.
2010-04-19 15:48:30 +03:00
Matthias Clasen
e0850b56e2 Correct filename extension in help output. 2010-04-18 15:37:55 -04:00
Ryan Lortie
79bc511d95 XML schemas are now *.gschema.xml 2010-04-17 00:40:09 -04:00
Ryan Lortie
897bd9f384 GSettings: merge the schema compiler 2010-04-15 23:35:49 -04:00