Commit Graph

10608 Commits

Author SHA1 Message Date
Ryan Lortie
1b03391984 Merge remote-tracking branch 'gvdb/master' 2011-09-12 08:12:57 -04:00
Ryan Lortie
92652ac791 hashing: always use signed chars
Our hashing of non-ASCII strings was undefined due to the fact that
'char' is signed on some platforms, unsigned on others.  Always use a
signed char.

Discovered by Alexander Larsson.

https://bugzilla.gnome.org/show_bug.cgi?id=658806
2011-09-12 08:12:44 -04:00
Matthias Clasen
2d44a45b6b GDesktopAppInfo: Improve docs 2011-09-12 01:56:45 -04:00
Matthias Clasen
05342d0a93 Fix formatting in a doc comment 2011-09-12 01:49:01 -04:00
Matthias Clasen
73c427fab9 Expand mimeapps test
This adds a test involving both defaults.list and mimeapps.list.
2011-09-12 01:46:48 -04:00
Matthias Clasen
2ba5a79a70 Also check api results
In addition to looking at mimeapps.list, check that the default
and recommended apps returned by g_app_info api are as expected.
2011-09-11 23:39:29 -04:00
Matthias Clasen
75c989b9ab Revert "Fix default setting generation in g_desktop_app_info_set_as_last_used"
This reverts commit a13f5ca4da.
2011-09-11 23:28:45 -04:00
Matthias Clasen
938e57dd4b Adapt tests to string changes 2011-09-11 23:28:44 -04:00
Ryan Lortie
cab5b8abd3 GType tutorial: clarify class struct initialisation
Make the information on how the class structure is initialised less
confusing to first-time readers.
2011-09-11 15:48:47 -04:00
Matthias Clasen
61b51555ec Cosmetics
Make configure --help output a little more regular, by using
AC_HELP_STRING() more consistently.
2011-09-11 13:15:29 -04:00
Jorge González
5b86231251 Updated Spanish translation 2011-09-11 11:05:50 +02:00
Matthias Clasen
0db179e75e GKeyFile: Unify error messsages a bit
This marks a few forgotten error messages for translation, and
makes some other strings more uniform. String change!

https://bugzilla.gnome.org/show_bug.cgi?id=658715
2011-09-10 16:10:49 -04:00
Matthias Clasen
ec3653be00 glib-compile-schemas: Pedantic string fixes
Replace 'can not' by 'cannot' in several places. String change!

https://bugzilla.gnome.org/show_bug.cgi?id=658207
2011-09-10 10:36:56 -04:00
Gabor Kelemen
b1e04b2986 Updated Hungarian translation 2011-09-10 14:39:43 +02:00
Josselin Mouette
a13f5ca4da 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:26:12 +02:00
Matthias Clasen
011c0b488f Add some tests for mimeapps.list handling
These tests directly look at mimeapps.list to verify that
we make the expected changes to the database.
2011-09-09 23:44:41 -04:00
Matthias Clasen
66a1dfc84f Avoid some compiler warnings 2011-09-09 23:44:41 -04:00
Ryan Lortie
644ab6a7d3 Nix inaccurately named g_main_context_init_pipe()
...and fold its contents into g_main_context_new()
2011-09-09 22:33:33 -04:00
Ryan Lortie
1c8c408c51 gmain: get rid of poll_waiting
This variable, which is the cause of much grief, exists for two reasons:

  - ensuring the the wakeup pipe doesn't fill up

  - preventing the first poll() after adding a source from waking up
    immediately

The first point is no longer an issue with GWakeup.

The second point is addressed by using different logic: we only signal a
wakeup in the case that the context is currently acquired by a thread
that is not us.

As an added bonus, we can now implement g_main_context_wakeup() without
taking a lock.

https://bugzilla.gnome.org/show_bug.cgi?id=583511
https://bugzilla.gnome.org/show_bug.cgi?id=320888
2011-09-09 22:32:06 -04:00
Emmanuele Bassi
e15d5313af Add macros for GSourceFunc return values
The boolean values to be returned by a GSourceFunc are always ambiguous,
and even in case of experienced developers then can lead to confusion.

The Perl bindings for GLib have two simple constants, mapping to TRUE
and FALSE, that make the return values less confusing: G_SOURCE_CONTINUE
and G_SOURCE_REMOVE respectively.

https://bugzilla.gnome.org/show_bug.cgi?id=631413
2011-09-09 22:08:58 -04:00
Matthias Clasen
e5653c0050 Keep up with the standards
More choices, always better.
2011-09-09 20:37:09 -04:00
Ryan Lortie
066c7b8121 GRegex: fix thread-unsafe initialiser code 2011-09-09 19:54:06 -04:00
Ryan Lortie
f1494c156d Clean up l10n threading stuff
Remove the explicit thread initialisation functions for g_get_charset(),
g_get_filename_charsets() and g_get_language_names().

Add a lock around one remaining case of access to libcharset (the other
2 cases already have the lock).

Do a proper g_once_init_enter() style initialisation for the GLib
gettext functions.

https://bugzilla.gnome.org/show_bug.cgi?id=658683
2011-09-09 19:50:55 -04:00
Ryan Lortie
bceaf3a719 glib-private: #include <glib.h>
This is really our only choice if we don't want to annoy the
single-include checking when we use this from inside of gio.
2011-09-09 16:05:55 -04:00
Ryan Lortie
e27b5a2ea7 Drop long-removed atomic thread init from header 2011-09-09 15:47:01 -04:00
Ryan Lortie
9e1d4aa257 Remove now-useless glibprivate.h
The only symbol in glibprivate.h was moved to glib-private.h.
2011-09-09 15:21:07 -04:00
Ryan Lortie
d86386159d glib worker: move to glib-private framework
Remove the private glib_get_worker_context() symbol and move it over to
using the glib-private stuff like GWakeup is doing.

