Commit Graph

19664 Commits

Author SHA1 Message Date
Ondrej Holy
0a1730d7ea gfile: Fix leak in g_file_query_default_handler()
Add missing `g_free (uri_scheme)` to fix leak when `uri_scheme[0]`
is equal to `\0`.
2019-01-28 16:42:34 +01:00
Philip Withnall
140b82083f Merge branch 'trash-mount-points-master' into 'master'
Don't fail trash test if ~/.local doesn't exist or mount points can't be determined (master)

See merge request GNOME/glib!593
2019-01-28 13:53:36 +00:00
Philip Withnall
80f2c96a45 Merge branch 'portals-no-o-path' into 'master'
gio: do not pass O_PATH file descriptors to portal APIs

See merge request GNOME/glib!585
2019-01-28 12:58:03 +00:00
Philip Withnall
79d5e1432d Merge branch 'docs' into 'master'
gvariant: Fix a mistake in docs

See merge request GNOME/glib!619
2019-01-28 12:42:55 +00:00
Daniel Mustieles
5a79548572 Updated Spanish translation 2019-01-28 13:06:32 +01:00
Fran Dieguez
337889e7fc Update Galician translation 2019-01-27 22:04:42 +00:00
Balázs Úr
f0720c727f Update Hungarian translation 2019-01-27 14:56:13 +00:00
Krzesimir Nowak
09eb87ad55 gvariant: Fix a mistake in docs
So now the docs actually match what the code does.
2019-01-26 21:45:34 +01:00
Philip Withnall
2d46dff03e 2.59.1
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-26 12:16:35 +00:00
Philip Withnall
eb589e2bfe tests: Ensure GCancellable is cancelled before operation is started
In the writev() tests, the handling of cancellation is tested. However,
the GCancellable was cancelled after the writev_async() call was
started. Depending on the implementation of the writev() vfunc, the
operation could be done in a thread or in callbacks on the current
thread’s main loop. If done in a separate thread, there’s a chance that
enough of the write could happen before cancellation reaches that thread
that the overall operation returns success with a short write.

That would cause the test to fail, sometimes.

Avoid that by cancelling the GCancellable before starting the writev()
operation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2019-01-26 12:16:35 +00:00
Anders Jonsson
50d628d859 Update Swedish translation 2019-01-25 21:36:48 +00:00
Philip Withnall
cc95f819e2 Merge branch '424-gdbus-proxy-debugging' into 'master'
gdbusproxy: Add G_DBUS_DEBUG=proxy support

Closes #424

See merge request GNOME/glib!618
2019-01-25 14:42:52 +00:00
Philip Withnall
1275ddb794 Merge branch 'gdbus-proxy-test-fixes' into 'master'
gdbus-proxy test fails with GLib-GIO:ERROR:glib/gio/tests/gdbus-proxy.c:832:fail_test: code should not be reached

