14116 Commits

Author SHA1 Message Date
Cédric Valmary
7275d1a893 Update Occitan translation 2016-10-12 08:21:33 +00:00
Pedro Albuquerque
230df379b4 Updated Portuguese translation 2015-10-07 09:03:16 +00:00
Colin Walters
359e63b44a g_file_copy: Don't set GError when we intend to ignore errors
For better or worse, the current g_file_copy intention was to ignore
errors copying metadata, but we still set the GError, while returning
TRUE.

https://bugzilla.gnome.org/show_bug.cgi?id=727559
2014-05-07 12:59:55 +01:00
Ryan Lortie
d5e172f894 GSettingsBackend: fix a nasty race condition
In the event that a GSettings object is being destroyed just as a change
signal is being delivered, the destroying thread will race with the
dconf worker thread for acquiring the lock on the GSettingsBackend.

If the signalling thread gets there first then the destroying thread
will block on the lock.  The signalling thread adds a reference to the
GSettings object that is being destroyed and releases the lock.  The
idea is that this should prevent the GSettings object from being
destroyed and thus maintain its entry in the list.  Unfortunately, the
weak reference notify function is already running and as soon as we
release the lock, the list entry is removed.

The signalling thread crashes.

This bug is indicative of a serious problem encountered in many
situations where GObject instances are touched from multiple threads.
Ideally, we will move to a place where g_object_ref() is not called at
all on the GSettings object from the dconf worker thread and instead, a
dispatch will be done without holding a reference (similar to how
GAppInfoMonitor presently works).  This would also prevent the
unfortunate case of someone dropping what they assume to be the last
reference on a GSettings object, only to have an already-pending signal
delivered once they return to the mainloop, crashing their program.

Making this change for GSettings (with multiple instances per thread,
the possibility of multiple backends and each instance being interested
in different events) is going to be extremely non-trivial, so it's not a
change that makes sense at this point in the cycle.

For now, we can do a relatively small and isolated tweak so that we
never access the list except under a lock.  We still perform the bad
pattern of acquiring a ref in a foreign thread which means that we still
risk delivering a signal to a GSettings object that the user has assumed
is dead (unless they explicitly disconnect their signal handler).  This
is a problem that we already had, however.

https://bugzilla.gnome.org/show_bug.cgi?id=710367
2014-04-05 10:38:45 +02:00
Ryan Lortie
512a1a63be gsettingsbackend: a minor simplification
Change the order of the arguments on the (internal) keys_changed callback in
GSettingsListenerVTable.

This means that all functions in the table now fit the following signature:

  void (* f) (GObject             *target,
              GSettingsBackend    *backend,
              const gchar         *name_or_path,
              gpointer             origin_tag,
              const gchar * const *names);

allowing the possibility of arguments ignored at the end.

This allows us to simplify our dispatch-to-thread code in GSettingsBackend,
making it a bit less generic.

So far, this should be a straight refactor.

https://bugzilla.gnome.org/show_bug.cgi?id=710367
2014-04-05 10:38:44 +02:00
Marek Kasik
7adb090d99 GApplication: Don't decrease use_count below 0
Place an assert for use_count to be at least 1
in g_application_release() so we don't decrease
it below 0.

https://bugzilla.gnome.org/show_bug.cgi?id=727551
2014-04-04 16:19:37 +02:00
Shankar Prasad
a0e9f6d36f updated kn.po 2014-02-05 15:34:04 +05:30
Matthias Clasen
13e3f5aeb6 Drop a no-longer-existing example from the docs
gapplication-example-menu.c was dropped in
0c094d660769a00564ef33a775a387f62cf2ff41, two years ago.
Time to remove its inclusion in the docs too.

https://bugzilla.gnome.org/show_bug.cgi?id=722973
2014-01-28 22:28:19 -06:00
Emmanuele Bassi
e4fa38a0f9 docs: Add missing GTest functions
The GTest message API is missing from the reference.
2014-01-20 20:07:04 +00:00
Wylmer Wang
14a19ff41a Update Chinese simplified translation 2014-01-05 14:53:05 +08:00
Dimitris Spingos
911f3449d1 Updated Greek translation 2014-01-03 10:54:39 +02:00
Damien Lespiau
8c2f7c09f3 gobject.py: Don't install frame filters when GDB does not support them
Stock GDB (both versions 7.0 and 7.1) does not come with the new
backtrace code and python API. To prevent an ugly python backtrace when
auto-loading gobject.py, let's catch the exception and not register the
FrameWrapper and the FrameFilter.