https://bugzilla.gnome.org/show_bug.cgi?id=657992
2011-09-09 14:32:00 -04:00
Ryan Lortie
3022ef4731 gwakeup.h: add missing header for GPollFD 2011-09-09 14:30:01 -04:00
Colin Walters
9bf59d4a14 Add glib__private__() API to share between glib,gio; port GWakeup to it
Historically we've added random symbols to the public API with warnings
that they're private; examples are:

glib_gettext(), glib_pgettext()
g_thread_functions_for_glib_use, g_thread_use_default_impl, etc.

And we almost added "GWakeup" to public API just to share between glib and
gio.

This new glib__private__() API exports a hidden vtable, and adds a macro
GLIB_PRIVATE_CALL() that makes it generally convenient to use.

This adds an extremely tiny cost for the double indirection; but it has
the benefit that we don't need to either:

1) compile the code into both glib and gio (like GWakeup), with the
   inefficiency that implies.
2) Export a "do not use this" symbol; the serious problem with this is
   that someone CAN use it pretty easily.  Particularly if we document
   it.  It's far, far harder to peek into a structure without a public
   header file.

https://bugzilla.gnome.org/show_bug.cgi?id=657992
2011-09-09 14:17:08 -04:00
Ryan Lortie
b891b3616f GMainLoop: remove wall clock time cache
Since GMainLoop is now purely monotonic, it really doesn't make sense to
cache the wallclock time just for the sake of making a deprecated call
more efficient.
2011-09-09 13:41:36 -04:00
Ryan Lortie
940a728fda gtester: Remove SIGCHLD race workarounds
With the GMainLoop changes, gtester should now be race-free.
2011-09-09 13:41:27 -04:00
Ryan Lortie
ba7019e19e Modify child and signal sources to use worker 2011-09-09 13:41:27 -04:00
Ryan Lortie
7eae486179 GMain: simplify logic for g_wakeup_acknowledge()
Instead of messing around with context->poll_waiting, just look at the
GPollFD to see if the GWakeup needs to be acknowledged.
2011-09-09 13:41:27 -04:00
Ryan Lortie
87880dfa57 GMainLoop: remove single-threaded case
Since we now always have thread support in libglib, we can remove the
buggy single-threaded codepath for GMainContext.
2011-09-09 13:41:27 -04:00
Ryan Lortie
1facd36d00 Add private glib_get_worker_context() API
The first time this is called, this creates a GMainContext * and a
thread to run it.  Future calls return the same.  There are a lot of
places that we could use this in GLib.
2011-09-09 13:40:50 -04:00
Ryan Lortie
b6a2f502f2 GRand: Make sure to g_thread_init_glib()
The last commit should g_thread_init_glib() before attempting to use
GOnce.
2011-09-09 13:39:22 -04:00
Ryan Lortie
71c72d5e13 GRand: remove setup from g_thread_init_glib
Use g_once_init_enter instead.
2011-09-09 13:31:21 -04:00
Ryan Lortie
413186a962 emufutex: remove init from g_thread_init_glib
Use a GStaticMutex instead.
2011-09-09 13:23:48 -04:00
Ryan Lortie
80109acef5 win32: remove version init from g_thread_init_glib
Instead, make this use g_once_init_enter() in the usual way.
2011-09-09 13:17:42 -04:00
Ryan Lortie
6c0dda8265 make g_thread_init_glib() idempotent 2011-09-09 12:47:40 -04:00
Ryan Lortie
cfa1d0540e Move the GThread implementations to glib/
We can now get threads initialised from inside of libglib by calling
g_thread_init_glib().
2011-09-09 12:47:40 -04:00
Ryan Lortie
96e4896804 invert gthread-impl includes
configure.ac defined G_THREAD_SOURCE and gthread-impl would #include it.

Instead, since we only have two thread implementations now, and since we
always use the Windows one only on Windows, move the logic to the
Makefile, predicated on 'if OS_WIN32'.  Then have the chosen backend do
the #include "gthread-impl.c" from there.

Remove the G_THREAD_SOURCE define from configure.ac.
2011-09-09 12:47:40 -04:00
Ryan Lortie
fc6a9275a4 win32 threads: assume TryEnterCriticalSection
Remove the dynamic lookup for TryEnterCriticalSection, which has existed
since Windows 2000.
2011-09-09 12:47:40 -04:00
Ryan Lortie
7cf89847e2 Stop using HAVE_G_THREAD_IMPL_INIT
Just always call the init function.
2011-09-09 12:47:40 -04:00
Ryan Lortie
46af418e05 Move thread priority translation into the backends
The translation of GLib priorities into the thread priorities of
different operating systems belongs in the implementation -- not
half-way in the front end.
2011-09-09 12:47:40 -04:00
Ryan Lortie
a4777122c8 Remove useless macros from when we supported DCE
These are non-ops now, and easily replaced.
2011-09-09 12:47:40 -04:00
Ryan Lortie
715f94e951 Remove support for DCE threads 2011-09-09 12:47:40 -04:00
Ryan Lortie
7d885253fa Remove support for custom thread implementations 2011-09-09 12:47:39 -04:00
Ryan Lortie
cef0acb945 Remove the dead 'none' thread implementation 2011-09-09 12:47:39 -04:00
Ryan Lortie
3f93141243 GThread: remove errorcheck mutex support
This can only possibly work if we call g_thread_init(), which we are
moving away from.
2011-09-09 12:47:39 -04:00