Commit Graph

6206 Commits

Author SHA1 Message Date
Philip Withnall
a350fa50a5 Merge branch 'winhttp-handle-null-prgname' into 'master'
gwinhttpvfs: Handle g_get_prgname() returning NULL

See merge request GNOME/glib!1152
2019-10-07 09:04:06 +00:00
Philip Withnall
acf55ad584 Merge branch 'solaris-build-fixes' into 'master'
Solaris build fixes

See merge request GNOME/glib!1146
2019-10-07 08:44:39 +00:00
Ondrej Holy
b3bf1e263e gio: Always include mounts in the results
Mounts are currently completed only if the prefix looks like scheme,
however, this doesn't work well if the mounts have also path component.
Let's always include them to fix this issue. The mounts are cached by the
volume monitors, so it should not significantly affect the performance.
2019-10-07 09:21:19 +02:00
Ondrej Holy
8bc52105ef gio: Complete also activation roots of volumes
Currently, "gio mount google-drive<tab>" isn't completed even though
that volume exists for google-drive://oholy@redhat.com/. Let's use
"gio mount -li" output to complete also activation roots of volumes.
2019-10-07 09:21:19 +02:00
Ondrej Holy
3a1492ec4f gio: Fix completion of URIs without hostname part
Currently, "gio list file:///h<tab>" doesn't complete "file:///home"
because the result of "dirname file:///h" is not "file:///" but "file:/",
which breaks the consequent logic. Let's subtract basename from the
path in order to workaround this issue.
2019-10-07 09:21:09 +02:00
Christoph Reiter
bf2a10211b gwinhttpvfs: Handle g_get_prgname() returning NULL
When prgname wasn't set NULL would be passed to g_utf8_to_utf16()
resulting in "g_utf8_to_utf16: assertion 'str != NULL' failed"
2019-10-06 20:05:44 +02:00
Simon McVittie
dd27d2beeb Merge branch 'patch-1' into 'master'
gio/gfile: fix parameter reference for value_p

See merge request GNOME/glib!1149
2019-10-06 13:18:44 +00:00
Simon McVittie
cb97f0e114 Merge branch 'dlech-master-patch-99473' into 'master'
gio/gfileinfo: fix parameter references

See merge request GNOME/glib!1148
2019-10-06 13:17:59 +00:00
Simon McVittie
5ac73a0972 Merge branch 'patch-2' into 'master'
gio/gfile: fix parameter references to @contents

See merge request GNOME/glib!1150
2019-10-06 13:17:17 +00:00
David Lechner
4723bf5720 gio/gfile: fix typo in doc comment
This fixes a typo in g_file_has_prefix() do comments.
2019-10-06 02:01:48 +00:00
David Lechner
f71eca16d5 gio/gfile: fix parameter references to @contents
Fix a number of occurrences where the parameter reference was missing the trailing 's'
2019-10-06 01:55:40 +00:00
David Lechner
5120f92c33 gio/gfile: fix parameter reference for value_p
This fixes a parameter reference to @value_p in g_file_set_attribute()
2019-10-06 01:48:15 +00:00
David Lechner
5dee5263e8 gio/gfileinfo: fix parameter references
This fixes a couple of parameter references for @info in the doc comments.
2019-10-05 22:36:19 +00:00
Alan Coopersmith
2b34f52b01 build: no --export-dynamic ldflags for Solaris
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-10-04 13:23:25 -07:00
Alan Coopersmith
e5e1490990 gunixmounts: Handle Solaris name of mnt_mntopts in place of mnt_opts
Fixes build failure:
../gio/gunixmounts.c: In function ‘_g_get_unix_mounts’:
../gio/gunixmounts.c:742:53: error: ‘struct mnttab’ has no member named ‘mnt_opts’; did you mean ‘mnt_mntopts’?
  742 |                                              mntent.mnt_opts,
      |                                                     ^~~~~~~~
      |                                                     mnt_mntopts

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-10-04 12:55:17 -07:00
Philip Withnall
d207e19d32 Merge branch 'wip/tingping/pkcs11' into 'master'
gtlscertificate: Add pkcs11-uri property and constructor

Closes #1809

