9719 Commits

Author SHA1 Message Date
Marek Černocký
c5877e15ec Updated Czech translation 2012-03-26 14:47:13 +02:00
Peter Kjellerstedt
7c8576accb Do not fail unit test due to gdb abbreviating strings
gdb by default will only print strings up to 200 characters. After that
it abbreviates them. This affects the run-assert-msg-test.sh script if
the path to the glib installation is too long (in our case it was 133
characters, 132 would still have worked...)

By having gdb execute "set print elements 0" before printing the assert
string, the limit on maximum number of characters to print is set to
unlimited.

Signed-off-by: Peter Kjellerstedt <pkj@axis.com>

https://bugzilla.gnome.org/show_bug.cgi?id=670218
2012-02-18 19:22:14 -05:00
Javier Jardón
b92746b01c docs: Add win32 gio specific api to the docs 2012-02-07 16:05:09 +01:00
Simon McVittie
18f003303a g_array_free, g_ptr_array_free: decrement refcount if not the last ref
foo_free is conceptually "worth" one unref; not decrementing the
refcount here means the GArray or GPtrArray wrapper (but not its
contents) would leak in the following call sequence:

    p = g_ptr_array_new ();
    g_ptr_array_ref (p);
    g_ptr_array_free (p, TRUE);
    g_ptr_array_unref (p);

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-01-16 18:03:37 +00:00
Simon McVittie
700558425a GArray, GPtrArray: factor out the actual freeing
Depending how the array is freed, we may want to free the underlying
array (the "segment"), the struct wrapper or both.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-01-16 18:03:36 +00:00
Simon McVittie
f9e865a29d g_key_file_get_string_list: don't leak the pieces on error
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-01-16 18:03:36 +00:00
Simon McVittie
b39798267d g_strcompress: check that source is non-NULL rather than just crashing
Calling this function with a NULL argument is considered to be invalid,
but one of the regression tests does it anyway (to watch it crash), which
seems a good indication that it's expected to be somewhat common.
Let's check it rather than segfaulting.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
2012-01-16 17:57:33 +00:00
Simon McVittie
f65c741db4 GKeyFile: free group comments when the group is removed
These were leaked. Valgrind was sad.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-01-16 17:57:33 +00:00
Simon McVittie
d98aceab09 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:06:30 +00:00
Simon McVittie
8a7bf8c283 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:06:27 +00:00
Simon McVittie
5949eb9806 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:06:23 +00:00
Simon McVittie
0ed2e786cc 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:06:18 +00:00
Simon McVittie
19d1db095d GDBusWorker: backport explanatory comment about G_IO_ERROR_CANCELLED from 2.30
This was mistakenly omitted from the 2.28 version.

(cherry picked from commit d65b80fb547ef3eed80ae970f858e7d110d90b40)

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:06:13 +00:00
Tim-Philipp Müller
e72314f369 tests: fix glib_translations_work()
If setlocale() to our test locale fails, translations
won't work either.

