Commit Graph

17448 Commits

Author SHA1 Message Date
Philip Withnall
4976e81090 Revert "gmain: only signal GWakeup right before or during a blocking poll"
This reverts commit 9ba95e25b7.

It is causing undiagnosed problems with WebKit and other users of GLib.
See https://bugzilla.gnome.org/show_bug.cgi?id=761102#c44 and
https://bugzilla.gnome.org/show_bug.cgi?id=761102#c46.

Reverting it until someone works out what the problem is.

https://bugzilla.gnome.org/show_bug.cgi?id=761102
2018-01-03 11:28:32 +00:00
Emmanuele Bassi
e9757096c2 Keep the version in sync between Meson and Autotools
As long as we have both build systems, we're going to need to keep this
manually synchronised.
2018-01-01 21:28:03 +00:00
Christian Hergert
42ef8e9d32 socketlistener: fix event signature in vfunc
The GSocketListener::event signal has a type of GSocketListenerEvent,
which is an enum. However, the vfunc signature had a pointer, with
different sizing requirements. Given the alignment and prompostion
of some systems, you may still get the same call-site layout, but
that is not guaranteed.

This fixes the parameter to have the proper enumeration.

https://bugzilla.gnome.org/show_bug.cgi?id=791906
2017-12-25 00:13:00 -08:00
Emmanuele Bassi
4b661ad222 Do not generate marshaller aliases in source files
When generating the body of the marshallers, we need to skip aliases to
standard marshallers provided by GLib itself.

https://bugzilla.gnome.org/show_bug.cgi?id=790829
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2017-12-21 13:55:23 +00:00
Simon McVittie
da4cdc6890 gmenumodel test: Wait for the expected events to happen
Previously, we waited an arbitrary 100ms or 200ms and then asserted
that the events had happened, but that might fail if the machine is
slow or heavily loaded.

We still wait for an arbitrary time for negative tests (asserting
that no more signals are received) because we don't have any way
to do better here.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=791744
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884661
2017-12-21 10:38:21 +00:00
Simon McVittie
003c392a3b gmenumodel test: If something goes wrong, don't wait forever
I'm about to add some loops that would otherwise wait indefinitely.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=791744
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884661
2017-12-21 10:37:54 +00:00
Patrick Welche
2fc3948ba7 glib-mkenums: best effort attempt on non-utf8 encoded files.
Some source files aren't valid utf-8 containing for example
iso8859-1 accented characters in author's names.
Replace invalid data with a replacement '?' character and print a
warning to keep things working.
Based on a patch from Christoph Reiter in
https://bugzilla.gnome.org/show_bug.cgi?id=785113#c20
2017-12-13 13:43:44 +00:00
Sam Spilsbury
b6d4edbae8 mkenums: Don't raise when unlinking a file that does not exist
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=789637
2017-12-13 13:43:44 +00:00
Philip Withnall
f5d8956ec3 glib-genmarshal/glib-mkenums: Add comment clarifying licensing
Clarify the licensing of the code generated by the two scripts in a
comment in the header of each generated file. The intention is that the
license of GLib does *not* apply to the generated files; but that they
are subject to the linking restrictions of the LGPL, since they link to
GLib and GLib is licensed under the LGPL. The generated files themselves
are under the license of whatever project they’re generated for.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788990
2017-12-13 13:43:44 +00:00
Emmanuele Bassi
5fe01f182d Sort the list of files being processed by glib-mkenums
We should ensure a stable order when processing the files, regardless of
the order they were submitted on the command line, to increase the
chances of a reproducible build.

The old Perl-based version of glib-mkenums was fixed in commit 8686e430
to do the same.

https://bugzilla.gnome.org/show_bug.cgi?id=691436
2017-12-13 13:43:44 +00:00
Philip Withnall
0c7d52ba22 glib-mkenums: Add default comment template if none is provided
The fallback code for providing a default comment template only worked
if a template file was provided. It didn’t work if individual templates
were provided on the command line (and --comment wasn’t).

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788990
2017-12-13 13:43:44 +00:00
Philip Withnall
1d4afde2f1 glib-mkenums: Fix typo in version string
This is glib-mkenums, not glib-genmarshal.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-12-13 13:43:44 +00:00
Philip Withnall
08a8138934 docs: Split GSocketConnectable/GProxyAddressEnumerator documentation
Putting them in the same section causes gtk-doc to mix their properties
together in a single listing, which is confusing.

