Commit Graph

67 Commits

Author SHA1 Message Date
Evan Nemerson
570b27b9ac gio: port annotations from the Vala metadata.
https://bugzilla.gnome.org/show_bug.cgi?id=730493
2014-05-23 10:04:06 -07:00
Alberto Ruiz
7916f6d636 gio: fix g-i annotations in g_settings_schema_source_list_schemas() 2014-04-15 18:56:26 +02:00
Matthias Clasen
e7fd3de86d Eradicate links and xrefs
These are all replaced by markdown ref links.
2014-02-08 12:26:56 -05:00
Matthias Clasen
3232425785 Docs: replace <literal> by ` 2014-02-06 08:07:16 -05:00
Matthias Clasen
0cc20b7e0b Don't use <filename> in docs
Switch to simpler markdown, `foo`.
2014-02-05 20:17:46 -05:00
Matthias Clasen
111803030d Don't use <envar> in docs
Switch to simpler markdown, `foo`.
2014-02-05 19:32:41 -05:00
Matthias Clasen
306dfb3292 Drop use of the command tag
It is more useful to link to the included man page, anyway.
2014-02-01 15:26:38 -05:00
Matthias Clasen
adf892e96a Annotate all examples with their language
The C ones, at least.
2014-02-01 15:11:49 -05:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Matthias Clasen
3872049445 Add includes to all gio docs 2014-01-07 22:55:43 -05:00
Bastien Nocera
aef0adc0dd GSettings: More docs for deprecated _list_schemas()
Most _list_schemas() uses were to check for the availability
of a particular schema. g_settings_schema_source_lookup() is
a better way to do this.

https://bugzilla.gnome.org/show_bug.cgi?id=712315
2013-11-23 13:35:52 -05:00
Ryan Lortie
b227528f32 GSettingsSchemaSource: fix parameter name in header
list_schemas() had the parameters called 'recursive' and 'non-recursive'
in the header instead of 'relocatable'.  Fix that.
2013-10-28 20:50:01 -07:00
Ryan Lortie
0d89d38cac GSettings: fix for loop in 'extends' functionality
Obvious mistake :(
2013-10-28 12:10:13 -07:00
Ryan Lortie
bcb030a474 GSettingsSchemaKey: add introspection APIs
Add g_settings_schema_has_key() and _get_range(), _range_check(),
_get_value_type(), _get_default_value() methods on GSettingsSchemaKey.

Deprecate the equivalent APIs on GSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=683017
2013-10-28 11:31:48 -07:00
Ryan Lortie
066df98849 g_settings_schema_list: some fixes
Prevent a crash in the case that gvdb_table_list() returns NULL (ie:
because a schema has no keys).

Stop a memory leak caused by pointlessly stealing keys from a hashtable
(after we quarked them already).

Stop allocating an extra entry at the end of an array for a terminator
(that we never wrote anyway) when all functions using this API refer to
the out-parameter length array.

https://bugzilla.gnome.org/show_bug.cgi?id=711016
2013-10-28 09:44:05 -07:00
Ryan Lortie
cbf8cf8598 GSettings: properly support 'extends'
Support the 'extends' attribute that has been supported by the compiler
for a long time by doing three things:

 - when creating a schema that extends another schema, lookup that other
   schema

 - when looking up keys and we can't find them in the schema, check
   (recursively) in the 'extends' schema

 - when listing all keys in a schema, also visit the extends schemas,
   but take care to avoid duplicates caused by overrides

Extend the testsuite to verify that it works.

https://bugzilla.gnome.org/show_bug.cgi?id=645453
2013-10-27 17:18:10 -07:00
Ryan Lortie
6f386341bd Add g_settings_schema_source_list_schemas()
g_settings_list_schemas() and g_settings_list_relocatable_schemas() are
now deprecated.

This will allow listing off schemas on non-default sources and is a
better fit with the new direction the API is going.

https://bugzilla.gnome.org/show_bug.cgi?id=680838
2013-10-27 17:12:57 -07:00
Ryan Lortie
96a053e025 Add g_settings_schema_key_get_summary/description
Add an API to read the summary and description from the .xml schema
files.

This will be used by dconf-editor and gnome-tweak-tool.

This API is a bit heavy -- it parses the XML and builds a table.  It
also loads gettext domains for translation.  It only does these things
if it is used, however, so it will not impact normal applications.

We store the summary/description in a pair of hash tables on the schema
source (which we have a backref to as of a few commits ago).  We can't
use a global table because people might want to request summary and
description from non-default sources.  We don't want to use per-schema
tables because we'd have to reparse the directory every time (since we
cannot guess which file a schema may have been in).

https://bugzilla.gnome.org/show_bug.cgi?id=668232
2013-10-27 10:42:55 -07:00
Ryan Lortie
84fa07aeb1 Make GSettingsSchemaKey public
Take this private API and make it public along with a boxed type and
ref/unref functions.

Future commits will add accessors with new functionality and some that
allow us to deprecate functions on GSettings itself (such as
g_settings_get_range).

https://bugzilla.gnome.org/show_bug.cgi?id=668232
2013-10-27 10:42:50 -07:00
Ryan Lortie
0ef43ba743 GSettingsSchema: store a backref to the source
Record in each GSettingsSchema object the source from which it came.

This will be useful in future commits.

https://bugzilla.gnome.org/show_bug.cgi?id=668232
2013-10-27 09:32:10 -07:00
Ryan Lortie
e462eda3d5 Clean up GSettingsSchema logic
The way we created the global schema list predates
g_settings_schema_source_new_from_directory() and therefore doesn't use
it.

Update it to use that function, removing some code.

https://bugzilla.gnome.org/show_bug.cgi?id=668232
2013-10-27 09:32:10 -07:00
Ryan Lortie
27898916d4 g_settings_list_children: only list viable schemas
Don't return children with invalid schemas from
g_settings_list_children() (ie: missing schemas or mismatched paths).
This prevents gsettings list-recursively from crashing when broken
schemas are installed on the system.

https://bugzilla.gnome.org/show_bug.cgi?id=705688
2013-10-02 12:37:09 -04:00
Matthias Clasen
a3182e3b9a Improve various section headings in the docs
We don't use # or other forms of links in the section headings.
We also capitalize them and don't put a final period.

This commit corrects several headings to follow these rules.
2013-06-29 22:51:31 -04:00
Dan Winship
4b94c0831e Use 'dumb quotes' rather than `really dumb quotes'
Back in the far-off twentieth century, it was normal on unix
workstations for U+0060 GRAVE ACCENT to be drawn as "‛" and for U+0027
APOSTROPHE to be drawn as "’". This led to the convention of using
them as poor-man's ‛smart quotes’ in ASCII-only text.