See merge request GNOME/glib!933
2019-10-03 12:12:16 +00:00
Patrick Griffis
b6d8efbebc gtlscertificate: Add support for PKCS #11 backed certificates
This adds properties to allow backends to expose PKCS #11 support.
2019-10-02 10:12:40 -07:00
Philip Withnall
0c40f3f6b9 Merge branch 'cross-installed-tests' into 'master'
Always build tests if we enabled installed-tests

See merge request GNOME/glib!1138
2019-10-02 15:54:19 +00:00
Philip Withnall
406c8b04fc Merge branch 'file-permissions-redux' into 'master'
Fix handling of G_FILE_COPY_TARGET_DEFAULT_PERMISSIONS in g_file_copy()

Closes #174

See merge request GNOME/glib!1134
2019-10-02 15:40:09 +00:00
Simon McVittie
14609b0b25 g_file_info_get_modification_date_time: Calculate in integer domain
g_date_time_add_seconds() and g_date_time_add_full() use floating-point
seconds, which can result in the value varying slightly from what's
actually on disk. This causes intermittent test failures in
gio/tests/g-file-info.c on Debian i386, where we set a file's mtime
to be 50µs later, then read it back and sometimes find that it is only
49µs later than the previous value.

I've only seen this happen on i386, which means it might be to do with
different floating-point rounding when a value is stored in the 80-bit
legacy floating point registers rather than in double precision.

g_date_time_add() takes a GTimeSpan, which is in microseconds;
conveniently, that's exactly what we get from the GFileInfo.

