Commit Graph

10534 Commits

Author SHA1 Message Date
Colin Walters
f0db0d22cc gmain: Clarify that timeouts are in terms of monotonic time
Also note that monotonic time does not include time spent while
suspended (at least on Linux).

https://bugzilla.gnome.org/show_bug.cgi?id=655129
2011-08-22 07:15:16 -04:00
Matthias Clasen
527dc86722 GDateTime: use nl_langinfo() when available
This makes g_date_time_format() react to LC_TIME, which is
what people expect.

Translators: this change means that the GDateTime strings
are only used when the C library does not already provide
suitable translated strings for these (month names, etc).
2011-08-21 23:48:07 -04:00
Matthias Clasen
040dcc8a78 GDateTime: cosmetics
Shuffle things around a bit, to move locale-dependent
things together.
2011-08-21 23:36:31 -04:00
Matthias Clasen
6fae33b10a GDateTime: cosmetics
Don't hide the recursion in g_date_time_format() behind
a macro, make it explicit.
2011-08-21 23:32:28 -04:00
Matthias Clasen
76856241d0 Add a quick utility to test datetime formatting 2011-08-21 21:33:30 -04:00
Matthias Clasen
2282036b5d GDateTime: don't use separate strings for upper/lowercase am/pm
We can just as well change the case ourselves.
2011-08-21 20:45:57 -04:00
Matthias Clasen
414c8ce532 g_date_time_format: support %T
strftime supports it, and there is no reason not to do the same.
2011-08-21 19:51:45 -04:00
Pavel Holejsovsky
fd1a12ca4d [gi] Add signal annotations 2011-08-21 17:17:07 +02:00
Pavel Holejsovsky
e7a9b3196b [gi] Add annotations to g_quark functions 2011-08-21 17:17:05 +02:00
Pavel Holejsovsky
af210cd0ee Add missing GClosure annotations 2011-08-19 11:44:44 +02:00
Pavel Holejsovsky
de6566b07d Add missing (allow-none) annotations to g_value_set_string functions 2011-08-19 11:44:41 +02:00
Stef Walter
26548e05bb Merge branch 'concurrent-cancellable' 2011-08-19 11:21:11 +02:00
Stef Walter
54579bf88f gio: GCancellable can be used concurrently
* Update documentation to note that GCancellable can be used
   concurrently by multiple operations.
 * Add documentation to g_cancellable_reset that behavior is
   undefined if called from within cancelled handler.
 * Add test for multiple concurrent operations using the same
   cancellable.

https://bugzilla.gnome.org/show_bug.cgi?id=656387
2011-08-19 11:13:37 +02:00
A S Alam
f07b854a2b update translation for Punjabi 2011-08-19 08:26:25 +05:30
Abduxukur Abdurixit
931196a4d8 Added UG translation 2011-08-19 19:42:26 +02:00
Christian Dywan
654b349c30 Use actual uint64 values to compare uint64 variants
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=656772
2011-08-18 01:38:34 +02:00
Pavel Holejsovsky
d4c5e3b156 Add (allow-none) annotation for GValue setters.
Assorted g_value_set_xxx() and g_value_take_xxx() functions actually
allow NULL in source parameter.
2011-08-17 12:55:12 +02:00
Behdad Esfahbod
e3219c8425 Fixup max decomposition len guarantee
Unicode Technical Committee agreed to limit decomposition length to
18 in both cases.  Reflect that.
2011-08-17 12:14:07 +02:00
Brian Cameron
b5f1ea4bb1 void functions should not return. Fixes bug #656675. 2011-08-17 03:01:14 -05:00
Ryan Lortie
b18ca488ae post-release bump 2011-08-15 21:01:52 -04:00
Ryan Lortie
e17ce3594e glib 2.29.16 2011-08-15 21:01:28 -04:00
Ryan Lortie
0a4663343f distcheck fixes 2011-08-15 21:01:23 -04:00
Matthias Clasen
4cd5762ccc More NEWS updates 2011-08-15 18:55:58 -04:00
Ryan Lortie
472bd4d8a1 Updated Esperanto translation
Esperanto weekdays and month days are written in lowercase (as in
French).
2011-08-15 13:35:35 -04:00
Simon McVittie
67cf3ea368 Add a stress-test for GDBusProxy in threads with no default main context
Destroying a GDBusProxy in a thread used to race with NameOwnerChanged
being delivered to the main context's thread (GNOME #651133).