https://bugzilla.gnome.org/show_bug.cgi?id=613732
2013-12-27 08:33:00 -06:00
Antoine Jacoutot
ee5a9fa246 kqueue: fix a potential deadlock
In case an object is already monitored, we lock then return without
unlocking it which can then result in a self deadlock. So properly
unlock before returning.

https://bugzilla.gnome.org/show_bug.cgi?id=721074
2013-12-26 16:04:52 -05:00
Chun-wei Fan
e17ecc421b gio/gdbusaddress.c: Fix RunDLL call for Windows/x64 builds
On x64 builds under both Visual C++ and MinGW-64, the correct symbol for
the RunDLL call is g_win32_run_session_bus, so this will silence the
annoying RunDLL error for x64 MinGW builds as well, and will allow this
call to be executed more than once.

Thanks to Tarnyko for pointing this out.
2013-12-12 18:06:29 +08:00
Martin Pitt
5c8d42f106 gdesktopappinfo: Add missing annotations
Add missing (allow-none) annotations to
g_desktop_app_info_launch_uris_as_manager(). Tested with

  python -c "from gi.repository import GLib, Gio; Gio.DesktopAppInfo.new('gcalctool.desktop').launch_uris_as_manager([], None, GLib.SpawnFlags.SEARCH_PATH|GLib.SpawnFlags.STDOUT_TO_DEV_NULL, None, None, None, None)"

which is necessary to do a launch_uris() without leaking stdout.

https://launchpad.net/bugs/1259721
2013-12-11 13:38:02 +01:00
William Orr
32c42dacc1 glocalfile: Only use O_DIRECTORY if available
Solaris 10 for example doesn't have it.

https://bugzilla.gnome.org/show_bug.cgi?id=708860
2013-12-10 04:08:12 -05:00
Rui Matos
b9f54c4e9a GDBusObjectManagerClient: keep the manager alive while firing signals
Handlers for the signals we emit might unref the object manager. Make
sure we keep it alive until we are done with it.

https://bugzilla.gnome.org/show_bug.cgi?id=719402
2013-11-27 16:16:35 +01:00
Chun-wei Fan
1498c2bfe4 glib/gspawn-win32-helper.c: Clean up a bit
Remove the parts about storing up the fd's in a data structure, but call
close() on the fd's.  However, retain the _get_osfhandle() check on the
fd's when we iterate through the fd's as on fd values in the iteration may
well be invalid fd's.  As a result, the invalid parameter handler is still
needed for newer Microsoft CRTs (8.0/2005+) for _get_osfhandle() to
make sure that the program does not abort when we check the validity of
fd's to be closed in the loop[1].

[1]: http://msdn.microsoft.com/en-us/library/ks2530z6%28v=vs.80%29.aspx
2013-11-13 17:15:24 +08:00
Ryan Lortie
96f0579909 GLib 2.38.2 2.38.2 2013-11-12 10:26:37 -05:00
Dan Winship
bbf7b49391 gcancellable: don't use g_cancellable_connect() in GCancellableSource
g_cancellable_connect() is documented as calling its callback only
once, but GCancellableSource should trigger every time the cancellable
is cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=710691
https://bugzilla.gnome.org/show_bug.cgi?id=711286
2013-11-11 09:39:20 -05:00
Ognyan Tonchev
1a0ad835da gmain: make g_source_add_child_source() thread safe
g_source_add_child_source() releases the context lock before attaching
child_source to context. And this causes trouble if parent source is
blocked and g_main_dispatch() manages to lock the context mutex and call
unblock_source() before child_source gets attached to context.
To fix this we call g_source_attach_unlocked() before releasing the
context mutex.

https://bugzilla.gnome.org/show_bug.cgi?id=711064
2013-11-11 09:39:01 -05:00
Dan Winship
cbdb729e43 Fix overloading of "source" and "target" terminology in GBinding
GBindingTransformFunc called its arguments "source_value" and
"target_value", but in the transform_from function of a bidirectional
binding, "source_value" comes from the target object, and
"target_value" comes from the source object, which quickly gets
confusing if you need to use g_binding_get_source(), etc, in the
function.

