Commit Graph

11367 Commits

Author SHA1 Message Date
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
Lucas De Marchi
16292dd753 Fix G*_TO_POINTER casts on 32 bits
If we don't do the cast to the proper size in 32 bits, things like below
doesn't work:

uint8_t u = 20;
void *p;

p = GUINT_TO_POINTER(u);

Signed-off-by: Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=661546
2011-11-16 10:47:21 -05:00
Alexander Larsson
3a7960f757 win32: Make g_get_monotonic_clock lockless 2011-11-16 09:10:46 +01:00
Alexander Larsson
8d023c2706 win32: Use timeGetTime as monotonic base
This allows apps that need it to increase timer accuracy
using timeBeginPeriod
2011-11-16 09:10:46 +01:00
Alexander Larsson
64dec8ad9f win32: Add a monotonic timer 2011-11-16 09:10:45 +01:00
Piotr Drąg
2056906bb7 Updated POTFILES.in 2011-11-15 20:46:17 +01:00
Daniel Mustieles
8d4a141b14 Updated Spanish translation 2011-11-15 17:37:39 +01:00
Javier Jardón
f08a1d126c docs: Remove tmpl directory
We use inline comments now
2011-11-15 12:11:55 +00:00
Sjoerd Simons
469e1a15a0 Fix 1bit mutex test on platforms with 32 bit aligned pointers
The 1 bit mutex tests asserts: ((gsize) ptrs) % 8, ==, 0), which fails
when the platform only aligns porters to 32 bits (e.g. S390 and
powerpc).

I'm not sure why this assertion was placed here, but given
that internally g_pointer_bit_trylock uses g_atomic_int_or internally
change the assertion so it only requires the alignment to be a multiple
of sizeof(int)
2011-11-15 09:27:00 +01:00
Matthias Clasen
65eb65b777 Avoid unused variable warnings in g_ascii_strtod 2011-11-14 23:30:18 -05:00
Matthias Clasen
7c0ee79e34 GThread: handle thread names safely
Avoid a race condition where the string may be freed before
the new thread got around to using it. Also add a test for
thread names.

https://bugzilla.gnome.org/show_bug.cgi?id=663381
2011-11-14 22:18:13 -05:00
Matthias Clasen
375015018b Switch to using template-free docs build
All docs are finally inline, so we can do this switch.
2011-11-14 21:22:46 -05:00
Matthias Clasen
3f0d275295 Move remaining docs inline
This introduces a fake source file just for holding
docs that have no good place elsewhere. Not great, but
better than templates.
2011-11-14 21:22:46 -05:00
Matthias Clasen
127df9bd83 Move GModule docs inline 2011-11-14 21:22:46 -05:00
Matthias Clasen
2195e20dce Move GDate docs inline 2011-11-14 21:22:46 -05:00
Matthias Clasen
18da6e6be9 Move i18n docs inline 2011-11-14 21:22:46 -05:00
Matthias Clasen
c8b0617a2b Move slice and hook docs inline 2011-11-14 21:22:37 -05: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
29f786851d Fix glib/tests/utils for g_parse_debug_string() changes 2011-11-14 13:55:14 -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
Matthias Clasen
e60846dc78 Some more docs reshuffling 2011-11-12 22:52:24 -05:00
Matthias Clasen
06bb6c75a2 More consistent doc formatting
Move some things around, make capitalization of short descriptions
more consistent.
2011-11-12 21:54:42 -05:00
Matthias Clasen
599f254066 Cleanups to debug env var handling 2011-11-12 19:13:44 -05:00
Matthias Clasen
943a18b564 Parse G_DEBUG only once 2011-11-12 18:36:52 -05:00
Matthias Clasen
5d9f05eef1 glib-unix.h: Add G_BEGIN/END_DECLS
The omission was pointed out in bug 663880.
2011-11-12 10:32:35 -05:00
Chun-wei Fan
faebf0f653 gstrfuncs.c: Fix variable declaration
Declare variables at top of block to stop C89 compilers from complaining.
2011-11-12 10:38:31 +08: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
Simon McVittie
214d249f40 GDBusWorker: debug on read errors if transport debugging is enabled
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:19 +00:00
Simon McVittie
fc21c6ced0 gdbus-exit-on-close test: don't leak a variant
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:16 +00:00
Simon McVittie
f0c383917b gdbus-exit-on-close test: optionally be more verbose for debugging
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:04 +00:00
Dan Winship
759c0e935d gio: more implementations of GFileDescriptorBased
Implement GFileDescriptorBased in GSocket{Input,Output}Stream and
GUnix{Input,Output}Stream.

https://bugzilla.gnome.org/show_bug.cgi?id=616852
2011-11-09 08:27:53 -05:00
Kristian Rietveld
f218353e04 Need to include xlocale.h on Darwin for strtod_l
This fixes the build of gstrfuncs.c on Darwin.
2011-11-09 08:32:33 +01:00
Marc-André Lureau
fb95c20c96 Add G_SIGNAL_DEPRECATED
Similar to G_PARAM_DEPRECATED. It will warn only for users of the
signals, so a signal can still be emited without warning, for
compatibility reasons.

Apparently, there is no way user flags could have been used before,
so that shouldn't break anyone.

https://bugzilla.gnome.org/show_bug.cgi?id=663581
2011-11-07 23:12:45 +01:00
Dan Winship
f09e71aff0 gio/tests/proxy: don't use deprecated functions 2011-11-07 13:50:00 -05:00
Dan Winship
a5bf1c117b Fix g_variant_get_gtype() deprecation message
Instead of:

warning: ‘g_variant_get_gtype’ is deprecated (declared at ../../gobject/glib-types.h:242): Use '((GType) ((21) << (2)))' instead [-Wdeprecated-declarations]

show:

warning: ‘g_variant_get_gtype’ is deprecated (declared at ../../gobject/glib-types.h:242): Use ''G_VARIANT_GET_TYPE'' instead [-Wdeprecated-declarations]

Also, document the macro-expansion problem in the
G_GNUC_DEPRECATED_FOR docs
2011-11-07 13:48:30 -05:00
Benjamin Otte
7d1c7af1a6 docs: Improve g_variant_loop() docs
Typo fix and changing "is not recommended" to the nice version of "don't
do this", aka "causes undefined behavior".
2011-11-07 15:29:51 +01:00
Benjamin Otte
14677e16d8 docs: Tell which function to use to avoid errors. 2011-11-07 15:29:51 +01:00
Chun-wei Fan
0e283dcb94 Update VS property sheets
gmain.h was added into the list of deprecated headers, so "install"
that as weel.
2011-11-07 14:14:45 +08:00
Matthias Clasen
fc0b8d4f28 Add a test for CDATA in gschema.xml files 2011-11-07 00:14:28 -05:00
Matthias Clasen
7ec69ecd32 Accept CDATA in gschema.xml files 2011-11-07 00:13:56 -05:00
Alexander Larsson
41b8ce7100 win32: Remove some debug spew on startup
This is not needed anymore and was causing problems for pkg-config.
2011-11-03 17:27:08 +01:00