Bug-Debian: https://bugs.debian.org/941547
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-10-02 08:30:35 +01:00
Simon McVittie
42d8e17795 Always build tests if we enabled installed-tests
If we're cross-compiling, the installed-tests are useful even if we
can't run them on the build machine: we can copy them to the host
machine (possibly via a distro package like Debian's libglib2.0-tests)
and run them there.

While I'm changing the build-tests condition anyway, deduplicate it.

Based on a patch by Helmut Grohne.

Bug-Debian: https://bugs.debian.org/941509
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-10-01 20:12:16 +01:00
Ignacio Casal Quinteiro
9239f2659f gregistrysettings: bump key name length to 128
32 is just too low for key names, specially since the registry has a limit
of 16,383 chars. Giving that, 128 is a good bump for now.
2019-10-01 14:35:43 +02:00
Philip Withnall
eb2125770d tests: Expand g_file_copy() tests to test DEFAULT_PERMS flag
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-30 14:40:55 +01:00
Philip Withnall
67772b6a70 tests: Unconditionally enable the file permissions test
Skip it on systems which don’t support it, rather than compiling it out.
That gives us more information from test runs about which tests are
being run on which architectures.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-30 14:40:55 +01:00
Philip Withnall
bfdc5fc4fc glocalfileinfo: Only return file mode, not type, as UNIX_MODE attribute
As with the previous commit, `st_mode` contains both the file type
(regular file, directory, symlink, special, etc.) and the file mode. For
`G_FILE_ATTRIBUTE_ID_UNIX_MODE`, we only want the file mode — so mask
`st_mode` with `~S_IFMT`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-30 14:40:55 +01:00
Philip Withnall
5dd5269126 glocalfileoutputstream: Only pass file mode, not type, to chmod()
chmod() technically only accepts file modes, not the file type and mode
as returned by stat(). Filter by `S_IFMT` to avoid sending the file
type (regular file, directory, symbolic link, etc.).

In practice, chmod() ignores anything except the file mode, but we might
as well comply with the specification.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-30 14:40:55 +01:00
Philip Withnall
674ba78f12 gfile: Document a few nullable vfuncs
`GFile` always checks whether these vfuncs are `NULL` before calling
them, so document that it’s safe for implementations of `GFile` to not
implement them.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-30 14:40:55 +01:00
Philip Withnall
7d2bce82e2 glocalfile: Don’t define unsupported copy vfunc
The caller assumes that an unimplemented vfunc means that copying is
unsupported (and falls back to its internal copy implementation), so
there’s no point in implementing the vfunc just to unconditionally
return `G_IO_ERROR_NOT_SUPPORTED`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-30 14:40:55 +01:00
Philip Withnall
1b7ab81c1c glocalfile: Don’t define symlink vfunc if it’s unsupported
Rather than defining a vfunc which only ever returns
`G_IO_ERROR_NOT_SUPPORTED`, just don’t define the vfunc at all. The
caller in `GFile` interprets this as symlinks not being supported — so
we get the same behaviour, but without spending a vfunc call on it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-30 14:40:55 +01:00
Philip Withnall
775014dd3b gfile: Use a more specific error message if symlinks are not supported
The string is already translated in `GLocalFile`, so this doesn’t
introduce a new translatable string.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-30 14:40:55 +01:00
Philip Withnall
2268f36769 gio-tool: Add a --default-permissions argument to gio copy
This sets the `G_FILE_COPY_DEFAULT_PERMS` flag on the operation,
creating the copied file with default permissions rather than the same
permissions as the source file.

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

Fixes: #174
2019-09-30 14:40:50 +01:00
Philip Withnall
53f6ede628 gfile: Don’t copy files as private if using default permissions
If a copy operation is started with `G_FILE_COPY_TARGET_DEFAULT_PERMS`,
don’t create the destination file as private. Instead, create it with
the process’ current umask (i.e. ‘default permissions’).

This is a partial re-work of commit d8f8f4d637, with
input from Ondrej Holy.

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

Fixes: #174
2019-09-30 14:40:43 +01:00
Philip Withnall
51d73ef5d9 gfile: Factor out flags when copying files
This introduces no functional changes; just reduces duplication in the
code a little.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-30 14:24:38 +01:00
David Lechner
2a4b9eb20c gio/gfileinfo: fix param reference in doc comment
The actual parameter name in g_file_attribute_matcher_new()
attributes, so change the param reference to match. This way,
doc tools can create a proper link.
2019-09-29 01:03:22 +00:00
Matthew Leeds
1015bfb6ba fileinfo: Mention that usec mtimes are set
g_file_info_set_modification_time() and
g_file_info_set_modification_date_time() set the
G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC attribute in addition to
G_FILE_ATTRIBUTE_TIME_MODIFIED, so microsecond precision is available
when provided by the caller, so mention both attributes in the docs.
2019-09-25 13:43:51 +00:00
Philip Withnall
55f9c6d2f4 gatomic: Add various casts to use of g_atomic_*()s to fix warnings
When compiling GLib with `-Wsign-conversion`, we get various warnings
about the atomic calls. A lot of these were fixed by
3ad375a629, but some remain. Fix them by
adding appropriate casts at the call sites.

Note that `g_atomic_int_{and,or,xor}()` actually all operate on `guint`s
rather than `gint`s (which is what the rest of the `g_atomic_int_*()`
functions operate on). I can’t find any written reasoning for this, but
assume that it’s because signedness is irrelevant when you’re using an
integer as a bit field. It’s unfortunate that they’re named a
`g_atomic_int_*()` rather than `g_atomic_uint_*()` functions.

Tested by compiling GLib as:
```
CFLAGS=-Wsign-conversion jhbuild make -ac |& grep atomic
```

I’m not going to add `-Wsign-conversion` to the set of default warnings
for building GLib, because it mostly produces false positives throughout
the rest of GLib.

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

Fixes: #1565
2019-09-21 10:48:23 +02:00
Sebastian Dröge
cf25d9a2ec Merge branch 'wip/oholy/gio-remove-completion' into 'master'
gio: Add missing "gio remove" option to bash completion script

See merge request GNOME/glib!1110
2019-09-17 10:06:49 +00:00
Ondrej Holy
84c8899fca gio: Add missing "gio remove" option to bash completion script
Bash completion	script allows to complete various options, but "gio remove"
is missing. Let's add this missing option.
2019-09-16 11:19:50 +02:00
Egmont Koblinger
8f30e6c3bb doc: fix typo in gio/gsettings.c 2019-09-14 23:11:57 +02:00
Philip Withnall
86c282cd78 Merge branch 'iov-max' into 'master'
Define G_IOV_MAX to 512 on macOS/iOS

See merge request GNOME/glib!1095
2019-09-13 13:37:25 +00:00
Nirbheek Chauhan
b01bbe6536 Merge branch '1767-scan-build-fixes' into 'master'
Various small scan-build fixes

See merge request GNOME/glib!1088
2019-09-13 12:37:37 +00:00
Sebastian Dröge
6d4738ed22 Merge branch '1875-xdgmimecache-robustness' into 'master'
xdgmime: Prevent infinite loops from badly-formed MIME registrations

Closes #1875

See merge request GNOME/glib!1085
2019-09-13 11:42:55 +00:00
Philip Withnall
adf96047f4 xdgmime: Prevent infinite loops from badly-formed MIME registrations
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1875
2019-09-13 12:13:49 +01:00
Sebastian Dröge
81f614533d Define G_IOV_MAX to 512 on macOS/iOS
For macOS/iOS, UIO_MAXIOV is documented in writev(2), but <sys/uio.h> only
declares it if defined(KERNEL)

Inspired by a GStreamer MR by Jim Mason
https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/277
2019-09-10 10:16:03 +03:00
Philip Withnall
475b9b5f7c tests: Add tests for GFileInfo modification time
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-05 17:13:08 +01:00
Philip Withnall
b99cdf56dc tests: Use g_assert_*() rather than g_assert() in g-file-info test
They provide more detailed failure messages, and aren’t compiled out
when building with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-05 17:13:08 +01:00
Christian Hergert
b933b0f369 fileinfo: ignore USEC if not available
When future porting deprecated code to use
g_file_info_get_modification_date_time() we risk a number of breakages
because the current implementation also requires the additional use of
G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC. This handles that situation gracefully
and returns a GDateTime with less precision.

Applications that want the additional precision, are already using the
additional attribute.

(Minor tweaks by Philip Withnall.)
2019-09-05 17:13:08 +01:00
Philip Withnall
8fe58ffe12 gdbusdaemon: Fix unused variable warning
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1767
2019-09-05 14:17:08 +01:00
Philip Withnall
d99653f6fe gdbusdaemon: Add sanity checks on name refcounting
This should make the code a bit easier to reason about, and squash some
static analysis warnings.

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

Helps: #1767
2019-09-05 14:17:05 +01:00
Philip Withnall
0b4162e714 build: Disable dtrace probes under static analysis
The macros for the probes confuse the static analyser, and are often
called with arguments which the analyser things shouldn’t be used any
more (for example, the address of a block of memory which has just been
freed).

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

Helps: #1767
2019-09-05 14:16:58 +01:00
Philip Withnall
18a232be89 glib: Various minor scan-build fixes
These squash various warnings from `scan-build`. None of them are
legitimate bugs, but some of them do improve code readability a bit.

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

Helps: #1767
2019-09-05 13:51:27 +01:00
Will Thompson
4aba03562b gdbus-codegen: emit GUnixFDLists if an arg has type 'h'
Previously, if a method was not annotated with org.gtk.GDBus.C.UnixFD
then the generated code would never contain GUnixFDList parameters, even
if the method has 'h' (file descriptor) parameters. However, in this
case, the generated code is essentially useless: the method cannot be
called or handled except in degenerate cases where the file descriptors
are missing or ignored.

Check the argument types for 'h', and if present, generate code as if
org.gtk.GDBus.C.UnixFD annotation were specified.

This change will break any existing code which refers to the (useless)
wrappers for such methods. The workaround for such code is to add the
org.gtk.GDBus.C.UnixFD annotation, which will cause the same generated
code to be emitted before and after this change.

If this is found to cause widespread problems, we can explore a
different approach (perhaps emitting a warning from the code generator,
or annotating the symbols as deprecated).

https://gitlab.gnome.org/GNOME/glib/issues/1726
2019-09-02 20:47:20 +01:00
Sebastian Dröge
daa308dd6e Merge branch '487-ci-memcheck' into 'master'
Add CI job for running tests under Valgrind

Closes #487

See merge request GNOME/glib!169
2019-09-02 13:52:35 +00:00
Philip Withnall
39052a1cfc tests: Fix some minor memory leaks in tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
Emmanuele Bassi
a0cbb32680 Merge branch '1309-delayed-settings-changed' into 'master'
gsettings: Add missing changed() call to delayed settings backend

Closes #1309

See merge request GNOME/glib!1046
2019-09-02 11:14:59 +00:00
Will Thompson
9b827e5674 gdbus-codegen: process C.UnixFD annotation in one place
This will make it simpler to enable this behaviour based on the method
signature.

https://gitlab.gnome.org/GNOME/glib/issues/1726
2019-09-02 06:54:37 +01:00
Nirbheek Chauhan
9456cec53e Merge branch 'wip/lantw/meson-move-libdl_dep-to-the-top-level' into 'master'
meson: Move libdl_dep to the top level

See merge request GNOME/glib!1071
2019-08-29 18:45:36 +00:00
Ting-Wei Lan
fe3c16608a meson: Move libdl_dep to the top level
Instead of letting each directory to find its way to link with libdl,
it is easier to put the check in the top level, so its result can be
used by all directories.

It is a follow-up of https://gitlab.gnome.org/GNOME/glib/merge_requests/810.
2019-08-29 23:25:40 +08:00
Mihai Moldovan
bd4c16b356 gio: actually install and reference gnativesocketaddress.h.
The header file was installed when building using autotools, but was
inadvertently omitted in the meson targets.

Luckily, ABI is not impacted, since gnativesocketaddress.c was always
compiled and linked into libgio.

Fixes: #1854
2019-08-29 14:32:55 +02:00
Mihai Moldovan
5e18888a94 gio: Housekeeping: sync up and sort gio_{sources,headers} lists 2019-08-29 14:32:55 +02:00
Sergio Costas
09e094a676 gsubprocesslauncher.c: fix documentation
The gobject introspection comments have a reference to an incorrect
class: they have, as 'self', the GSubprocess class instead of
GSubprocessLauncher.

This patch fixes this.
2019-08-29 00:15:03 +02:00
Sebastian Dröge
d3ae4b1d30 GSettingsBackend - Fix thread-safety during destruction of GSettings instances while notifications are emitted
g_settings_backend_watch() uses a weak notify for keeping track of
the target. There's an explanation why this is supposed to be safe but
that explanation is wrong.

The following could happen before:

1. We have the target stored in the watch list
2. The last reference to the target is dropped in thread A and we end up
   in g_settings_backend_watch_weak_notify() right before the mutex
3. g_settings_backend_dispatch_signal() is called from another thread B
   and gets the mutex before 2.
4. g_weak_ref_init() is called on the target from thread B, which at
   this point has a reference count of exactly one (see g_object_unref()
   where it calls the weak notifies)
5. Thread A continues at 3. and drops the last reference and destroys
   the object. Now the GWeakRef from 4. points to a destroyed object. Note
   that GWeakRefs would be cleared before the weak notifies are called
6. At some later point another thread g_weak_ref_get() is called by
   g_settings_backend_invoke_closure() and accesses an already destroyed
   object with refcount 0 from the GWeakRef created in 4. by thread B (or
   worse, already freed memory that was reused).

Solve this by actually storing a GWeakRef of the target in the watch
list and only access the target behind it via the GWeakRef API, and then
pass a strong reference to the notification dispatch code.

The weak notify is only used to remove the (potentially with empty
GWeakRef) target from the list of watches and the only place that
compares the target by pointer instead of going through the GWeakRef
API.

Fixes https://gitlab.gnome.org/GNOME/glib/issues/1870
2019-08-27 11:09:08 +03:00
Philip Withnall
562ac9de43 gwinhttpvfs: Fall back to wrapped VFS if creating a HTTP file fails
If we fail to create a GWinhttpFile for a URI (for example, because it’s
an invalid URI or is badly encoded), don’t just return NULL. Instead,
fall back to the wrapped VFS which might be able to handle it instead.

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

Fixes: #1819
2019-08-27 08:21:26 +03:00
Philip Withnall
4b0421a730 gwinhttpfile: Document constructor as potentially returning NULL
It can return NULL if the URI was badly encoded or couldn’t be handled
by Windows’ API.

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

Helps: #1819
2019-08-27 08:21:26 +03:00
Philip Withnall
e24503a8e9 gvfs: Add an assertion to check that get_file_for_uri() is never NULL
It cannot return a NULL value, as none of its callers have error
handlng. Add an assertion to check the values returned by the VFS
implementations.

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

Helps: #1819
2019-08-27 08:21:25 +03:00
Philip Withnall
833c24f45a gvolumemonitor: Use GIOModule methods for getting default type
This fixes use of `GIO_USE_VOLUME_MONITOR=help`, and simplifies the
code. The reason this wasn’t used already seems to just be because it
was missed when `_g_io_module_get_default_type()` was introduced in
2013. The previous `get_default_native_class()` code in
`gunionvolumemonitor.c` was introduced in 2007.

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

Closes: #1881
2019-08-26 13:41:26 +03:00
Дилян Палаузов
512655aa12 minor typos in the documentation (a/an) 2019-08-24 19:14:05 +00:00
Philip Withnall
c178c9734c Merge branch 'static_analysis_2_40_patches' into 'master'
Static analysis 2 40 patches

Closes #905

See merge request GNOME/glib!1042
2019-08-24 14:22:38 +00:00
Colin Walters
649faee0e6 gio/gnetworkmonitornetlink.c: Add NULL check on dest before using it 2019-08-24 15:55:49 +02:00
Colin Walters
f731dd376c gio/glib-compile-resources.c: Unref objects in error path 2019-08-24 15:44:59 +02:00
Philip Withnall
3c9ff2712f Merge branch 'override' into 'master'
Meson: Override glib-compile-resources/schemas

See merge request GNOME/glib!1037
2019-08-23 11:30:46 +00:00
George Barrett
274985a2ce Erase GI annotation: skip g_cancellable_source_new
Deletes the skip annotation from g_cancellable_source_new(). This was
originally added because GSource wasn't introspectable, but this is no
longer an issue as G_TYPE_SOURCE was added in 2.30.

Fixes: #1877
2019-08-23 01:34:12 +10:00
Philip Withnall
13e947d8cf Merge branch '1867-en-gb-isms' into 'master'
glib-compile-schemas: Fix some minor en_GB-isms in translatable strings

Closes #1867

See merge request GNOME/glib!1038
2019-08-21 17:53:43 +00:00
Philip Withnall
63abca2963 gsettings: Add missing changed() call to delayed settings backend
When resetting a key in the delayed settings backend,
g_settings_backend_changed() was not called to notify the backend of
the change.

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

Fixes: #1309
2019-08-21 20:08:04 +03:00
Philip Withnall
87a71fe4d3 tests: Add a test for peer-to-peer GDBusProxy usage with a bus name
This is a regression test for the fix in !554.

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

Fixes: #1620
2019-08-21 19:49:06 +03:00
Philip Withnall
a01983f94c tests: Add a test for g_dbus_connection_get_flags()
It was added in !554 but never had a unit test.

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

Helps: #1620
2019-08-21 19:49:06 +03:00
Philip Withnall
9fc745db07 tests: Drop unnecessary usage of g_test_bug_base("")
See the previous commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-08-21 19:42:27 +03:00
Philip Withnall
389b1820f2 glib-compile-schemas: Fix some minor en_GB-isms in translatable strings
Spotted by Bruce Cowan.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #1867
2019-08-14 10:38:23 +02:00
Xavier Claessens
fdcdd5c5b4 Meson: Override glib-compile-resources/schemas
This fix build error for projects that use gnome.compile_resources()
when glib is built as a subproject and not installed on the build
machine.

Note that this is not working for cross compilation cases, because it
would require to compile everything twice (for host and build machines).
A better solution would be to rewrite those tools in python. See #1859.
2019-08-13 08:52:50 -04:00
Philip Withnall
84738f7e80 Merge branch 'wip/hadess/gnetworkmonitor-nm-fixups' into 'master'
gnetworkmonitornm fixups

See merge request GNOME/glib!1016
2019-07-29 15:47:55 +00:00
Bastien Nocera
f299886f1f gnetworkmonitornm: Remove double-space 2019-07-29 17:28:01 +02:00
Bastien Nocera
109f247039 gnetworkmonitornm: Arguments to g-signal's callback are const 2019-07-29 17:28:01 +02:00
Bastien Nocera
7d3ecce346 gnetworkmonitornm: Disconnect g-signal from proxy
So that we're sure never to receive a signal if something is keeping the
proxy alive.
2019-07-29 17:28:01 +02:00
Bastien Nocera
ef1d5b5ee0 gnetworkmonitornm: Remove unneeded ";" in G_DEFINE_INTERFACE_WITH_CODE 2019-07-29 17:28:01 +02:00
Philip Withnall
86ba1b37bd Merge branch 'application-free-remote-actions' into 'master'
gapplication: Fix a leaking GRemoteActionGroup member

See merge request GNOME/glib!1011
2019-07-29 13:21:51 +00:00
Philip Withnall
96c74fd0e6 win32: Stop using deprecated GTimeVal in GWinHttpFile
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
de25be72f0 tests: Stop using deprecated g_get_current_time()
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
161654681f gfileinfo: Stop using deprecated GTimeVal
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
def5db23a3 gdbusutils: Stop using g_get_current_time()
It is deprecated.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
4faf4fcfaa gfileinfo: Deprecate g_file_info_{get,set}_modification_time()
They use the deprecated GTimeVal type, which is not year 2038 safe, so
have to be deprecated.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
d166a55c64 gfileinfo: Add g_file_info_{get,set}_modification_date_time() APIs
These are alternatives to g_file_info_{get,set}_modification_time(),
which will soon be deprecated due to using the deprecated GTimeVal
type, which is not year 2038 safe.

The new APIs take a GDateTime instead.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
8f385b8cf5 Merge branch 'master' into 'master'
windows: fix multicast socket binding to specific network interfaces

Closes #1635

See merge request GNOME/glib!887
2019-07-29 11:10:40 +00:00
Philip Withnall
0f131857ba gapplication: Fix a leaking GRemoteActionGroup member
Fix prompted by Ting-Wei Lan’s similar fix for the inactivity timeout
(!1009).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-07-29 10:49:45 +01:00
Ting-Wei Lan
0ed8605079 gapplication: remove inactivity_timeout source on finalize
The event source used to handle inactivity_timeout doesn't hold a
reference on the application. Therefore, it is possible for callback
function of the event source to run after the application has been
freed, leading to use-after-free problem. To avoid the problem, we
should remove the event source before the application is freed.

This should fix SIGBUS crash of gio/tests/gapplication on FreeBSD.
https://gitlab.gnome.org/GNOME/glib/issues/1846#note_566550
2019-07-27 15:28:23 +08:00
Philip Withnall
78b1278d44 Merge branch '488-assert-gobjects-dont-leak' into 'master'
gobject: Add a g_assert_finalize_object() macro

Closes #1780 and #488

See merge request GNOME/glib!859
2019-07-25 15:42:39 +00:00
Philip Withnall
b6d4da7684 tests: Use g_object_assert_last_unref() in various tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-07-25 15:23:21 +01:00
Emmanuele Bassi
17be9e5c4c Merge branch '436-test-coredumps' into 'master'
Fix tests creating coredumps

Closes #436

See merge request GNOME/glib!959
2019-07-25 13:49:09 +00:00
Emmanuele Bassi
298ee8f87c Merge branch '1791-macos-get-mime-dirs' into 'master'
gcontenttype: Add no-op versions of {get,set}_mime_dirs() on win32/macOS

Closes #1791

See merge request GNOME/glib!927
2019-07-25 13:48:04 +00:00
Philip Withnall
3de1b88339 gcontenttype: Add no-op versions of {get,set}_mime_dirs() on win32/macOS
These are here to prevent linker errors, since `gcontenttype.[ch]`
aren’t compiled on Windows or macOS.

The implementations are stubs to be filled out by someone who knows each
platform, at some point in the future.

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

Fixes: #1791
2019-07-24 14:50:53 +01:00
Emmanuele Bassi
00d7568e4f build: Remove unsupported install directives
We're using the `install` argument for configure_file() all over the
place.

The support for an `install` argument for configure_file() was added in
Meson 0.50, but we haven't bumped the minimum version of Meson we
require, yet; which means we're getting compatibility warnings when
using recent versions of Meson, and undefined behaviour when using older
versions.

The configure_file() object defaults to `install: false`, unless an
install directory is used. This means that all instances of an `install`
argument with an explicit `true` or `false` value can be removed,
whereas all instances of `install` with a value determined from a
configuration option must be turned into an explicit conditional.
2019-07-24 12:45:02 +01:00