Of course developers can call their transform function arguments
whatever they want, but many will copy from the headers/docs to start
out, so use less confusing names here ("from_value" and "to_value").

Also, fix the documentation to describe the bidirectional case
correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=709440
2013-11-11 09:37:48 -05:00
Philip Withnall
6e18d05a0d gdbus: Ensure message matching always succeeds against path_namespace='/'
This copies the fix from upstream D-Bus bug
https://bugs.freedesktop.org/show_bug.cgi?id=70799 to the GDBusDaemon
implementation, ensuring that matching against path_namespace='/' succeeds
for all keys (i.e. it’s a no-op).

https://bugzilla.gnome.org/show_bug.cgi?id=710726
2013-11-06 09:24:28 +00:00
Philip Withnall
ffb9bb1f79 gdbus: Work around a D-Bus bug with path_namespace='/' match rules
D-Bus versions < 1.6.18 (i.e. all current versions) have a bug with the
path_namespace='/' match rule key. It should conceptually match everything,
but actually matches nothing. This results in no property change (or other)
signals being forwarded to the D-Bus client.

The work-around implemented in GDBusObjectManagerClient is to remove the
path_namespace match key if its value is ‘/’.

For the upstream D-Bus bug, see:
https://bugs.freedesktop.org/show_bug.cgi?id=70799

https://bugzilla.gnome.org/show_bug.cgi?id=710726
2013-11-06 09:24:16 +00:00
Ross Lagerwall
685ff5c556 gio: Clear error properly to prevent crash
https://bugzilla.gnome.org/show_bug.cgi?id=711070
2013-10-29 17:08:15 +02:00
Olivier Brunel
0e678ae92f gthemedicon: Fallback to non-symbolic icons
When doing fallback for symbolic icons, we first shorten the name at dashes
while preserving the -symbolic suffix. But after exhausting that, we should also
try stripping the suffix.

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

Signed-off-by: Olivier Brunel <jjk@jjacky.com>

https://bugzilla.gnome.org/show_bug.cgi?id=710254
2013-10-24 08:21:12 -04:00
Ryan Lortie
90a53576e2 appinfo: Don't try DBusActivatable with load_from_keyfile
We can't get the name of the filename, so we can't determine the application
ID.  We'll have to fallback on Exec= for this case.

https://bugzilla.gnome.org/show_bug.cgi?id=709326
2013-10-22 10:18:46 -04:00
Colin Walters
44edc3829d g_file_copy: Fall back to pathname queryinfo to help gvfs backends
It's not difficult to do; not all backends implement it, and for some
it may be difficult to implement query_info_on_read(), so let's just
do both.

https://bugzilla.gnome.org/show_bug.cgi?id=706254
2013-10-16 16:08:47 -04:00
Ryan Lortie
71c6dfdcc0 bump version 2013-10-15 16:39:20 -04:00
Ryan Lortie
158b7ea01f GLib 2.38.1 2.38.1 2013-10-15 15:14:29 -04:00
Carles Ferrando
08c1ead082 [l10n] Updated Catalan (Valencian) translation 2013-10-14 00:03:51 +02:00
John Ralls
859b3aa3dc Restore gl_GLIBC21 to configure; needed for libcharset 2013-10-04 11:52:34 -07:00
Ryan Lortie
d01bded193 g_settings_list_children: only list viable schemas
Don't return children with invalid schemas from
g_settings_list_children() (ie: missing schemas or mismatched paths).
This prevents gsettings list-recursively from crashing when broken
schemas are installed on the system.

https://bugzilla.gnome.org/show_bug.cgi?id=705688
2013-10-02 12:37:41 -04:00
Мирослав Николић
03a859aeaf Updated Serbian translation 2013-10-01 09:49:49 +02:00
John Ralls
8372f22b26 Fix the -Werror=format-nonliteral fixes for older GCCs
They don't allow that pragma inside functions.
2013-09-29 11:34:55 -07:00
John Ralls
7c8dcd32b9 More -Werror=format-nonliteral fixes
This fixes the build with CLang.

