Commit Graph

9089 Commits

Author SHA1 Message Date
Ryan Lortie
8efcc0d8c8 glib-compile-schemas: write strinfo little endian
Ensure that the strinfo is output in little-endian byte order on big
endian machines.

GSettings is now passing all of its tests on PowerPC.

Bug #630968 is closed.
2010-10-03 23:26:18 -04:00
Ryan Lortie
61563d5f55 GSettings strinfo: byteswap integers
strinfo is always strictly little endian, so ensure that we byteswap to
native when comparing and returning.
2010-10-03 23:25:29 -04:00
Ryan Lortie
9211d2b00c GSettings endian: missed a spot
Missed an instance of get_value -> get_raw_value search/replace.
2010-10-03 23:15:27 -04:00
Ryan Lortie
c84441fbb3 GSettings big endian tweaks
GSettings relies on parts of the schema infromation remaining
unbyteswapped (the strinfo database, for example) while requiring other
parts to be in native order (the default value, constraints, etc.).

Lift the byteswapping into a place where we can do it selectively.
2010-10-03 23:04:00 -04:00
Ryan Lortie
73ca8b4754 Merge remote branch 'gvdb/master' 2010-10-03 23:03:12 -04:00
Ryan Lortie
e5e491c969 Add gvdb_table_get_raw_value() API for GSettings 2010-10-03 23:02:45 -04:00
Ryan Lortie
90822327ac GSettings test: fix unsafe GObject properties use
The test case was passing a guint16 to g_object_get() for a guint
property.  That's invalid on all systems, although it works (more or
less) on little endian ones.  On big endian it's a total no-go.
2010-10-03 22:55:53 -04:00
Ryan Lortie
2ce2d587ed GVariant: avoid byteswapping in some cases
Make g_variant_byteswap() merely return a new reference on the given
value in the event that we know that byteswapping will have no effect
(ie: types which have no alignment requirement).

This fixes a somewhat complicated interaction between GVariant,
GSettings and GVDB on big endian machines:  GSettings assumes that it
can unref values returned from GVDB without losing access to the
underlying data.  This only works if the underlying data is in the
mapped file -- not a freshly-allocated buffer that GVariant byteswapped
into.
2010-10-03 22:55:39 -04:00
Ryan Lortie
63adeda086 Merge remote branch 'gvdb/master' 2010-10-03 21:11:17 -04:00
Ryan Lortie
a35852bda3 Fix reader on big endian
Some of the hashtable code was failing to byteswap properly.
2010-10-03 21:10:35 -04:00
Ryan Lortie
cdab385ad9 allow libtool 2.4
It's released now and it seems to work OK.
2010-10-03 20:47:26 -04:00
Ryan Lortie
0bd50b39eb Bug 623400 - acquire context before dispatching
For GSettings.

Use the functionality introduced in the last commit to simplify our
notify dispatching and increase the safety of doing so (by ensuring that
the context is acquired in the current thread for the duration of the
dispatch).

This closes bugs #623400 and #629849.
2010-10-03 17:34:16 -04:00
Ryan Lortie
92974b80fc Bug 618737 - "dispatch to context" functionality
Adds a new function g_main_context_invoke() (and _full() variant).

This function takes a main context, a function and a user_data.  If the
main context is already acquired in the current thread, the function is
invoked directly.  If the main context is the default main context of
the current thread and it can be acquired then the function is invoked
directly while the context is owned.  Otherwise, the function is
scheduled as an idle on the context.
2010-10-03 17:34:16 -04:00
Žygimantas Beručka
63fb3ff774 Updated Lithuanian translation by Aurimas Černius <aurisc4@gmail.com> 2010-10-03 15:45:33 +02:00
Ryan Lortie
2d6f8a8ea4 gsettings-tool: Rewrite
Rewrite the GSettings tool.

Improvements/changes:

 - simplify the code by performing common actions (like creating a
   schema) in only one place instead of one per-command

 - new features (list schemas, list keys, monitor multiple, etc)

 - factor-out bash completion and implement in shellscript

 - input validation: should never abort due to invalid inputs

Still to do:

 - proper error checking for ranges/choices

 - support for querying range/choice information

 - bash completion support for enums

Closes bug #629289, possibly among others.
2010-10-03 02:48:07 -04:00
Ryan Lortie
ed9db23f9a GSettings: implement .property_get('path')
This was unimplemented in g_settings_get_property(), leading to a failed
'g_assert_not_reached()'.
2010-10-03 01:53:09 -04:00
Ryan Lortie
5af11ae4bc Add 'Since:' tags for schema listing APIs 2010-10-02 22:46:53 -04:00
Ryan Lortie
d2c0699440 Clean up g_settings_list_schemas()
In its previous form, g_settings_list_schemas() was not useful as a tool
to prevent aborts due to using g_settings_new() with an invalid schema
name.  This is because g_settings_list_scheams() also listed relocatable
schemas, and calling g_settings_new() for those would abort just the
same as if you called it for a non-existent schema.

Modify g_settings_list_schemas() so that it only returns schemas for
which it is safe to call g_settings_new().  Add another call for sake of
completeness: g_settings_list_relocatable_schemas().
2010-10-02 22:42:02 -04:00
Damyan Ivanov
1fee36f72b Updated Bulgarian translation 2010-10-02 08:57:09 +03:00
Ryan Lortie
ba0e608478 Improve .gitignore 2010-10-01 11:21:17 -04:00
Ryan Lortie
3e771509b4 Bug 628937 - gracefully handle broken schemas
Implement the second feature requested in the bug: silently ignore
override files that attempt to override schemas that are not currently
installed.