Since having them in a single section doesn’t really add anything, split
them out to one class per section.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=791334
2017-12-13 13:14:33 +00:00
Mario Sanchez Prada
620c50ba1e gio/tests/appinfo: New test for launch with "appId-less" applications
New test to make sure we exercise the code paths in gdesktopappinfo.c
that get triggered when g_desktop_app_info_launch_uris_with_spawn()
is used (i.e. unknown app ID, no session bus), both for when either
a single URI or multiple ones are expected by the application.

https://bugzilla.gnome.org/show_bug.cgi?id=791337
2017-12-08 13:50:21 +00:00
Mario Sanchez Prada
75681a8778 gdesktopappinfo: Gracefully handle NULL URIs when passed to expand_macro()
If an application calls g_app_info_launch_uris() with a GList that includes
NULL values in some of its data members, and GIO ends up internally calling
g_desktop_app_info_launch_uris_with_spawn() for whatever reason (e.g. no
D-Bus session available), expand_macro() will crash due to the invalid data.

As this is considered a programmer error, use g_return_val_if_fail() in those
situations to prevent the crash from happening, but printing a warning anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=791337
2017-12-08 13:50:21 +00:00
Mario Sanchez Prada
d42115b013 gdesktopappinfo: Pass a copy of the URIs list to expand_application_parameters()
This list will be modified in-place when calling expand_macro(), so pass a copy
of it instead the original pointer, that is supposed to be an input parameter
only for g_desktop_app_info_launch_uris_with_spawn().

https://bugzilla.gnome.org/show_bug.cgi?id=791337
2017-12-08 13:50:21 +00:00
Philip Withnall
2c066d5d39 gio: Fix querying of thumbnail attributes other than thumbnail::path
The thumbnail attributes would previously only be set if thumbnail::path
was included in the query — so querying for just thumbnail::is-valid
would return no results.

This fixes the behaviour of
    gio info -a thumbnail::is-valid ./some-file.png
vs
    gio info -a thumbnail ./some-file.png

The first command would previously list nothing. The second would
previously list a thumbnail::path and thumbnail::is-valid.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=791325
2017-12-07 13:05:14 +00:00
Arnaud Bonatti
5f3f830fc6 gio: Remove stray ‘<’ from gschema.dtd
The mathematical operator was making the DTD unusable.
Also, min and max can be equal with current parser.

https://bugzilla.gnome.org/show_bug.cgi?id=791267
2017-12-06 10:35:30 +00:00
a434d020b4 gtester-report: fix range usage when running as python3 app
When using python3 as interpreter, range only takes integer arguments or
it results in errors like:

   File "/usr/bin/gtester-report", line 78, in html_indent_string
     for i in range (0, (n + 1) / 2):
 TypeError: 'float' object cannot be interpreted as an integer

https://bugzilla.gnome.org/show_bug.cgi?id=791296
2017-12-06 10:08:49 +00:00
Arnaud Bonatti
4bbfb963ab Fix gschema.dtd regarding flags
https://bugzilla.gnome.org/show_bug.cgi?id=791235
2017-12-05 12:32:45 +00:00
Philip Withnall
c124fcf112 goutputstream: Fix pre-condition
Spotted by Izak van Langevelde.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=791036
2017-12-01 10:04:05 +00:00
Philip Withnall
ebe3fc2af8 inotify: Add missing commas
These were accidentally omitted from commit
748bb24985. My fault.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-28 14:42:14 +00:00
Carlos Garcia Campos
9b8f4faa4b gtester: do not consider skipped tests as failures
This is happening since f591366eee, that
changed the way tests were skipped to use g_test_skip() instead of just
ignoring them. They are now reported to the log with G_TEST_RUN_SKIPPED
as result.

https://bugzilla.gnome.org/show_bug.cgi?id=790934
2017-11-28 15:37:03 +01:00
Philip Withnall
3246f1df99 inotify: Don’t propagate unrecognised events to GLocalFileMonitor
If we can’t convert the inotify event mask into a GFileMonitorEvent enum
value, don’t propagate it to GLocalFileMonitor, since it hits an
assertion failure in that case.

