Commit Graph

15717 Commits

Author SHA1 Message Date
Ryan Lortie
62e5ee5514 gpollfilemonitor: don't emit after cancellation
GPollFileMonitor emits CHANGES_DONE_HINT after CHANGED signals, but it
doesn't check to ensure that the file monitor wasn't cancelled before it
does that.

If the original signal caused the monitor to be unreffed, cancelled and
destroyed, we would still end up emitting an extra signal on it.

Avoid that by checking first for cancellation.

https://bugzilla.gnome.org/show_bug.cgi?id=739424
2015-06-05 14:55:01 -04:00
Mikhail Zabaluev
16190d2dcd glib/genviron.c, GSubprocessLauncher: ain't no "filename encoding"
Removed all mentions of GLib file name encoding referring to
the environment strings. The env var content has no defined relation
to GLib's notion of filename encoding, or any encoding whatsoever.
It would be wrong to pass all UTF-8 strings through
g_filename_from_utf8() in order to put them into the environment,
for one thing.

https://bugzilla.gnome.org/show_bug.cgi?id=738185
2015-06-05 14:53:34 -04:00
Jan Safranek
b31a873fb3 GDBus: Add new call flag to allow interactive authorization
DBus has recently introduced new message flag
DBUS_HEADER_FLAG_ALLOW_INTERACTIVE_AUTHORIZATION, which tells that
caller is willing to wait for unspecified amount of time for the call
to return, as the service may perform interactive authorization (e.g.
using polkit).

https://bugzilla.gnome.org/show_bug.cgi?id=739616
2015-06-05 14:35:34 -04:00
Ryan Lortie
865ce79ce0 GActionGroupExporter: flush queue on requests
In order to maintain a logical stream of events, we need to make sure we
flush and queued change notifications before responding to any requests
for information from clients.

If we don't do this, it's possible that we emit an 'add' event that was
queued at the time of a 'DescribeAll' call _after_ the reply to that
call (which already contained the description of the new action).

In practice, this is not only logically incorrect, but it can also cause
problems.  If a change to action 'state' or 'enabled' occurs after the
DescribeAll but before the signal has been dispatched, it will be
ignored because an 'add' signal is already pending.  When that add
signal is sent, it will contain the correct data, but the receiver will
ignore it because it already saw the action in the DescribeAll reply.

https://bugzilla.gnome.org/show_bug.cgi?id=749693
2015-06-05 12:36:36 -04:00
Ryan Lortie
eeae7950fc GActionGroup: fix an annotation
.get_action_state_type() does not return a copy.

We remove the annotation entirely because it is evident from the 'const'
on the return type.