See merge request GNOME/glib!598
2019-01-25 14:42:05 +00:00
Richard Hughes
cd7bba985e gdbusproxy: Add G_DBUS_DEBUG=proxy support
(Turned into a merge request by Philip Withnall; unmodified from
original patch on https://bugzilla.gnome.org/show_bug.cgi?id=654905.)

https://gitlab.gnome.org/GNOME/glib/issues/424
2019-01-25 14:30:32 +00:00
Philip Withnall
aa3f7eaac7 Merge branch 'wip/chergert/fix-network-address-crash' into 'master'
gnetworkaddress: fix use-after-free for network address

See merge request GNOME/glib!611
2019-01-25 14:22:00 +00:00
Christian Hergert
4b2a60c73a gnetworkaddress: fix use-after-free for network address
This fixes an error where addr_enum can be used after finalization during
complete_queued_task().
2019-01-25 09:03:34 -05:00
Emmanuele Bassi
6db5101c4f Merge branch '1666-typemodule-casts' into 'master'
gtypemodule: Cast *_init functions to void(*)(void) first

Closes #1666

See merge request GNOME/glib!617
2019-01-25 13:33:50 +00:00
Philip Withnall
a8af2862ab gtypemodule: Cast *_init functions to void(*)(void) first
This is an analogous commit to c1f5e528. The original fix only touched
gtype.h and not gtypemodule.h.

The *_init() functions have prototypes incompatible with *InitFunc types they
are being cast to. This upsets GCC 8's -Wcast-function-type that's enabled by
default with -Wextra.

Let's not have the public header files emit a warning and neutralize it by
doing a void(*)(void) cast first.

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

https://gitlab.gnome.org/GNOME/glib/issues/1666
2019-01-25 11:29:05 +00:00
James Henstridge
b8477255b3 gio: make g_document_portal_add_documents() fall back to read-only access 2019-01-25 14:06:46 +08:00
Sebastian Dröge
f5541d8a6e Merge branch 'compiler-warnings' into 'master'
Fix a couple of wrong compiler warnings

See merge request GNOME/glib!615
2019-01-24 15:15:07 +00:00
Philip Withnall
791819c79d Merge branch 'writev' into 'master'
Add writev() API to GOutputStream and GPollableOutputStream

See merge request GNOME/glib!333
2019-01-24 14:42:51 +00:00
Sebastian Dröge
bd75dffc00 Fix compiler warning about uninitialized variable in desktop-app-info test
It would always be initialized but initialize it to NULL to silence the
compiler, and also check that it is not NULL anymore when we expect it
to contain a valid value.

../gio/tests/desktop-app-info.c: In function ‘test_fallback’:
../gio/tests/desktop-app-info.c:191:18: warning: ‘app’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   g_assert_true (g_app_info_equal (info1, app));
                  ^~~~~~~~~~~~~~~~
2019-01-24 16:37:23 +02:00
Sebastian Dröge
b4a5157f95 Fix compiler warning about uninitialized variable in giomodule
It could've never been uninitialized in this code but the code flow is
not obvious to the compiler. Initialize it to NULL and for clarity also
add an assertion that it is not NULL anymore on usage.

In file included from ../glib/glib.h:62,
                 from ../gobject/gbinding.h:28,
                 from ../glib/glib-object.h:23,
                 from ../gio/gioenums.h:28,
                 from ../gio/giotypes.h:28,
                 from ../gio/giomodule.h:28,
                 from ../gio/giomodule.c:25:
../gio/giomodule.c: In function ‘_g_io_module_get_default’:
../glib/gmessages.h:343:25: warning: ‘extension’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define g_debug(...)    g_log (G_LOG_DOMAIN,         \
                         ^~~~~
../gio/giomodule.c:912:17: note: ‘extension’ was declared here
   GIOExtension *extension, *preferred;
                 ^~~~~~~~~
2019-01-24 16:35:13 +02:00
Sebastian Dröge
b94940dfae Add test for blocking and non-blocking and async read/write(v) on UNIX streams 2019-01-24 16:26:05 +02:00
Sebastian Dröge
fe71a19716 Add test for blocking read/write/writev on GSocket*Streams 2019-01-24 16:26:02 +02:00
Sebastian Dröge
61520ae601 Add test for async read/write(v)/close on GSocketConnections 2019-01-24 16:25:59 +02:00
Sebastian Dröge
708aa8f4ee Add some tests for g_output_stream_writev() and its async variant 2019-01-24 16:25:56 +02:00
Sebastian Dröge
e6f5a50cd7 Implement GOutputStream::writev_fn() and GPollableOutputStream::writev_nonblocking() for GSocketOutputStream 2019-01-24 16:25:52 +02:00
Sebastian Dröge
9ae40d982a Rename timeout variables in gsocket.[ch] to include the unit as suffix
Makes it clearer which unit we work with. We have timeouts in seconds,
milliseconds and microseconds in here.
2019-01-24 16:25:50 +02:00
Sebastian Dröge
cc7f2f6b28 Add (type GSocketMsgFlags) to int-typed flags parameters in GSocket 2019-01-24 16:25:48 +02:00
Sebastian Dröge
f0a11b2727 Add g_socket_send_message_with_timeout() 2019-01-24 16:25:46 +02:00
Sebastian Dröge
63ea8d18f3 Simplify some code in GUnixOutputStream 2019-01-24 16:25:44 +02:00
Sebastian Dröge
90d9e4ab72 Implement GOutputStream::writev() and GPollableOutputStream::writev_nonblocking() GUnixOutputStream 2019-01-24 16:25:42 +02:00
Sebastian Dröge
c39264d35b Implement GOutputStream::writev_fn() for GLocalFileOutputStream on UNIX 2019-01-24 16:25:40 +02:00
Sebastian Dröge
89da9eb6c0 Change to g_warning() into assertions in GOutputStream
These would only happen if the API contract of the write() and writev()
functions was broken by subclasses.
2019-01-24 16:25:38 +02:00
Sebastian Dröge
0bcc177378 Add writev() / writev_all() API to GOutputStream and GPollableOutputStream
This comes with default implementations around the normal write
functions and async variants.

Fixes https://gitlab.gnome.org/GNOME/glib/issues/1431
2019-01-24 16:25:34 +02:00
Sebastian Dröge
042b8dc40d Introduce new GPollableReturn enum
This allows returning WOULD_BLOCK without allocating a GError, and
should later be used for various functions of GPollableOutputStream,
GPollableInputStream and anything else that can potentially block.
2019-01-24 16:25:31 +02:00
Philip Withnall
72329ea303 Merge branch 'fix-gdir-warning-msvc' into 'master'
gdir: shutup a warning when building with msvc

See merge request GNOME/glib!612
2019-01-24 10:44:34 +00:00
Ignacio Casal Quinteiro
57c779dab4 gdir: shutup a warning when building with msvc
This way we avoid the warning:
warning C4716: 'g_dir_new_from_dirp': must return a value
2019-01-24 11:31:38 +01:00
Philip Withnall
2821ff0fd2 Merge branch '1663-minint32-cxx-win32' into 'master'
gtypes: Define signed integer minimum values in terms of maximum values

Closes #1663

See merge request GNOME/glib!607
2019-01-23 17:35:01 +00:00
Emmanuele Bassi
85b5a72e69 Merge branch '1662-no-pedantry' into 'master'
build: Add -Wno-pedantic flag to compiler arguments

See merge request GNOME/glib!608
2019-01-23 14:15:18 +00:00
Philip Withnall
5c05af9aca build: Add -Wno-pedantic flag to compiler arguments
We do not support building with -Wpedantic due pervasively casting
function pointers through (void*) — see
https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.

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

Helps https://gitlab.gnome.org/GNOME/glib/issues/1662
2019-01-23 13:38:40 +00:00
Philip Withnall
6a2cfde29f gtypes: Define signed integer minimum values in terms of maximum values
This is what limits.h does. It avoids a problem when compiling with MSVC
(in C++ mode) on Windows, whereby the 0x80000000 constant is interpreted
as unsigned, and *then* the unary minus is applied to it.

https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4146?view=vs-2017

Add a test which should hopefully catch problems with different
compilers’ interpretations of this in future.

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

https://gitlab.gnome.org/GNOME/glib/issues/1663
2019-01-23 13:23:53 +00:00
Philip Withnall
7035462da0 Merge branch 'contributing-docs' into 'master'
Update contribution documentation

See merge request GNOME/glib!590
2019-01-23 10:52:15 +00:00
Philip Withnall
3806c34df9 Merge branch '1655-int-signedness-casts' into 'master'
gvariant-parser: Add explicit unsigned-to-signed casts

Closes #1655

See merge request GNOME/glib!600
2019-01-23 09:55:33 +00:00
Matthias Clasen
ab40b242f1 Merge branch 'gio-extension-point-help' into 'master'
gio: Support "help" in extension point env vars

See merge request GNOME/glib!601
2019-01-22 18:29:36 +00:00
Matthias Clasen
8f71892862 Document "help" for extensions
Mention the special value "help" for the environment variables
that we document for picking extensions.
2019-01-22 13:18:50 -05:00
Matthias Clasen
df5b482781 gio: Support "help" in extension point env vars
Interpret the value "help" for environment variables that
are passed to _g_io_module_get_default(), and print the
names and priorities of available extensions.

This lets users explore what is available, and can be helpful
in figuring out why a certain extension was chosen as default.

It is similar in spirit to what we already do with environment
variables like G_DEBUG.
2019-01-22 13:18:42 -05:00
Emmanuele Bassi
3d9727c0b8 Merge branch 'keyfile-backend-strings' into 'master'
keyfile settings: Accept unquoted strings

See merge request GNOME/glib!603
2019-01-22 17:03:11 +00:00
Matthias Clasen
e6574b228e keyfile settings: Accept unquoted strings
It is hard for users to remember that strings have to be explicitly
quoted in the keyfile. Be lenient and accept strings that lack those
quotes.
2019-01-22 11:11:24 -05:00