However, "'" is now universally drawn as a vertical line, and "`" at a
45-degree angle, making them an `odd couple' when used together.

Unfortunately, there are lots of very old strings in glib, and also
lots of new strings in which people have kept up the old tradition,
perhaps entirely unaware that it used to not look stupid.

Fix this by just using 'dumb quotes' everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=700746
2013-05-21 11:23:22 -03:00
Matthias Clasen
e2470ec6db docs: Don't put links in section titles 2012-08-03 23:36:45 -04:00
Ryan Lortie
ed492a5de2 GSettings: be more careful about keys names with /
Prevent attempts to access keys ending with slashes that exist in the
schema file as references to child schemas.

Also: don't emit change signals for these same keys.
2012-07-06 13:44:17 -04:00
Ryan Lortie
c95e908529 GSettingsSchema: ignore empty schema caches
glib-compile-schemas used to generate these.  They're harmless and they
mean that no schemas are installed in a particular directory, so just
ignore them.

https://bugzilla.gnome.org/show_bug.cgi?id=656301
2012-01-18 22:16:23 -05:00
Ryan Lortie
f9cc078671 We need <locale.h> in gsettingsschema.c now
for LC_TIME (since we moved a bunch of code over from gsettings.c).
2011-11-18 09:41:52 +00:00
Rico Tzschichholz
8d9f600aea Remove redefinition of typedef 'GSettingsSchemaSource' 2011-11-17 19:46:54 +01:00
Ryan Lortie
ee31c7f4ed add plugin example for GSettingsSchemaSource 2011-11-17 14:03:39 +00:00
Ryan Lortie
a4421529b8 Add gtk-doc for gsettingsschema{,source} 2011-11-17 14:03:39 +00:00
Matthias Clasen
a7ce1953fa Trivial typo fix 2011-11-17 14:03:39 +00:00
Jasper St. Pierre
6339b5fe2d schema source: avoid introspection confusion
Any method that has its prefix'd argument as its first parameter will be
interpreted by introspection as a method. We don't want this, so we need
to swap the first two parameters.
2011-11-17 14:03:39 +00:00
Jasper St. Pierre
bef773408c gsettingsschema: Use the trusted parameter 2011-11-17 14:03:39 +00:00
Ryan Lortie
148f731748 Add test case and fix some bugs
Add the first test case for the schema source functionality and fix a
couple of bugs that got uncovered by that.
2011-11-17 14:03:39 +00:00
Ryan Lortie
fee2c87ba1 Add g_settings_schema_source_new_from_directory()
It is now possible for plugin loading systems to do the right thing.
2011-11-17 14:03:39 +00:00
Ryan Lortie
269c999463 add boxed types for GSettingSchema{,Source} 2011-11-17 14:03:39 +00:00
Ryan Lortie
48b99017de speak of 'schema id' rather than 'schema name'
Schemas are identified by id='' in the xml file, so we should use the
same language on the C and GObject property APIs.
2011-11-17 14:03:39 +00:00
Ryan Lortie
3bcf1137f4 drop the now-trivial g_settings_schema_new
Combine it into g_settings_constructed()
2011-11-17 14:03:39 +00:00
Ryan Lortie
d5fb032f72 new public header: gsettingsschema.h
Expose some GSettingsSchemaSource and GSettingsSchema APIs.

These are mostly useless so far...
2011-11-17 14:03:39 +00:00
Ryan Lortie
2633f2903e Add non-aborting g_settings_schema_source_lookup()
And rewrite g_settings_schema_new() in terms of it
2011-11-17 14:03:39 +00:00
Ryan Lortie
bf5626ddc2 GSettingSchemaSource: add refcounting 2011-11-17 14:03:39 +00:00
Ryan Lortie
e01a43b621 GSettingsSchema: use our own linked lists
Switch from GSList for the list of schema sources to using our own
linked list type called GSettingsSchemaSource.
2011-11-17 14:03:39 +00:00
Ryan Lortie
5ec84e8056 GSettingsSchema: alter our 'reverse' technology
Instead of building a reversed linked list by prepending in order and
then reversing it at the end, prepend in reverse by iterating backwards
through the directories (to get a list in-order when we're done).
2011-11-17 14:03:38 +00:00
Ryan Lortie
104f7353a7 move GSettingsSchemaKey to gsettingsschema.c
These functions no longer have anything to do with GSettings itself, so
they should not be in that file anymore.

GSettings still wants direct access to the GSettingsSchemaKey structure,
so put that one in gsettingsschema-internal.h.
2011-11-17 14:03:38 +00:00
Ryan Lortie
10907cafc3 add internal g_settings_schema_get_name() 2011-11-17 14:03:38 +00:00
Ryan Lortie
11ef4d7981 rename gsettingsschema.h to -internal.h 2011-11-17 14:03:38 +00:00
Ryan Lortie
577faeae5b unGObjectify GSettingsSchema 2011-11-17 14:03:38 +00:00
Ryan Lortie
09429e2c82 gio static fixups 2011-10-16 21:41:15 -04:00
Ryan Lortie
3106391694 Revert "GSettings: don't abort on missing schemas"
This reverts commit c841c2ce3f.

This approach has been an unmitigated disaster.  We're getting all sorts
of crashes due to functions that are returning NULL because they can't
find the schema for the default value.  The people who get these crashes
are then confused about the root cause of the problem and waste a lot of
time trying to figure it out.

Until we find a better solution, we should go back to what we had
before.

https://bugzilla.gnome.org/show_bug.cgi?id=655366
2011-10-03 10:19:38 -04:00