https://bugzilla.gnome.org/show_bug.cgi?id=730168
2015-06-05 12:36:09 -04:00
Matthias Clasen
96df2727f4 win32: Make g_content_type_get_mime_type work for directories
Now that we are using inode/directory for directories, handle
this case in g_content_type_get_mime_type() as well.
2015-06-05 12:30:15 -04:00
Руслан Ижбулатов
5f0665cbbc W32: Special treatment for inode/directory mime/type
This is a hack for GLocalFileInfo to correctly get icons for directories.
Without this change content type for any W32 directory is NULL
(because there's no registry entry for "inode/directory" by default,
and in any way there's no file extension that means "directory" to put there),
and GLocalFileInfo uses content type to grab icons.

https://bugzilla.gnome.org/show_bug.cgi?id=748727
2015-06-05 12:28:09 -04:00
Matthias Clasen
9931336d2d win32: Return proper icon names
The code here was returning gtk-directory and similar names as
fallback, with a comment claiming that these are 'builtin gtk'.
But they aren't, anymore, so just return the standard names.
2015-06-05 12:26:41 -04:00
Matthias Clasen
c20f3b239c Fix a markup confusion
"0." at the beginning of a line is interpreted as a numeric list
by the gtk-doc markdown parser, so be careful to avoid that.

https://bugzilla.gnome.org/show_bug.cgi?id=750399
2015-06-05 11:54:40 -04:00
Matthias Clasen
07b3595c23 Trivial: fix a typo
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=750399
2015-06-05 11:54:40 -04:00
Philip Withnall
c94e4c6f03 gsettings: Add a documentation section on relocatable schemas
https://bugzilla.gnome.org/show_bug.cgi?id=741788
2015-06-05 13:02:33 +01:00
Stefan Ekenberg
338741fff5 Prevent race condition in g_io_condition_get_type
Prevents race condition in function g_io_condition_get_type by ensuring
that the initialization section for 'etype' is executed only once
during a program's life time, and that concurrent threads are blocked
until initialization completes. This changes solves the problem that
concurrent threads could execute the check 'etype == 0' before any of
them had initialized it, which in turn meant that multiple threads
would then attempt to register the "GIOCondition" type.

https://bugzilla.gnome.org/show_bug.cgi?id=750386
2015-06-04 22:30:50 -04:00
Matthias Clasen
6c43b6a21a Trivial: fix a comment typo 2015-06-04 19:25:42 -04:00
Balázs Úr
cac0a49ca0 Updated Hungarian translation 2015-06-04 21:03:10 +00:00
Garrett Regier
bdc3f149ec binding: Simplify the default transform func
https://bugzilla.gnome.org/show_bug.cgi?id=750369
2015-06-03 17:46:57 -07:00
Garrett Regier
ace7f6861e binding: Remove conditional from the default transform function
Avoiding checking for INVERT_BOOLEAN each and
instead choose the correct function in constructed().

https://bugzilla.gnome.org/show_bug.cgi?id=750369
2015-06-03 17:46:57 -07:00
Garrett Regier
36593a3aba binding: Remove GObject data usage
It isn't actually doing anything, instead it is
being managed without actually being used.
This has the result that GBinding is now more
thread-safe.

https://bugzilla.gnome.org/show_bug.cgi?id=745013
2015-06-03 17:46:57 -07:00
Piotr Drąg
f68582356d Updated POTFILES.in 2015-06-03 19:02:12 +02:00
Xavier Claessens
0d8dd2cf5c doc: add GTlsInteractionClass
https://bugzilla.gnome.org/show_bug.cgi?id=750344
2015-06-03 10:19:02 -04:00
Alexander Larsson
7cba800a84 GNetworkMonitorNetlink: Fix check for non-kernel messages
This code used to look at the SCM_CREDENTIALS and ignore every message
not from uid 0. However, when user namespaces are in use this does not
work, as if uid 0 is not mapped you get overflowuid instead. Right now
this means we ignore all messages in such user namespaces and glib
apps hang on startup.

We can't look at pids either, as pid 0 is returned for processes
outside your pid namespace.

Instead the correct approach is to look at the sending sockaddr and
if the port id (nl_pid) is zero, then its from the kernel.

Source:
http://lists.linuxfoundation.org/pipermail/containers/2015-May/036032.html

https://bugzilla.gnome.org/show_bug.cgi?id=750203
2015-06-03 08:52:54 +02:00
Alexander Larsson
f8273f39a1 Add GNativeSocketAddress for handling "other" addresses
Instead of just dropping address types that we're not specifically
handling we return a GNativeSocketAddress which is just a dummy
container for the stuct sockaddr.

https://bugzilla.gnome.org/show_bug.cgi?id=750203
2015-06-03 08:52:54 +02:00
Mattias Ellert
f7b13e05f9 thread: Check sysconf value before using it
sysconf() is documented as returning -1 if it can't determine
a minimum thread stack size. Check for this case before using
the return value.

https://bugzilla.gnome.org/show_bug.cgi?id=739122
2015-05-28 21:54:52 -04:00
Matthias Clasen
916297be79 Add a global signal handler table
Add a global lookup table for signal handlers. We already give
them a unique ID, so there is no good reason to pay for
non-constant lookups when disconnecting handlers.

https://bugzilla.gnome.org/show_bug.cgi?id=737009
2015-05-27 14:41:19 -04:00
Matthias Clasen
8a97dc5652 Add a performance test for signal connection
This test checks the performance of connecting, disconnecting and
blocking many handlers. Various cases are checked: disconnect in
the same order, in the inverse order, at random. Connect to one
signal on a single object, to two signals on the same object, or
to the same signal on two different objects.

https://bugzilla.gnome.org/show_bug.cgi?id=737009
2015-05-27 14:41:19 -04:00
Daniel Mustieles
ff1381e31e Updated Spanish translation 2015-05-26 19:25:56 +02:00
Matthias Clasen
102ac0e776 2.45.2 2015-05-25 23:30:07 -04:00
Matthias Clasen
126c685f4a GOptionContext: Improve help in simple cases
Only add [OPTION...] to the usage line if the context
has options. And shorten "Application Options" to just
"Options" if we don't have to differentiate from other
kinds of options.
2015-05-25 13:29:58 -04:00
Emmanuele Bassi
525bbbd6bd Do not use a string literal when a format string is expected
Otherwise we'll get compiler errors.

Based on a patch by: Vincent Le Garrec <legarrec.vincent@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=696749
2015-05-25 14:04:06 +01:00
Emmanuele Bassi
5e7e058a9c docs: Add an example of G_DEFINE_BOXED_TYPE
Mention that the GType of the boxed type is stored inside the
g_define_type_id variable.

See bug: https://bugzilla.gnome.org/show_bug.cgi?id=723394
2015-05-25 14:02:43 +01:00
Akom Chotiphantawanon
7313195ae7 Updated Thai translation 2015-05-24 17:42:33 +07:00
Dušan Kazik
13a9e8b7a6 Updated Slovak translation 2015-05-23 20:36:38 +00:00
David Shea
3bd703e9c4 Add introspection annotations to GListStore
GListStore requires that item-type be derived from GObject, so specify
that the type of the item parameters is GObject so the functions can be
used via gobject-introspection.

Add a scope parameter for the callback used during insert_sorted.
2015-05-23 22:18:14 +02:00
Matthias Clasen
074fe89f22 glib-compile-schemas: Improve an error message
Mention the expected type when failing to parse a GVariant.
2015-05-15 22:53:41 -04:00
Matthias Clasen
aecac6e1cb glib-compile-schemas: Show error positions
GMarkup provides this information, pass it on.
2015-05-15 22:41:29 -04:00
Jordi Mas
d853ceddb5 Fixes to Catalan translation 2015-05-15 22:14:44 +02:00
Alexandre Franke
4c1f716ef6 Updated French translation 2015-05-15 08:46:51 +00:00
Simon McVittie
ace7846322 regex test: do not assert that system PCRE still has an 8.31 bug
This was fixed in 8.32, so if we have that version, assert that it is
fixed; if we don't (e.g. the current internal pcre), still don't
assert that it *isn't* fixed.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=733325
Reviewed-by: Christian Persch <chpe@gnome.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-14 18:39:57 +01:00
Iain Lane
fe1a2dc196 gdbus tests: wait up to 60s for gdbus-testserver to take its bus name
Previously, we waited up to 0.5s, but that can fail on slow
architectures like ARM; now we wait up to 60s in 0.1s increments.

Patch originally by Simon McVittie <simon.mcvittie@collabora.co.uk>,
modified by Iain Lane to be called earlier, to catch all testcases in a
particular test.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=724113
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Acked-by: Matthias Clasen <mclasen@redhat.com>
2015-05-14 12:11:57 +01:00
Simon McVittie
3beb67f9f3 gdbus-connection: wait up to 10s to actually send a message
We previously waited 0.25s, which should be enough even on slow machines,
but you never know; but we also now wait in 0.1s increments, so this test
should actually be faster now.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=724113
Acked-by: Matthias Clasen <mclasen@redhat.com>
2015-05-14 12:11:20 +01:00
Garrett Regier
f1c2e70345 Connect to the detailed notify signal in GBinding
This avoids the notify handler being called for each
and every emitted notify.

https://bugzilla.gnome.org/show_bug.cgi?id=749353
2015-05-14 03:58:53 -07:00
Garrett Regier
b07ba8ed3b Fix g_binding_unbind() when the source and target are the same
It tried to remove a weak ref, but it is only taken if the
source and target object are different.

https://bugzilla.gnome.org/show_bug.cgi?id=749352
2015-05-14 03:58:53 -07:00
Philip Withnall
31496767c7 gresource: Document generated C file function naming
Mention the relationship to the --c-name argument, plus the need to call
some_prefix_get_resource() to get the GResource object.
2015-05-14 08:31:22 +01:00
Philip Withnall
a8c157f92b gresource: Minor capitalisation fixes in documentation 2015-05-14 08:15:46 +01:00
Philip Withnall
6ac2e8c79a gmessages: Tweak docs for G_LOG_DOMAIN to use AM_CPPFLAGS
Instead of INCLUDES, which is deprecated in automake. Using AM_CPPFLAGS
also gives the hint that the -D argument should be a CPPFLAGS variable,
rather than CFLAGS.
2015-05-13 15:22:57 +01:00
Garrett Regier
29d380cc5b gtype: Bump allowed number of children
Restricting the number of children to be less than 4095 can
be an issue when generating types. This is also an issue for
the Lua bindings as each Lua state will create a new GType each
time the Lua code is executed.

https://bugzilla.gnome.org/show_bug.cgi?id=747882
2015-05-12 05:30:46 -07:00
Simon McVittie
45dae4b506 tests: replace most g_print() with g_printerr()
I searched all files that mention g_test_run, and replaced most
g_print() calls. This avoids interfering with TAP. Exceptions:

* gio/tests/network-monitor: a manual mode that is run by
  "./network-monitor --watch" is unaffected
* glib/gtester.c: not a test
* glib/gtestutils.c: not a test
* glib/tests/logging.c: specifically exercising g_print()
* glib/tests/markup-parse.c: a manual mode that is run by
  "./markup-parse --cdata-as-text" is unaffected
* glib/tests/testing.c: specifically exercising capture of stdout
  in subprocesses
* glib/tests/utils.c: captures a subprocess's stdout
* glib/tests/testglib.c: exercises an assertion failure in g_print()

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=725981
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-11 20:24:56 +01:00
Simon McVittie
064183a633 GFileMonitor test: use g_test_skip() instead of g_print()
This stops it from interfering with structured stdout such as TAP.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=725981
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-11 20:24:52 +01:00
Simon McVittie
0a9d91ab7b testglib: my_hash_callback_remove_test: actually fail the test
The test is to remove all the odd values with my_hash_callback_remove(),
then iterate over all values and verify that they are even. However,
failing this check would just print "bad!" instead of failing the test.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=725981
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-11 20:24:50 +01:00
Simon McVittie
4865538ce3 GTestDBus: use g_printerr() for status message
This avoids any possibility of interfering with test syntax (such as
TAP) on stdout. TAP specifically does not parse stderr.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=725981
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-11 20:24:30 +01:00
Simon McVittie
472dee3909 gdatetime test: don't assume that time stands still
If we call time(NULL), then do something (however trivial), then call
g_date_time_new_now_utc(), they do not necessarily share a seconds
value. Let's say the gmtime call takes 2ms. time(NULL) could
return xx:xx:23 when the time is actually xx:xx:23.999999, resulting
in the g_date_time_new_now_utc() happening at xx:xx:24.000001. This is
unlikely, but did happen to me in a parallel build:

GLib:ERROR:.../glib/tests/gdatetime.c:674:test_GDateTime_now_utc: assertion failed (tm.tm_sec == g_date_time_get_second (dt)): (23 == 24)

A similar argument applies to the rollover from xx:23:59.999999 to
xx:24:00, so comparing seconds with a 1s "fuzz" or a >= comparison
is not sufficient; and so on into higher-order fields.

I haven't seen the other tests that use _now() fail in the same way,
but they could.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=749080
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-11 17:48:02 +01:00