https://bugzilla.gnome.org/show_bug.cgi?id=702516
2013-09-29 11:34:55 -07:00
Colin Walters
55e6a475b6 gfileutils: Make -Werror=format-nonliteral happy
I tried to please it by using G_GNUC_FORMAT, but that didn't work, so
let's just fall back to pushing an ignore.

https://bugzilla.gnome.org/show_bug.cgi?id=702516
2013-09-29 11:34:55 -07:00
Dan Winship
92f6cbf528 gmessages: fix clang annotations to work with older versions
https://bugzilla.gnome.org/show_bug.cgi?id=708793
2013-09-28 12:32:18 -04:00
Dan Winship
04520d7d81 gio: make gnetworking.h nodist
https://bugzilla.gnome.org/show_bug.cgi?id=708972
2013-09-28 12:19:06 -04:00
Kjartan Maraas
0211694a7d Updated Norwegian bokmål translation 2013-09-26 21:20:29 +02:00
Yuri Myasoedov
8fb563dc67 Updated Russian translation 2013-09-25 23:11:08 +04:00
James Strandboge
96df8b180b gio: Fix typo in the /org/freedesktop/DBus path
https://bugzilla.gnome.org/show_bug.cgi?id=708677
2013-09-24 09:29:35 -04:00
Svante Signell
3cff224675 gio/gsocket.c: Fix error code checks when SOCK_CLOEXEC is defined but
not supported on GNU/Hurd.

https://bugzilla.gnome.org/show_bug.cgi?id=708266
2013-09-24 09:00:16 -04:00
Ryan Lortie
c8de2b11bb GLib 2.38.0 2.38.0 2013-09-23 17:07:33 -04:00
Ryan Lortie
9da87f597c fix up refcount/properties test case
Recent changes to the properties testcase made invalid use of the GArray
free function.  This free function takes a pointer to the item to be
freed, not the item itself.  Since that item was a pointer to a GObject,
g_object_unref() was getting a GObject**, rather than a GObject*.

The use of GArray in this testcase is pretty questionable in the first
place, so just use C arrays instead.
2013-09-23 17:07:33 -04:00
Ryan Lortie
748c86e45f gio docs: add some missing functions 2013-09-23 17:07:33 -04:00
Ryan Lortie
abf505fd0e More gio-du win32 fixes
Don't free the utf8 filename before the async function completes.

also, gitignore
2013-09-23 16:31:40 -04:00
Ryan Lortie
6d08d1191b Revert "gcancellable: allow g_cancellable_disconnect from "cancelled" handler on same thread"
This reverts commits 83605e2d0a7b0d39987715cfd046f7b8ef6de94e and
140fa7ee4669adb3827e3ddea5be57f51ee7af3e.
2013-09-23 16:15:52 -04:00
Alexander Larsson
140fa7ee46 cancellable: Minor fix to docs
The code uses "my_data", not "data" everywhere else.
2013-09-23 09:11:04 +02:00
Ray Strode
83605e2d0a gcancellable: allow g_cancellable_disconnect from "cancelled" handler on same thread
g_cancellable_disconnect will wait until any pending "cancelled"
handlers finish.  This is useful because disconnecting a handler can have the
side-effect of freeing data that the cancelled handler may rely on.
Unfortunately, the code used to enforce this synchronization between
"cancelled" handlers and g_cancellable_disconnect will also cause
deadlock if the cancelled handler itself calls g_cancellable_disconect.

Obviously, if g_cancellable_disconnect is explicitly called by a "cancelled"
handler, then the "cancelled" handler is shouldering the responsibility
of not using any data that may be freed by disconnection.

Also, g_cancellable_disconnect can be called in unexpected places by
lower layers in the code (for instance as a result of g_source_destroy).
In practice, this means it's easy for deadlocks to inadvertently crop
up when using "cancelled" handlers.

For these reasons, it would be good to fix the deadlock.

This commit prevents the deadlock by allowing foregoing synchronization,
if a pending "cancelled" handler is in the same thread as the
g_cancellabale_disconnnect call.

https://bugzilla.gnome.org/show_bug.cgi?id=705395
2013-09-23 09:09:48 +02:00