Also, g_dbus_proxy_call_sync in a thread would race with NameOwnerChanged
being delivered to the main context's thread and rewriting the name_owner
(GNOME #656039).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=656039
Bug-NB: NB#259760
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:04 -04:00
Simon McVittie
85214d1e7f GDBusProxy: hold properties_lock while using any mutable property
This changes the meaning of "properties_lock" from "lock for D-Bus
properties" to "lock for GObject properties".

The most common problem, and the only one I've reproduced in a regression
test, is name_owner, which can be updated by the thread that owns
the GDBusProxy's main context (i.e. the thread-default main context of
the thread that constructed it) at the same time that a blocking call
is made. When a GDBusProxy is constructed in a thread-pool thread for
short-term use, the main context will typically be the global default
main context (which is actively running in the main thread!), making
this extremely problematic.

The interface info is perhaps a theoretical concern - one thread could
conceivably set it at the same time that another thread uses it, but only
in relatively pathological situations. The current API for this does have
the problem that it returns a borrowed ref, but interface info is
hopefully permanent anyway.

The default timeout is probably only a theoretical concern - it's just an
int, so writes are indivisible, and there's no worry about whether
something has been freed - but to be safe, let's hold the lock for that
too.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=656039
Bug-NB: NB#259760

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:03 -04:00
Simon McVittie
5909cb1031 GDBusProxy: factor out async_init_data_set_name_owner
This removes the need for async_init_get_name_owner_cb to cope with being
called without a real GAsyncResult, and will simplify the addition of
correct thread-locking.

In async_init_data_set_name_owner, use the name_owner parameter instead
of the corresponding member of GDBusProxyPrivate, partly to reduce
pointer-chasing but mainly to avoid needing to hold the lock.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:01 -04:00
Simon McVittie
03ae974f7c g_dbus_proxy_get_property: use accessors for all mutable state
These ought to have thread-locking, and having it in the accessor seems
better than duplicating it here.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:00 -04:00
Simon McVittie
20387d262f GDBusProxy: if a well-known name is not owned, don't GetAll from the dbus-daemon
If you run:

    ( cd gio/tests && G_DBUS_DEBUG=all ./gdbus-proxy-well-known-name )

you can see that in the case where the name com.example.TestService isn't
owned yet, the GDBusProxy calls GetAll() with no destination, resulting
in an error reply from the peer (the dbus-daemon itself). That's clearly
not right!

However, if priv->name is NULL, that indicates the special case where we
really do want to talk directly to a peer, instead of via the bus daemon
(most likely to be used on peer-to-peer connections); in that special
case, do call GetAll().

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:49:58 -04:00
Ryan Lortie
2b0171a808 g_settings_bind: add some g_return checks
https://bugzilla.gnome.org/show_bug.cgi?id=636405
2011-08-15 10:43:32 -04:00
Ryan Lortie
e1b41dcb91 ghash: fix error in "as a set" documentation 2011-08-15 10:43:25 -04:00
David Zeuthen
20a4f2578f GDBusObjectManagerClient: Emit signals on proxy before emitting on manager
This is needed because the proxy may need to update its internal state
which a signal handler connected to the manager may rely on.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 05:43:24 -04:00
Antoine Jacoutot
230efe70f4 open(2): POSIX compatibility.
Posix allows for open(2) to fail with errno = EINTR.
Normal this isn't seen when opening files. However in some case we are
opening a fifo for write which will block until another process opens it
for read. If a signal is received while blocked, open(2) fails with
errno = EINTR.

https://bugzilla.gnome.org/show_bug.cgi?id=656492
2011-08-15 03:54:35 -04:00
Matthias Clasen
b76bb6713b Add g_mkdtemp in the spirit of g_mkstemp
At the same time, also add g_mkdtemp_full and g_dir_make_tmp
variants. The patch also unifies the unique-name-generating
code for all variants of mkstemp and mkdtemp and adds tests
for the new functions.

