Commit Graph

2520 Commits

Author SHA1 Message Date
Ryan Lortie
a4421529b8 Add gtk-doc for gsettingsschema{,source} 2011-11-17 14:03:39 +00:00
Matthias Clasen
011a71cf71 'make dist' fixes 2011-11-17 14:03:39 +00:00
Matthias Clasen
97cf2d78c5 settings-source test: Check returned error as well 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
f47264ef5c gsettings: add annotations for _new_full()
The path and backend arguments to g_settings_new_full are optional.
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
446eda8c2b Clarify docs/params for 'schema' vs 'schema id'
Clean up our parameter naming and documentation to draw a clearer line
between a schema and its identifier.
2011-11-17 14:03:39 +00:00
Ryan Lortie
1e70072065 Add g_settings_new_full() taking GSettingsSchema 2011-11-17 14:03:39 +00:00
Ryan Lortie
1c8ae819ed GSettings: add 'settings-schema' property
Ideally we'd have called this 'schema', but it is already used.
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
c25a36c920 Drop the 'schema_name' field of GSettings
This is strictly redundant now that we can get the ID from the schema
itself.  Its only other purpose was to get the schema name from the
set_property() call to the constructed() call and we can avoid that by
doing the schema lookup at the time of the property being set.
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
736a286dce GSettings: deprecate 'schema' property
This should have been called 'schema-name'.
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
53b5918545 GSettingsSchemaKey: store the GSettingsSchema* 2011-11-17 14:03:38 +00:00
Ryan Lortie
54964e22d4 g_settings_schema_key_init: take GSettingsSchema*
instead of of GSettings *
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
e6b4074e41 rename GSettingsKeyInfo to GSettingsSchemaKey 2011-11-17 14:03:38 +00:00
Ryan Lortie
426b146e5f GSettingsKeyInfo: rename field 'key' to 'name' 2011-11-17 14:03:38 +00:00
Ryan Lortie
ca2004fe73 remove GSettings* from GSettingsKeyInfo
This way GSettingsKeyInfo depends strictly on the information in the
schema.  Pass the GSettings* around separately where we need it.
2011-11-17 14:03:38 +00:00
Ryan Lortie
d6c3c2f3c2 store some extra info in GSettingsKeyInfo 2011-11-17 14:03:38 +00:00
Ryan Lortie
f60e0e7242 GSettingsKeyInfo: drop unused variable 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
Benjamin Otte
3c66ada435 localfileenumerator: Improve non-stat'ing code
We now avoid the per-enumerated-file stat for type and names. We could
improve this further by moving things to the no_stat function, but this
is what the file chooser needs for autocomplete, so I am happy.
2011-11-16 17:22:17 +01:00
Benjamin Otte
93aea49bd7 localfileinfo: Split out attributes that don't need a stat
This will be used in the next commit.
2011-11-16 17:22:10 +01:00
Benjamin Otte
8863071b9d localfileenumerator: Take the type from the readdir() call
That way, we can avoid stat() calls for all enumerated files in various
cases. In particular in the autocompletion code in the GTK filechooser.
2011-11-16 17:22:03 +01:00
Benjamin Otte
6fe9791f24 gio: Add tests for g_file_attribute_matcher_subtract() 2011-11-16 17:21:21 +01:00
Benjamin Otte
1985d54bb2 fileinfo: Add g_file_attribute_matcher_subtract()
Added as public API so I can write tests, the use case is local.
2011-11-16 17:19:02 +01:00
Benjamin Otte
60c42f6648 tests: Add tests for fileattributematchers 2011-11-16 17:18:58 +01:00
Benjamin Otte
b400127b3e fileinfo: Add g_file_attribute_matcher_to_string()
This is to be mainly used for debugging and tests.
2011-11-16 17:18:13 +01:00
Benjamin Otte
86d29e4e73 fileinfo: Store namespace::* as 0th attribute
This way, we can get_attribute() namespaces. This will be important in
the next commit.
2011-11-16 17:11:52 +01:00
Benjamin Otte
128e0cb787 fileinfo: Change the way attribute matchers are created
We now sort the matchers and remove unnecessary duplicates (like
removing standard:type when we already match standard:*), so that we can
do more complex operations on them easily in later commits.
2011-11-16 17:11:52 +01:00
Benjamin Otte
1850d23f52 fileinfo: Remove optimization for GFileAttributeMatcher
It makes code more complicated, in particular the code I'm about to add.
2011-11-16 17:11:52 +01:00
Dan Winship
bad6c0ad15 GSocketClient: improve error messages on connection failure
Include the hostname (or proxy hostname if it was the connection to
the proxy server that failed) in the GError message when
g_socket_client_connect* fail.

https://bugzilla.gnome.org/show_bug.cgi?id=661266
2011-11-14 19:46:02 -05:00
Dan Winship
74dad004d1 GUnixInput/OutputStream: fix blocking methods to always block
Previously, if you created a GUnixInputStream or GUnixOutputStream
from a non-blocking file descriptor, it might sometimes return
G_IO_ERROR_WOULD_BLOCK from g_input_stream_read/g_output_stream_write,
which is wrong. Fix that. (Use the GPollableInput/OutputStream methods
if you want non-blocking I/O.)

Also, add a test for this to gio/tests/unix-streams.

Also, fix the GError messages to say "Error reading from file
descriptor", etc instead of "Error reading from unix" (which was
presumably from a bad search and replace job).

https://bugzilla.gnome.org/show_bug.cgi?id=626866
2011-11-14 18:31:21 -05:00
Dan Winship
fe5ba0f291 add GNetworkMonitor, for... monitoring the network
Add GNetworkMonitor and its associated extension point, provide a base
implementation that always claims the network is available, and a
netlink-based implementation built on top of that that actually tracks
the network state.

https://bugzilla.gnome.org/show_bug.cgi?id=620932
2011-11-14 13:42:30 -05:00
Dan Winship
eb9755dc9c GInetAddressMask: new type for internet address range matching
Eg, for matching a GInetAddress to a range like "10.0.0.0/8" or
"fe80::/10"

https://bugzilla.gnome.org/show_bug.cgi?id=620932
2011-11-14 13:42:29 -05:00
Dan Winship
fac9e8d29f gunixinput/outputstream: fix docs
Don't try to link to the docs of undocumented private classes
2011-11-13 16:39:45 -05:00
Dan Winship
9b4cc6edf4 GUnixInputStream, GUnixOutputStream: support ordinary files better
If the fd is not a pipe or socket, fall back to using threads to do
async I/O rather than poll, since poll doesn't work the way you want
for ordinary files.

https://bugzilla.gnome.org/show_bug.cgi?id=606913
2011-11-13 16:28:51 -05:00
Simon McVittie
0f01bef4b4 GDBusWorker: tolerate read errors while closing
My previous fix for GNOME#662100 was incomplete: it seems that with some
timings, the stream can be closed with an async read in-flight. This
can make the read fail immediately with G_IO_ERROR_CLOSED instead of
becoming cancelled.

This happens reliably on an embedded device, and rarely on my laptop;
repeating the test 100 times in quick succession reliably reproduces
the bug on my laptop.

It seems as though what we really want is to ignore read errors, once
we've established that we want to close the connection anyway - this
means that after asking to close, you're immune to exit-on-close,
which seems like a good rule.

An additional subtlety is that continuing to read after we know we
want to close is still required, otherwise we'll never emit ::closed.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662100
Bug-NB: NB#287088
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
2011-11-11 16:05:21 +00:00