This should no longer be possible since the previous commit to ignore
IN_Q_OVERFLOW events, but we might as well change this just in case
other bugs crop up in event mask handling.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=776147
2017-11-28 13:57:07 +00:00
Philip Withnall
d97e077090 inotify: Ignore IN_Q_OVERFLOW events
There’s not much we can do about them, and if they go unhandled, they
can propagate through to g_file_monitor_source_handle_event() and cause
assertion failures due to not mapping to a GFileMonitorEvent.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=776147
2017-11-28 13:57:07 +00:00
Philip Withnall
38ec9c6da3 kqueue: Fix invalid emission of G_FILE_MONITOR_EVENT_MOVED event
That event is deprecated, and the kqueue backend can’t provide enough
information to go alongside the event (i.e. the name of the new file).
Use G_FILE_MONITOR_EVENT_DELETED instead.

Quite disappointed in the kqueue documentation for this: I cannot find a
single piece of documentation or example about how NOTE_RENAME is
supposed to communicate the new name of the file.

If it turns out that this is possible, the code can be amended again in
future. At least now it doesn’t abort.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=776147
2017-11-28 13:57:07 +00:00
Philip Withnall
20648cdc29 tests: Work around a gdb bug in assert-msg-test
It seems that when GLib is compiled without CFLAGS=-g, gdb can’t work
out the size of __glib_assert_msg, so assumes it’s 4 bytes — even on
64-bit systems. This causes it to not read the most significant 4 bytes
of the assertion message pointer, and hence it can’t print the stored
assertion message. This causes assert-msg-test to fail.

The upstream gdb bug is
https://sourceware.org/bugzilla/show_bug.cgi?id=22501.

Work around that by referencing and dereferencing __glib_assert_msg so
that gdb treats it as a pointer of sizeof(char*) rather than of the size
it incorrectly calculated from the library’s symbol table (or through
some other mystical process).

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=782057
2017-11-27 11:45:02 +00:00
Sebastian Dröge
23373d7f7e GResource – Add note to documentation that the memory must be at least pointer aligned
https://bugzilla.gnome.org/show_bug.cgi?id=790030
2017-11-14 14:59:12 +00:00
Tim-Philipp Müller
97293636af meson: dist python script used also in autotools-generated tarball
https://bugzilla.gnome.org/show_bug.cgi?id=790126
2017-11-10 21:11:44 +01:00
Christian Kellner
5be7554a65 gio-tool: fix inverted logic in monitor tool
The tool should refuse to work if none of the locations to watch
are set, not if *any* of them are unset.

https://bugzilla.gnome.org/show_bug.cgi?id=790093
2017-11-10 08:54:27 +00:00
Ondrej Holy
fe620e5def gio-tool: Do not alter uris before use
Uris may be altered by the following code, which breaks xdg-open:
file = g_file_new_for_commandline_arg (arg[i])
uri = g_file_get_uri (file);

Examples of possible uri changes:
mailto:email -> mailto:///email
magnet:?xt=urn:hash -> magnet:///?xt=urn:hash
ssh://user@host -> sftp://user@host

This patch causes that uris aren't preprocessed for locations with
scheme, however absolute and relative paths are still preprocessed.

https://bugzilla.gnome.org/show_bug.cgi?id=779182
2017-11-07 14:25:29 +01:00
Kjartan Maraas
f064be0998 Updated Norwegian bokmål translation. 2017-11-06 13:56:13 +01:00
John Ralls
d74a69826f Revert "[MacOS] Fallback to CFStringGetCSTring if CFStringGetCStringPtr fails."
This reverts commit d5a9ce69c4.
Partial resolution of bug 789894
2017-11-01 18:00:49 -07:00
Matthias Clasen
52b3e434d8 2.54.2 2017-10-27 18:59:17 -04:00
Peter Mráz
cfff6d22a7 Update Slovak translation 2017-10-27 16:50:42 +00:00
Chun-wei Fan
74bcdf6ac1 Visual Studio 2008 Projects: Improve binary security
It turns out that the MSVC 2008 supports RandomizedBaseAddress, too, so
we should also ensure that is enabled as well, which is the default
setting.
2017-10-20 16:47:50 +08:00
Chun-wei Fan
325d9fc92a Visual Studio Projects: Improve binary security
The initial MSVC 201x projects inadvertly disabled
RandomizedBaseAddress, which is normally enabled by default, so ensure
that is the case for all 201x builds.  This feature is supported by
Visual Studio 2010 or later.

