Commit Graph

12707 Commits

Author SHA1 Message Date
Dan Winship
b3f9637337 gthreadpool: set default max_unused_threads and max_idle_time values
GThreadPool defaulted to 0 for max_unused_threads (meaning thread-pool
threads would exit immediately if there was not already another task
waiting for them), and 0 for max_idle_time (meaning unused threads
would linger forever, though this is only relevant if you changed
max_unused_threads).

However, GIOScheduler changed the global defaults to 2 and 15*1000,
respectively, arguing that these were more useful defaults. And they
are, so let's use them.

https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-07-31 14:37:56 -04:00
Dan Winship
26056558be gmain: allow g_source_get_context() on destroyed sources
g_source_get_context() was checking that the source wasn't destroyed
(since a source doesn't hold a ref on its context, and so
source->context might point to garbage in that case). However, it's
useful to be allowed to call g_source_get_context() on a source that
is destroyed-but-currently-running.

So instead, let g_source_get_context() return the context whenever
it's non-NULL, and clear the source->context of any sources that are
still in a context's sources list when the context is freed. Since
sources are only removed from the list when the source is freed (not
when it is destroyed), this means that now whenever a source has a
non-NULL context pointer, then that pointer is valid.

This also means that g_source_get_time() will now return-if-fail
rather than crashing if it is called on a source whose context has
been destroyed.

Add tests to glib/tests/mainloop to verify that g_source_get_context()
and g_source_get_time() work on destroyed sources.

https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-07-30 12:48:10 -04:00
Dan Winship
6881e743ee glib/tests/mainloop: test g_source_get_time()
Verify that

  - g_source_get_time() does not change within a single callback
    (even if the real time does)

  - g_source_get_time() does not change between different callbacks in
    the same mainloop iteration

  - g_source_get_time() does change between iterations if the real
    time did.

https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-07-30 12:48:10 -04:00
Owen W. Taylor
b0bce4ad41 g_file_make_directory_with_parents: Fix error propagation
When creating a directory fails for some reason other than
the parent not existing, don't clear the error before we try
to propagate it.

To reproduce, run 'ostadmin init' on /ostree or otherwise try to
run the function on a directory with a parent directory where the
current user is not allowed to write.

https://bugzilla.gnome.org/show_bug.cgi?id=680823
2012-07-30 18:29:26 +02:00
Colin Walters
d7829ced53 GFile: Note semantics of g_file_delete()
Particularly for someone programming on Unix, this helps them
understand that we will unlink symbolic links, and not follow them.
2012-07-30 05:11:08 -04:00
Colin Walters
14a1c20177 GFile: Add g_file_delete_async()
This looks like it was stubbed out but not implemented; the vtable
entry dates to commit 3781343738 which
is just alex's initial merge of gio into glib.

I was working on some code that wants an asynchronous rm -rf
equivalent, and so yeah, this is desirable.

https://bugzilla.gnome.org/show_bug.cgi?id=680760
2012-07-30 05:01:06 -04:00
Colin Walters
6b6bef753f Add .dir-locals.el to tell Emacs users not to use tabs for C
Requested by Ryan.

https://bugzilla.gnome.org/show_bug.cgi?id=680787
2012-07-30 04:09:08 -04:00
Fran Diéguez
c3154cc48e Updated Galician translations 2012-07-30 02:42:30 +02:00
Andrej Žnidaršič
8abfe528b7 Updated Slovenian translation 2012-07-29 13:11:18 +02:00
Lionel Landwerlin
ad4f780cb4 glib: fix locale detection on android
g_utf8_strup() tries to call setlocale() before starting to compute
the length of its first argument. Calling setlocale() can return NULL
(as specified in the man page), and obviously that happens on android.

https://bugzilla.gnome.org/show_bug.cgi?id=680704
2012-07-27 19:41:05 +02:00
Мирослав Николић
3339a395c2 Updated Serbian translation 2012-07-25 10:33:27 +02:00
Yaron Shahrabani
72824f2af2 Updated Hebrew translation. 2012-07-24 22:39:15 +03:00
Tobias Endrigkeit
3bb53b1453 [l10n] Updated German translation 2012-07-23 22:11:53 +02:00
Kjartan Maraas
0830e10e6f Updated Norwegian bokmål translation 2012-07-23 11:42:22 +02:00
Colin Walters
003e7a70e8 Revert unintential IAPI break for g_key_file_load_from_data()
The old (length) annotation actually wasn't being read.  Changing
it to an array was telling g-i that it was an array of utf8, which
is clearly not true.