Also, support 'strictness' being optional for other errors when parsing
override files (ie: inability to open the file, unknown key name, parse
errors, out of range).  We don't completely back out the file in this
case — as that is difficult with the current implementation — but just
ignore the override for the single key.
2010-10-01 11:21:13 -04:00
Ryan Lortie
bd290081ff glib-compile-schemas: improve error accuracy
We wrote "<enum> must contain at least one <value>" for empty <flags>.
Fix that.
2010-10-01 11:21:07 -04:00
Ryan Lortie
e40f3932dd Bug 628937 - gracefully handle broken schemas
Implement the first of two features requested in the bug: when
encountering a broken .xml schema file, back out the changes in that
file and continue to parse other files.

This prevents a single broken .xml file from messing up GSettings for
everyone else.

Add a --strict option to get the old behaviour.  Use this from the test
cases.
2010-10-01 11:21:02 -04:00
Ryan Lortie
fff6814973 Bug 630077 - GDateTime week number support
Fully implement support for ISO 8601 week dates in GDateTime and
document that this is the case.

Add an exhaustive test case to ensure correctness.
2010-10-01 11:20:55 -04:00
Matthias Clasen
fe1186a842 message_to_write_data_free: Don't unref data->message if it is NULL
After the recent changes to message filtering, it can happen that
data->message is NULL when we get here.
2010-09-30 14:40:50 -04:00
Giannis Katsampirhs
faaa8a9f8a l10n: Updated Greek translation for glib 2010-09-30 14:48:06 +03:00
Piotr Drąg
98a0ce64a3 Updated Polish translation 2010-09-29 18:46:10 +02:00
Colin Walters
755c2dad72 introspection: Fix one annotation syntax 2010-09-29 10:38:59 -04:00
Gabor Kelemen
01735d6cc0 Updated Hungarian translation 2010-09-29 14:07:17 +02:00
Bruno Brouard
38e476ac7d Updated French translation 2010-09-29 09:07:12 +02:00
Petr Kovar
36ba8ffb87 Update Czech translation 2010-09-29 04:41:25 +02:00
Peter Kragelj
e458687fac Updated Slovenian translation 2010-09-28 21:21:38 +02:00
Fran Diéguez
afb6e1b458 Updated Galician translations 2010-09-28 17:35:23 +02:00
Peter Kragelj
339182f575 Updated Slovenian translation 2010-09-28 15:12:00 +02:00
Peter Kragelj
974ab9cfa0 Updated Slovenian translation 2010-09-28 15:10:33 +02:00
Gintautas Miliauskas
e44f695f64 Updated Lithuanian translation (thanks Aurimas Cernius). 2010-09-28 00:12:42 +03:00
Mario Blättermann
c4f2bd2593 [i18n] Updated German translation 2010-09-27 20:19:46 +02:00
Fabrício Godoy
973174e5cc Updated Brazilian Portuguese translation 2010-09-27 08:50:48 -03:00
Damyan Ivanov
e2ea3eb586 Updated Bulgarian translation 2010-09-27 13:33:21 +03:00
Ryan Lortie
1a0dbff236 clean up g_date_time_get_week_day()
No functionality changes here.

Vastly simplify the algorithm for calculating the day of the week.

Fix the documentation (which is incorrectly stating that 1 means
Sunday) and clarify that the number we return is in line with ISO 8601
week day numbering.
2010-09-26 18:53:28 -04:00
Wouter Bolsterlee
e77faeb920 Updated Dutch translation by Wouter Bolsterlee 2010-09-26 23:00:07 +02:00
Lucian Adrian Grijincu
4e091e8647 Updated Romanian translation 2010-09-26 22:39:14 +03:00
Johan Dahlin
30132c44c1 Add a lot of missing annotations 2010-09-24 18:24:41 -03:00
Johan Dahlin
701ce5d201 [introspection] Add GObject annotations
These were moved in from gobject-introspection
2010-09-24 16:23:31 -03:00
Johan Dahlin
835f9cb310 [introspection] Move over annotations
Move all the annotations over from gobject-introspection.

They will not be used directly by the introspection scanner for now,
instead they will be extracted by a script and updated manually
until introspection is properly integrated into the glib build
2010-09-24 15:52:38 -03:00
Christian Dywan
0927dda8ad Correct error message when GUnixOutputStream fails to write
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=628876
2010-09-24 13:56:35 +02:00
Andre Klapper
80de3ca7cc Add missing file to POTFILES.in 2010-09-24 13:15:23 +02:00
David Zeuthen
4d9ae95ae0 GDBus: Don't use abstract sockets in test code
It doesn't really work right now because of a dbus-daemon(1) bug - see
the comment added in the TODO section of gdbusconnection.c. So revert
to old behavior. The downside is a lot of files in /tmp but right now
that's better than not being able to run tests in a loop.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 19:16:25 -04:00
David Zeuthen
a35eb70471 GDBus: Use abstract namespace in test cases to avoid littering all over /tmp
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 18:57:35 -04:00
David Zeuthen
7036415cc1 GDBusConnection: Use correct GMainContext when invoking free functions
Without this fix, the ./gdbus-connection test case occasionally fails, see

 https://bugzilla.gnome.org/show_bug.cgi?id=629945#c5

like this

 /gdbus/connection/basic: OK
 /gdbus/connection/life-cycle: **
ERROR:gdbus-connection.c:223:test_connection_life_cycle: assertion failed:
(!quit_mainloop_fired)
 cleaning up bus with pid 21794
 Aborted (core dumped)

because the callback didn't happen on the same thread as where we are
running the loop.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 17:36:07 -04:00