Also, for x64 builds on MSVC 2012 or later, use /HIGHENTROPYVA when
linking.

Pointed out by Ignacio Casal Quinteiro.
2017-10-20 16:23:31 +08:00
Matej Urbančič
20980ff57f Updated Slovenian translation 2017-10-18 18:38:17 +02:00
John Ralls
d5a9ce69c4 [MacOS] Fallback to CFStringGetCSTring if CFStringGetCStringPtr fails. 2017-10-13 14:05:19 -07:00
Pawan Chitrakar
fce3b5b12c Update Nepali translation 2017-10-13 04:23:43 +00:00
Chun-wei Fan
a804fcba7a gio: Fix gio-tool-open.c on Windows/Cocoa
Commit 7384e37 broke builds on these platforms as *NIX-only APIs are
being used unconditionally.  Fix the build by building these portions
when not on Windows or Cocoa.

https://bugzilla.gnome.org/show_bug.cgi?id=780296
2017-10-09 09:10:21 +08:00
Ondrej Holy
7384e372f0 gio: Add hack to close up dbus-daemon race
If gio open exits before the program it starts fully activates, then
the dbus-daemon may avoid doing the activating method call.

This commit works around the problem by pinging the activated application,
and waiting for a reply.

Same workaround is used in gtk-launch and was used in gvfs-open before
it was replaced by gio open.

https://bugzilla.gnome.org/show_bug.cgi?id=780296
2017-10-05 17:29:19 +02:00
Xavi Ivars
bef8a00bc3
[l10n] Updated Catalan (Valencian) translation 2017-10-05 13:56:54 +02:00
Matthias Clasen
5fc5a3eaa6 2.54.1 2017-10-02 11:01:27 -04:00
Ondrej Holy
f480caf760 gunixmounts: Fix mount points generation
Commit 53ed180 improved mtab processing, however, also introduced bug
in code obtaining mount points. mtab was used by mistake also for
g_unix_mount_points_get implementation, which is obviously wrong and
fstab has to be used instead...

https://bugzilla.gnome.org/show_bug.cgi?id=781867
2017-10-02 12:58:44 +02:00
Matej Urbančič
ab3a0e6176 Updated Slovenian translation 2017-09-29 08:41:21 +02:00
Chun-wei Fan
20364bbdf5 Build: Fix glib/glibconfig.h.win32.in for x64 builds
Fix the [GSIZE|GSSIZE]_TO_[BE|LE] macros on x64 builds.
2017-09-15 13:10:34 +08:00
Chun-wei Fan
90e86f8a2a config.h.win32.in: Fix and update entries
Make config.h.win32.in reflect on the entries that are in the
autotools/Meson builds more closely.

Also declare that we have fd_set, declare SIZEOF_[SIZE|SSIZE]_T and
SIZEOF_LONG_LONG for 32-bit and x64 builds properly.

Note that since the Visual Studio 2015/2017 CRT's vsnprintf() and
snprintf() are not compliant enough (though they are much closer than
before) for GLib's purporses, we still use the gnulib's implementations
of them, as with the pre-Visual Studio 2015 builds.
2017-09-15 12:02:49 +08:00
Chun-wei Fan
915ab35e96 meson: Install items according to their relevance
The m4 and bash completion items are usable and relevant
depending on the host system's configuration.  So, we check for the
presence of the programs that these items depend on, and only install
them when those programs are found.

For the Valgrind suppression files, we don't install them on Windows as
Valgrind is currently not supported on Windows.

Als fix the path where the GDB helpers are installed, as the path is
incorrectly constructed.

This will fix the "install" stage when building on Visual Studio at
least as there are some post-install steps that are related to them,
which will make use of these programs.

https://bugzilla.gnome.org/show_bug.cgi?id=783270
2017-09-14 16:01:17 +08:00
Chun-wei Fan
fcf26cbf05 build: Dist the other required Meson build files
Some of the Meson build files are not dist'ed by 'make dist', which are
reqired for things to work, and there was a missing '\' that cause some
of the meson.build files under tests/ not to be disted.

https://bugzilla.gnome.org/show_bug.cgi?id=783210
2017-09-14 16:01:06 +08:00