Based on patches by Paolo Bonzini,
http://bugzilla.gnome.org/show_bug.cgi?id=118563
2011-08-14 14:09:58 -04:00
Matthias Clasen
8377a88685 GHmac: pedantic doc fixes
Add a link to an explanation of what HMAC is, and tweak
some formatting.
2011-08-14 12:03:36 -04:00
Matthias Clasen
1cb8640ccc News for 2.29.16 2011-08-14 11:57:57 -04:00
Stef Walter
acbcb8f7e3 hmac: Implementation of HMAC in glib
This implements g_hmac_xxx() functionality using the standard checksum
functions supported by glib.

HMAC is a secure way to hash a key and a password. Many other
approaches fraught with append and prepend issues.

Includes test cases defined in relevant RFCs

https://bugzilla.gnome.org/show_bug.cgi?id=652480
2011-08-14 09:27:45 +02:00
Marc-André Lureau
d2ca14c270 Add G_VALUE_INIT
The implementation of GValue is not public or documented.  When
allocated on the stack, initializing a GValue is usually done as
documented with:

GValue value = { 0, };

There is lot code around (including WebKit) that added all the missing
fields, resulting in this ugly and non-obvious:

GValue value = { 0, { { 0 } } };

However, this doesn't play nice with -Wmissing-field-initializers for
example. Thus, G_VALUE_INIT.

http://bugzilla.gnome.org/show_bug.cgi?id=654793
http://bugzilla.gnome.org/show_bug.cgi?id=577231
2011-08-13 18:16:44 -04:00
Sjoerd Simons
a9ca74efb1 Don't finish gtls connection if the handshake failed
https://bugzilla.gnome.org/show_bug.cgi?id=656283
2011-08-13 16:15:11 -04:00
Matthias Clasen
ae496a52a9 GDBusProxy: on_properties_changed initialize some variables
This avoids calling g_variant_unref and g_free on uninitialized memory
if PropertiesChanged is received in the creating thread's thread-default
main context's thread, at the same time as releasing the last ref in
another thread. This would result in "goto out" before the variables
freed after that label had been initialized to NULL.

Based on a patch by Simon McVittie, bug 656282
2011-08-13 16:09:41 -04:00
Matthias Clasen
655299a057 gdatetime: Add a test for %OM 2011-08-13 15:48:47 -04:00
Matthias Clasen
be93370605 Remove a gccism
Pointed out in bug 656152.
2011-08-13 15:29:29 -04:00
Matthias Clasen
3c504e4765 Fix statfs/statvfs decision
We want to force use of statvfs when statfs is deficient.
This does not make any difference on Linux.

https://bugzilla.gnome.org/show_bug.cgi?id=656151
2011-08-13 15:07:38 -04:00
Matthias Clasen
f5472ed232 Trivial typo fix 2011-08-13 13:53:48 -04:00
David Zeuthen
428f49b9c8 In addition to /media and $HOME, also show mounts in $XDG_USER_DIR
Prepare for the future where udisks will use $XDG_USER_DIR/Volumes
instead of /media when mounting filesystems on behalf of the user.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-12 11:10:22 -04:00
Andika Triwidada
9fafa34345 Updated Indonesian translation 2011-08-12 15:50:08 +07:00
Chun-wei Fan
ebc74835e0 Update VS property sheets ("install" phase)
Copy the new GioTLS headers that were introduced into the GIO
library in commit 	0f99cfa882 during the
"install" stage.
2011-08-12 11:43:40 +08:00
Alexander Shopov
2f8664306d Updated Bulgarian translation 2011-08-11 20:55:41 +03:00
Behdad Esfahbod
ea6e2968bf [gobject] Fix G_DEFINE_BOXED_TYPE compilation with C++ 2011-08-11 19:03:02 +02:00
Martin Pitt
c3fd789bb7 [gi] Add missing (out) annotation to g_dbus_{node,interface}_info_generate_xml() 2011-08-11 14:09:23 +02:00