We *could* add (element-type guint8), but that would change it to a
byte array, as opposed to the original utf8 version.

Just removing the annotation should bring us back to where we
were, which was fine.

https://bugzilla.gnome.org/show_bug.cgi?id=680310
2012-07-20 14:07:39 -04:00
Chun-wei Fan
1ae7c7d982 gio/Makefile.am: Filter out gcontenttype.c for MSVC builds
gcontenttype.c was split into gcontenttype.c and gcontenttype-win32.c
in commit 32192ee9 ("Split gcontenttype.c"), so we don't want to include
gcontenttype.c in the Visual C++ build as it is no longer a source file
meant for Windows.

Thanks to Thomas H.P. Anderson for pointing this out.
2012-07-19 23:15:59 +08:00
Matthias Clasen
23a2136fb5 Check for PR_SET_NAME
Bug 680148 claims that PR_SET_NAME may not be defined when
using an old kernel. Deal with it.
2012-07-19 06:37:59 -04:00
Matthias Clasen
4c255d4602 Be more careful when using xlocale
Bug 680074 shows that we may end up in situations where only
some of the xlocale functions we need are available. Rather than
trying to find the minimal set of required functions for each
use, define a global USE_XLOCALE and only use any xlocale functions
if we have a full set.
2012-07-19 06:32:29 -04:00
Matthias Clasen
dd098405ad Cosmetic: Fix up line endings
Somehow a few ^M sneaked in here.
2012-07-19 06:20:41 -04:00
Dan Winship
2357f67b1b gmain: handle child sources being destroyed before parent
Fix a crash when a child source is destroyed before its parent. Also,
add a test case for this and the previous fix.
2012-07-18 15:08:44 -04:00
Dan Winship
ee6e66cb44 g_source_add_child_source: sync blocked state
Child sources are supposed to be blocked when their parents are, so
when adding a source to a blocked source, block the child too. Fixes a
warning when unblocking the parent.
2012-07-18 14:19:36 -04:00
Dan Winship
2855b827da gio/tests/converter-stream: add a new test, rename an old one
Add a test that the decompressor input streams handle truncated data
correctly. (They do; I wrote the test thinking there was a bug there,
but there isn't.)

Also, rename the "corruption" tests to "roundtrip", since "corruption"
makes it sound like we're testing how the converters deal with
corrupted data, as opposed to merely testing that they don't corrupt
data themselves. And fix the bug reference.
2012-07-17 16:21:03 -04:00
Dan Winship
09c18537f4 g_cancellable_source_new: don't use a file descriptor
Rather than implementing GCancellableSource by polling on its fd,
implement it by just waking its GMainContext up from the "cancelled"
signal handler, thereby helping to reduce file descriptor usage.
Suggested by Ryan Lortie.

https://bugzilla.gnome.org/show_bug.cgi?id=680121
2012-07-17 15:32:48 -04:00
Matthias Clasen
0e37822e10 Bump version 2012-07-17 14:23:08 -04:00
Matthias Clasen
ffefa544d6 More updates 2012-07-17 13:50:58 -04:00
Stef Walter
a0b71839ee GIOScheduler: Fix access after free in "cancelled" handler
* GCancellable can be "cancelled" more than once if
   g_cancellable_reset() is called.
 * Don't assume that because the "cancelled" signal fired
   it won't fire again.

https://bugzilla.gnome.org/show_bug.cgi?id=680111
2012-07-17 13:47:26 -04:00
Matthias Clasen
e97a4c7e5e 2.33.6
https://bugzilla.gnome.org/show_bug.cgi?id=680111
2012-07-17 13:47:26 -04:00
Dan Winship
d90ad18055 GAsyncInitable: partially revert the init_finish changes
g_async_initable_real_init_finish() was previously handling all
GSimpleAsyncResults, even if they weren't created by
g_async_initable_real_init_async(), and libnm-glib accidentally relied
on that behavior. So remove the g_simple_async_result_is_valid()
check.
2012-07-17 09:15:44 -04:00
Krzesimir Nowak
cd8ec3359b GVariantType: Add (constructor) annotation for some constructors.
This are mistaken by g-ir-scanner as GVariantType's methods, because
they take a GVariantType* as a first parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=679968
2012-07-16 17:58:22 +02:00
Daniel Mustieles
1b3578ec0b Updated Spanish translation 2012-07-16 16:42:49 +02:00
Marc-André Lureau
bfbfbec91e win32: g_getenv() should return "" if variable exists and empty
On Windows, GetEnvironmentVariable() returns 0 for empty variables.
Checking GetLastError() == ERROR_ENVVAR_NOT_FOUND helps make a
difference between a variable that does not exist or an empty one
which should return "".

https://bugzilla.gnome.org/show_bug.cgi?id=679617
2012-07-16 12:49:25 +02:00
Marc-André Lureau
6007a4b0b1 win32: fix g_get_environ()
The current code create the strv array incorrectly, it is too big and
leaves invalid holes. This may result in crashes when freeing the
returned value.

https://bugzilla.gnome.org/show_bug.cgi?id=679617
2012-07-16 12:49:24 +02:00
Matthias Clasen
11819933e2 Bump version 2012-07-16 06:01:55 -04:00
Matthias Clasen
d48bd70853 More updates 2012-07-15 20:36:10 -04:00
Ihar Hrachyshka
f81c2c753a Updated Belarusian translation. 2012-07-15 12:27:03 +03:00
Piotr Drąg
ef4bbecce7 Updated Polish translation 2012-07-15 01:26:12 +02:00
Chao-Hsiung Liao
160da82e39 Updated Traditional Chinese translation(Hong Kong and Taiwan) 2012-07-14 13:51:12 +08:00
Matthias Clasen
c182ee1f71 Fix GModule documentation a bit
The documentation for g_module_make_resident was for some reason
in the doc comment for g_module_name.

https://bugzilla.gnome.org/show_bug.cgi?id=679813
2012-07-13 17:37:37 -04:00
Matthias Clasen
34b2125edf Fix doc build 2012-07-13 17:37:12 -04:00
Nilamdyuti Goswami
3201bcd1b2 Assamese translation updated 2012-07-13 17:54:20 +05:30
Matthias Clasen
97676046f2 Update NEWS 2012-07-12 23:51:08 -04:00
Marc-André Lureau
d9af4259f7 win32: fix build g_spawn_check_exit_status() with mingw
With mingw, only gspawn-win32.c is compiled, but it is missing some
new symbols.

https://bugzilla.gnome.org/show_bug.cgi?id=679691
2012-07-12 23:19:52 -04:00
Krzesimir Nowak
ce1b50bf2a GRegex, GConvert: Add some missing annotations.
Also, removed pointless (allow-none) return annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=679762
2012-07-12 16:09:57 +02:00
Cosimo Cecchi
99f26ab08f mount-operation: add a Since tag to the show-unmount-progress signal 2012-07-11 20:26:16 -04:00
Cosimo Cecchi
44375ad7c5 mount-operation: add show-unmount-progress signal
The actual implementation will be in gvfs.

https://bugzilla.gnome.org/show_bug.cgi?id=676111
2012-07-11 19:57:42 -04:00
Tom Tryfonidis
37fbd702d5 Updated Greek translation 2012-07-12 02:38:20 +03:00
Rui Matos
eda1735029 GDBusNodeInfo: remove a spurious for loop
https://bugzilla.gnome.org/show_bug.cgi?id=679671
2012-07-11 03:27:29 +02:00
Rui Matos
6f23c33831 GDBusNodeInfo: the XML string must contain exactly one node element
Make the documentation clear about this.

https://bugzilla.gnome.org/show_bug.cgi?id=679671
2012-07-11 03:27:29 +02:00
Colin Walters
f7abd3ce13 Add g_spawn_check_exit_status()
Many (if not "almost all") programs that spawn other programs via
g_spawn_sync() or the like simply want to check whether or not the
child exited successfully, but doing so requires use of
platform-specific functionality and there's actually a fair amount of
boilerplate involved.

This new API will help drain a *lot* of mostly duplicated code in
GNOME, from gnome-session to gdm.  And we can see that some bits even
inside GLib were doing it wrong; for example checking the exit status
on Unix, but ignoring it on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=679691
2012-07-10 18:03:56 -04:00
Dan Winship
82d914d808 gio: add g_async_result_is_tagged()
Rather than doing a two step first-check-the-GAsyncResult-subtype-then-
check-the-tag, add a GAsyncResult-level method so that you can do them
both at once, simplifying the code for "short-circuit" async return
values where the vmethod never gets called.

https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-07-10 10:49:20 -04:00