https://bugzilla.gnome.org/show_bug.cgi?id=654017
2011-10-18 17:08:13 +01:00
Simon McVittie
21b10392a3 gdbus-non-socket test: avoid use of a GMainContext across a fork
See https://bugzilla.gnome.org/show_bug.cgi?id=658999 for why this would
be bad.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-10-18 16:41:17 +01:00
Simon McVittie
9bf965e81f gdbus-exit-on-close test: cover more possibilities
We didn't previously test anything except the implicit default of TRUE.
Now we test implicit TRUE, explicit TRUE, explicit FALSE, and
disconnecting at the local end (which regressed while fixing Bug #651268).

Also avoid some questionable use of a main context, which fell foul of
Bug #658999 and caused this test to be disabled in master.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662100
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-10-18 16:41:15 +01:00
Simon McVittie
ac2c49f313 GDBusWorker: if a read was cancelled it means we closed the connection
This was a regression caused by my previous work on GDBusWorker thread-safety
(Bug #651268). The symptom is that if you disconnect a GDBusConnection
locally, the default implementation of GDBusConnection::closed
terminates your process, even though it shouldn't do that for
locally-closed connections; this is because GDBusWorker didn't think a
cancelled read was a local close.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662100
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-10-18 16:41:12 +01:00
Aputsiaq Janussen
4cf6ec036e Updated Danish translation 2011-09-30 10:07:54 +02:00
Simon McVittie
f021522b96 _g_dbus_worker_new: ref worker until after _g_dbus_worker_thread_begin_func
Otherwise, if the caller of _g_dbus_worker_new immediately unrefs the
worker, calling _g_dbus_worker_thread_begin_func in the worker thread
could be a use-after-free.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:07:04 -04:00
Simon McVittie
e128c045eb GDBusWorker: as a precaution, access 'stopped' boolean atomically
This member is written in _g_dbus_worker_stop from arbitrary threads, and
read by the worker thread, so it should be accessed atomically.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:07:04 -04:00
Simon McVittie
407b4cf8c4 Regression test for closing a stream, slowly, while a message is queued
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:07:04 -04:00
Simon McVittie
2e1b3cd90b GDBusWorker: annotate more functions with lock/pending state
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:07:04 -04:00
Simon McVittie
c9282849b6 GDBusConnection: delegate to the worker to close the stream
We can't safely close the output part of the I/O stream until any
pending write or flush has been completed. In the worst case, this could
lead to an assertion failure in the worker (when the close wins the
race) or not closing the stream at all (when the write wins the race).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:07:04 -04:00
Simon McVittie
7bbc7727d4 GDBusWorker: combine num_writes_pending with flush_pending
num_writes_pending was a counter, but it only took values 0 or 1, so make
it a boolean: it would never make sense to be trying to write out two
messages at the same time (they'd get interleaved).

Similarly, we can never be writing and flushing at the same time (that'd
mean we were flushing halfway through a message, which would be pointless)
so combine it with flush_pending too, calling the result output_pending.

Also assert that it takes the expected value whenever we change it,
and document the locking discipline used for it, including a subtle
case in write_message_in_idle_cb where it's not obvious at first glance
why we don't need the lock.

(Having the combined boolean at the top of the block of write-related
struct members improves struct packing on 64-bit platforms, by packing
read_num_ancillary_messages and output_pending into one word.)

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:07:04 -04:00
Josselin Mouette
8091e2cadb Fix default setting generation in g_desktop_app_info_set_as_last_used
* Do not ignore the system default
 * Do not exclude the last used being set from the default list

This fixes the default applications dialog in control-center.

https://bugzilla.gnome.org/show_bug.cgi?id=658188
2011-09-10 08:30:27 +02:00
Adorilson Bezerra
6dd998e231 Updated Brazilian Portuguese translation. 2011-09-03 18:07:30 -04:00
Martin Srebotnjak
2d8e1bd838 Updated Slovenian translation 2011-09-02 20:45:22 +02:00
Alexandre Franke
3e0d103f94 Update French translation 2011-08-31 16:27:52 +02:00
Chun-wei Fan
9def00025f Update VS Readme.txt's again...
Sorry, copied the wrong text for these files... redid this.
2011-08-31 13:07:24 +08:00
Chun-wei Fan
90f3bc5090 Update Win32 and VS Readme files
Tell people about the GNOME Live! page that outlines building
GLib and its dependencies with Visual C++.
2011-08-31 13:04:33 +08:00
Fran Dieguez
4bf20f1b3a Updated galician translations 2011-08-28 17:13:42 +02:00
Мирослав Николић
1d96c9f3b6 Updated Serbian translation 2011-08-23 19:04:01 +02:00
Chun-wei Fan
9ae64c9cbe Update GLib Visual C++ projects
Define USE_SYSTEM_PCRE for all configurations which uses the PCRE that was
already built and "installed" beforehand (i.e. the *_ExtPCRE
configurations) so that the compilation will not pick up the GLib-bundled
pcre.h when one wants to use the PCRE "installation" on his/her system.
2011-08-23 00:30:33 +08:00
Gil Forcada
b4a4ad3a1a [l10n]Minor update on Catalan translation 2011-08-20 20:21:51 +02:00
Mario Blättermann
6f0a627ae0 [l10n] Updated German translation 2011-08-05 22:24:11 +02:00
Daniel Mustieles
36b0b48d1b Updated Spanish translation 2011-08-04 09:33:34 +02:00
David Zeuthen
012b95fe48 GDBusConnection: Only apply exit-on-closed semantics if properly initialized
Otherwise there is no point in gracefully handling the error...

https://bugzilla.gnome.org/show_bug.cgi?id=655664

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-01 12:07:35 -04:00
Daniel Nylander
804a5c70cb Updated Swedish translation 2011-07-29 09:43:48 +02:00
Piotr Drąg
84958787b9 Updated Polish translation 2011-07-28 10:07:56 +02:00
Marek Černocký
a5e0334f22 Updated Czech translation 2011-07-27 23:01:58 +02:00
Nicolas Dufresne
d4433e6ae8 Added TLS PEM parser unit test 2011-07-27 16:20:14 -04:00
Nicolas Dufresne
3a7fad0313 Rework PEM parsing to not be order dependent
Some valid PEM file would not work because the private key was put
before the certificate.
2011-07-27 16:20:08 -04:00
Chun-wei Fan
f24e15b2dc Updated glib-zip.in a bit further
Missed the bin/gsettings.exe part (corrected from bin/gsettings.)
2011-07-26 23:22:18 +08:00
Dieter Verfaillie
ec466b4d51 Update glib-zip.in 2011-07-26 13:20:05 +02:00
Chun-wei Fan
79c759756f Update Windows READMEs
Tell people not to compile GLib in paths containing spaces.
2011-07-25 11:47:27 +08:00
Tommi Vainikainen
829be7de48 Updated Finnish translation 2011-07-18 00:46:25 +03:00
Chun-wei Fan
eb78d63ffe Update VS2010 README.txt
This file should have Windows CRLF EOL as well...
2011-06-29 13:57:47 +08:00
Chun-wei Fan
225280e959 Re-attempt to correct EOL on VS2010 solution
This time I realized that I needed to set autocrlf=false on my Windows side
... ugh...

This is one of those files that must have CRLF line endings to work
correctly :|
2011-06-29 12:38:57 +08:00
Мирослав Николић
3d78d75b3e Updated Serbian translation 2011-06-24 20:53:06 +02:00
Chun-wei Fan
0588b6ff2c Refine Visual Studio projects
-Reinstate the temporarily removed glib.sln file for VS10--make its EOL
 in the DOS/Windows format so that it will not end up with "Unrecognized
 Visual Studio Version" in Windows.

-Updated GLib projects to set the GLib DLL/LIB files to be output to
 <Debug or Release>\<Win32 or x64>\bin for all configurations

-Updated property sheets to copy the GLib DLL/LIB for all configurations

-Update VS9 property sheet to seperate Intermediate directories for all
 projects as well to reduce warnings/errors of being unable to write the
 PDB and related files as they are in use
2011-06-24 10:54:31 +08:00