Commit Graph

8324 Commits

Author SHA1 Message Date
Lukáš Tyrychtr
0e8e941e95 glocalfileinfo: Preserve microseconds for access/modify times
When setting the file time using utimensat, don't ignore
microseconds for access/modify times. By doing that, they're preserved
when using g_file_info_set_modification_date_time and then setting the file's
attributes from it.

Fixes #3116
2023-10-03 09:32:44 +01:00
Nelson Benítez León
40f567aa2a GDesktopAppInfo: prioritize match_type over match_category when searching apps
Commit 9e2ad88455 improved app search results by allowing to differentiate
their match_type: prefix match or substring match; while giving more priority
to prefix matches over substring matches, but only when they are in the same
match_category[1].

This was a step forward but, as outlined in #3082, still not enough to get
most relevant results first to the user, because apparently (and for the
specific case of desktop app searching) a prefix match in a lower category
is more relevant to the user than a substring match in a higher category.

So that's what this commit implements, i.e. it makes sure prefix matches
are still preferred over substring matches but this time not only when
in the same category but also across different categories.

[1] Match category is the Desktop file key where the match happened.
    They are shown below from top to lesser priority.
      DESKTOP_KEY_Name
      DESKTOP_KEY_Exec
      DESKTOP_KEY_Keywords
      DESKTOP_KEY_GenericName
      DESKTOP_KEY_X_GNOME_FullName
      DESKTOP_KEY_Comment

Fixes #3082
2023-10-03 09:10:21 +01:00
Nelson Benítez León
3c22e2745c test: improvements for GAppInfo test
· Add a usage output that is printed when called with no argument
   or with '--help' argument. This is helpful as it avoids having
   to read the source code to know how to run the different options.

 · Adds new '--should-show-only' option to 'search' command, to
   better mimick the gnome-shell app search, by not returning
   apps with NoDisplay=true.

  Example for running a desktop app search with the new option from
  inside the GLib build dir:
    $ gio/tests/apps search --should-show-only settings
2023-10-03 09:10:21 +01:00
Emmanuele Bassi
1cd0dfa55b Merge branch '3107-use-portal' into 'main'
gio: Rename GTK_USE_PORTAL to GIO_USE_PORTALS

Closes #3107

See merge request GNOME/glib!3602
2023-10-02 17:27:36 +00:00
Philip Withnall
86fdb4c7bf Merge branch 'ebassi/issue-3130' into 'main'
Check for empty property name in GPropertyAction

Closes #3130

See merge request GNOME/glib!3599
2023-10-02 17:09:55 +00:00
Arjan Molenaar
e9f0259e5d tests: Add a test for initialising GPropertyAction with no name
Helps: #3130
2023-10-02 17:17:24 +01:00
Emmanuele Bassi
3a2af81ced Check for empty property name in GPropertyAction
Make sure to fail consistently in case people created a GPropertyAction
with g_object_new() without passing a property name.

Bindings that construct objects with g_object_new() have no idea if a
property is mandatory.

See: #3130
2023-10-02 17:17:24 +01:00
Philip Withnall
525508be0d gpropertyaction: Split dispose/finalize
This avoids a critical warning from trying to disconnect a signal
handler from a `NULL` object if `paction->object` is `NULL` for whatever
reason (see: the following commit).

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #3130
2023-10-02 17:17:24 +01:00
Philip Withnall
5bc6c2035a gio: Rename GTK_USE_PORTAL to GIO_USE_PORTALS
The `GTK_USE_PORTAL` environment variable has started to be misused by
users, which is causing deployment issues (such as portal services
themselves ending up being forced to use portals, which is never going
to work).

Try and sidestep users’ broken configurations by renaming the
environment variable, and also separating it from the old GTK
environment variable, since the GLib one affects a lot more processes.
This environment variable is meant to be used for
debugging and development, and never in production.

GTK already renamed their environment variable in
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4829, so keeping the
`GTK_USE_PORTAL` name in GLib doesn’t make sense anyway.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #3107
2023-10-02 15:00:23 +01:00
Alessandro Bono
272ec5dbca tests/gsubprocess: Don't rely on PTRACE_O_EXITKILL presence
The PTRACE_O_EXITKILL symbol was introduced in glibc 2.23. CentOS7
has glibc 2.17. Use the symbol only if it is defined.
2023-09-19 12:37:23 +02:00
Pavel Sobolev
cabc494073
Make sure the GTask is freed on a graceful disconnect
This fixes the memory leak in the case the connection has been
successfully closed by the peer.
2023-09-14 15:42:24 +03:00
Philip Withnall
82c764ce2e gthreadedresolver: Fix race between source callbacks and finalize
I had thought that because `g_source_destroy()` was called for the two
sources (cancel and timeout) in the `GTask` finalize function for a
threaded resolver operation, that it would be fine to use a plain
pointer in the source callbacks to point to the `GTask`.

That turns out to not be true: because the source callbacks are executed
in the GLib worker thread, and the `GTask` can be finalized in another
thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
be scheduled in the worker thread, then for the `GTask` to be finalized,
and then the source callback to continue execution and find itself
doing a use-after-free.

Fix that by using a weak ref to the `GTask` in the source callbacks,
rather than a plain pointer.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Fixes: #3105
2023-09-11 16:02:15 +01:00
Benoit Pierre
6380303779 meson: fix gnetworking.h install tag 2023-09-01 22:24:39 +02:00
Philip Withnall
137956e700 Merge branch '3061-dbus-name-crash' into 'main'
gdbusmessage: Validate required headers have the right type

Closes #3061

See merge request GNOME/glib!3539
2023-08-31 10:14:03 +00:00
Philip Withnall
ed03b1f3f6 gresourcefile: Fix crash if called with a badly escaped URI
Return an invalid `GFile` instead, as is the custom for VFS functions.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Fixes: #3090
2023-08-29 11:22:43 +01:00
Emmanuele Bassi
5f8af01b8b Generate RST anchors for methods, signals, and properties
Don't rely on the titles.
2023-08-28 16:59:32 +01:00
Emmanuele Bassi
5f33ae8901 Generate missing docs for out arguments
The reStructuredText generator is missing the documentation blocks for
out arguments.
2023-08-28 16:59:32 +01:00
Philip Withnall
9f6b77d835 gdbusconnection: Add some assertions about required message fields
The fields are fully validated in `validate_headers()` in
`gdbusmessage.c` now, so the connection code should be able to rely on
the required ones being non-`NULL`.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3061
2023-08-28 11:11:37 +01:00
Philip Withnall
eae5c49085 gdbusconnection: Combine two identical variables
`object_path` and `path` were doing exactly the same thing here.

This introduces no functional changes.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-08-28 11:11:37 +01:00
Philip Withnall
7cca4b1590 gdbusmessage: Validate required headers have the right type
We already validated that the required headers for each type of D-Bus
message were present. However, we didn’t validate that they contained a
variant of the right type. This could lead to functions like
`g_dbus_message_get_path()` returning `NULL` unexpectedly.

This failure could only be hit when using GDBus in peer-to-peer mode, or
with a D-Bus server which didn’t validate the headers itself. The
reference D-Bus server does validate the headers, and doesn’t forward
invalid messages to clients.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Fixes: #3061
2023-08-28 11:11:37 +01:00
Philip Withnall
943972facf Merge branch 'wip/JCWasmx86/gresource-schema' into 'main'
gio: Add gresource.dtd

See merge request GNOME/glib!3540
2023-08-17 14:03:39 +00:00
JCWasmx86
0b4a9db4a7 gio: Add dtdsdir pointing to the directory of gresource.xml
This allows third party projects to look up the location of installed
DTDs without having to hard-code it.
2023-08-17 14:26:34 +01:00
JCWasmx86
f10bb13314 gio: Add gresource.dtd
This allows linting of .gresource.xml files e.g. in the editor.
2023-08-17 14:25:53 +01:00
Michael Catanzaro
77a56b58ed Merge branch 'o-nonblock-more' into 'main'
glib-unix: Accept O_CLOEXEC as well as FD_CLOEXEC in g_unix_open_pipe()

See merge request GNOME/glib!3538
2023-08-16 18:13:13 +00:00
Philip Withnall
07c4b6c68e glib: Pass O_CLOEXEC rather than FD_CLOEXEC to g_unix_open_pipe()
See the previous commit.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-08-16 14:31:40 +01:00
Philip Withnall
954b15218c Merge branch 'mcatanzaro/l10n-time' into 'main'
gsettingsschema: fix l10n=time attribute

Closes #2575

See merge request GNOME/glib!2422
2023-08-16 13:24:18 +00:00
André
9a6ca0ef75
gdbus-codegen: preserve relative indentation in doc comments
This commit also changes the generators for rst, xml and dockbook
to preserve indentation.

Closes #3032
2023-08-14 23:46:09 -03:00
Philip Withnall
c00d7999b1 Merge branch 'th/use-getservbyname-r' into 'main'
gnetworkaddress: use reentrant getservbyname_r() if available

See merge request GNOME/glib!3526
2023-08-14 09:24:51 +00:00
Thomas Haller
f738c7f3db gio: use reentrant getservbyname_r() if available 2023-08-14 09:32:43 +01:00
Thomas Haller
8aa889dbf1 gio: include missing dependency in "gio/gnetworkingprivate.h"
Otherwise, GResolver typedef is unknown.
2023-08-14 09:32:43 +01:00
Thomas Haller
adb3763592 tests: add case for getservbyname() during g_network_address_parse()
Add test cases that result in lookup of the port via
getservbyname().

As the result depends on "/etc/services", it's not reliably the same on
every system. It requires a workaround.
2023-08-14 09:32:43 +01:00
Philip Withnall
065069191c tests: Disable use of ptrace() in tests on BSD and macOS
Commit cf55c31170 added a new test which
uses `ptrace()` to check some `GSubprocess` behaviour. FreeBSD uses
different symbol names for ptrace symbols, and we haven’t tested whether
the test works (and reproduces the failure) on FreeBSD, so skip the test
for now.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-08-14 09:27:07 +01:00
Philip Withnall
73d2658191 Merge branch 'thread-safe-menus_get_interface' into 'main'
gmenuexporter: synchronization in org_gtk_Menus_get_interface.

Closes #3051

See merge request GNOME/glib!3529
2023-08-13 14:21:15 +00:00
Philip Withnall
3ee019c036 Merge branch 'gio-tool-info-translator-comments' into 'main'
gio-tool-info: Move translator comments so they’re visible

See merge request GNOME/glib!3528
2023-08-13 14:18:58 +00:00
André
5fb89dd597
gmenuexporter: synchronization in org_gtk_Menus_get_interface.
Protects the mutation inside org_gtk_Menus_get_interface with
g_once_init_{enter,leave}.

Fixes #3051.
2023-08-13 01:21:49 -03:00
Philip Withnall
65e7a10d2a Merge branch 'macos_ci' into 'main'
interim solution for macOS CI

See merge request GNOME/glib!3503
2023-08-12 22:52:57 +00:00
Philip Withnall
faee7d0858 gio-tool-info: Move translator comments so they’re visible
The tooling won’t pick them up unless they’re directly above the gettext
calls.

Spotted by Piotr Drąg in
ec03755355 (note_1808152).

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-08-12 20:01:36 +01:00
Jonas Ådahl
cf55c31170 gio/tests: Add test case for exit status when being ptraced
The test case will fail with the

    g_assert_false (g_subprocess_get_successful (proc));

assert failing. Without the fix, it'll hit sometimes, but rather
unreliably. When running `meson test --repeat 100`, it'll reproduce
anywhere between the first or much later, but mostly before the 20th
iteration on my system.

Helps: #3071
2023-08-12 19:30:00 +01:00
René de Hesselle
439204ed7d Re-enable macOS CI on a new self-hosted runner
Allow two more tests to fail on macOS for the time being:
https://gitlab.gnome.org/GNOME/glib/-/issues/3069
https://gitlab.gnome.org/GNOME/glib/-/issues/3070
2023-08-11 19:33:19 +02:00
Michael Catanzaro
306d4567d2 Replace setlocale() with uselocale() in GSettings l10n tests
It's not safe to use setlocale() to mutate the locale in a threaded
program. Lots of other tests still do this, and I'm not putting in the
effort to fix them comprehensively in the absense of actual failures on
CI, but I figured it'd be good to fix the tests that I was touching.
2023-08-03 09:45:58 -05:00
Michael Catanzaro
736000e49e Remove setenv() use from GSettings l10n tests
This definitely does not do anything on Linux. I bet it's not needed on
other platforms, either. It's unsafe and may crash; there is no safe way
to mutate the environment in threaded programs.
2023-08-03 09:16:27 -05:00
Michael Catanzaro
92de7298c8 Add test for l10n="time" gschema attribute
This is a copy of the existing test_l10n, modified to use LC_TIME
instead of LC_MESSAGES. It's not safe as each call to g_setenv() or
setlocale() could cause the test to crash; there is no safe way to
change a threaded process's environment, and a threaded process's locale
can only be safely changed using uselocale(), not with setlocale().

The calls to g_setenv() are definitely not needed on Linux. I wonder
whether removing these will break the test on other platforms?

The calls to setlocale() should be replaced by a dance of
uselocale() -> duplocale() -> newlocale() -> uselocale() on Linux. But
this is not portable and this is a cross-platform test. We would have to
make the test platform-specific to do this. macOS and at least FreeBSD
provide these functions via xlocale.h, but this isn't portable.
2023-08-03 09:16:26 -05:00
Michael Catanzaro
34e4c4af77 gsettingsschema: fix l10n=time attribute
It's supposed to be possible to translate settings values using LC_TIME
rather than LC_MESSAGES to determine which translation to use, but
Sebastian Keller noticed that it's not working properly. I've
implemented his proposed solution, which is to actually temporarily
change LC_MESSAGES to match LC_TIME for just as long as necessary to
force gettext to use the desired message catalog.

Fixes #2575
2023-08-03 09:10:58 -05:00
Federico Gallo Herosa
89be3d357d
Fix typos
Fix typo in gio/gappinfo (duplicated word)
Fix typo in gio/gtlsdatabase.c (duplicated word)
Fix typo in gio/gapplication.c (duplicated word, previous words rearranged to improve readability)
Fix typo in glib/tests/gvariant.c (duplicated word)
Fix typo in glib/win_iconv.c (duplicated word)
Fix typo in gio/gschema.dtd (meaning, missing letter)
Fix typo in gio/gdbusintrospection.c (duplicated word)
Fix typo in gio/gdbusintrospection.c (duplicated word).
2023-08-01 15:33:21 -03:00
Philip Withnall
02bc1382b2 gnetworkmonitor: Expand guidelines for metered data use
Clarify how much is too much.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-07-29 15:22:15 +03:00
Philip Withnall
39864716d6 Merge branch 'fix_3050' into 'main'
Strip query sections from file: URIs

Closes #3050

See merge request GNOME/glib!3502
2023-07-28 12:52:36 +00:00
Lukáš Tyrychtr
b504cc0841 gfile: Strip query sections from file: URIs
According to https://url.spec.whatwg.org/#file-state
a file URI can have a fragment and query string, so just ignore them
and don't raise an invalid URI error.

Fixes: #3050
2023-07-28 15:04:49 +03:00
Eric van Gyzen
6b4b4cd889 Fix build race between gio subdirs and gversionmacros.h
I made the kqueue failure 100% reliable with `samu -j1` on FreeBSD,
and therefore confirmed this fixes that problem.  Issue #2929 is
an identical failure on win32, so I assume this fixes that, too,
but I haven't confirmed.

Fixes: #2929
2023-07-25 20:28:20 -05:00
Philip Withnall
9b80774ca7 Merge branch 'fileinfo-filepath' into 'main'
gfileinfo: add file_path methods for language bindings

See merge request GNOME/glib!3461
2023-07-22 05:27:12 +00:00
Jason Francis
04b683c34f gfileinfo: add file_path methods for language bindings
Including some tests by Philip Withnall.
2023-07-21 21:24:50 +01:00
Philip Withnall
b4a6343a5c Merge branch 'mcatanzaro/closure-audit' into 'main'
Audit and fix incorrect use of (closure) in glib

See merge request GNOME/glib!3287
2023-07-21 19:20:07 +00:00
Michael Catanzaro
12e48719af Fix scope annotation on g_file_move_async()
Currently the callback is invalid after the call to g_file_move_async(),
before g_file_move_finish() is called. That is no bueno.
2023-07-21 19:04:37 +01:00
Michael Catanzaro
5d738ddcfe Audit and fix incorrect use of (closure) in glib
Following Emmanuele's instructions for use of introspection annotations:

https://www.bassi.io/articles/2023/02/20/bindable-api-2023/

I have audited all uses of the (closure) annotation in glib and
determined that only a handful are correct. This commit changes almost
all of our use of (closure) annotations to conform to Emmanuele's rules.
2023-07-21 19:03:57 +01:00
Michael Catanzaro
a552bf5694 Merge branch 'revert3356' into 'main'
Revert "build/gmodule-2.0.pc: Move compiler flags from Libs to Cflags"

See merge request GNOME/glib!3504
2023-07-20 15:20:58 +00:00
Philip Withnall
2b391227e6 tests: Fix pkg-config test for multiarch binaries on multiarch systems
The test was passing fine when `bindir` was equal to `multiarch_bindir`,
but not when they differ.

For example, on a Debian system, `gio-querymodules` is installed to
`/usr/lib/x86_64-linux-gnu/glib-2.0/gio-querymodules` rather than
`/usr/bin/gio-querymodules` as it is on (say) Fedora.

This was causing the pkg-config tests to fail on Debian.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #3045
2023-07-20 13:30:34 +01:00
Harald van Dijk
6e29fbec2d
Revert "build/gmodule-2.0.pc: Move compiler flags from Libs to Cflags"
This reverts commit 004f48f4fc.

Per the discussion on #3356, this change was prompted by a
misunderstanding of ldflags/link_args, and it resulted in various other
packages using glib no longer getting symbols exported. This commit
restores the glib 2.76 behaviour.
2023-07-18 18:26:49 +01:00
Corey Berla
a1a00a3071 gdbus-codegen: Error on invalid dbus types
Introduce slightly modified (dbus specific) versions of
variant_is_signature and variant_type_string_scan in order to fail
early on bad type strings.
2023-07-12 15:33:22 -07:00
Philip Withnall
9dd477dd77 Merge branch '3039-android-statx' into 'main'
glocalfileinfo: Fix incorrect use of struct statx.st_mtimensec on Android

Closes #3039

See merge request GNOME/glib!3482
2023-07-04 16:14:33 +00:00
Marco Trevisan (Treviño)
27b7559c91 gdbus-codegen: Define only one marshaller per signature reusing across interfaces
Avoid generating more code than needed, so other than continuing using
the generic glib marshallers when possible, define once the custom ones
we need for each file we generate.

The marshallers are then re-used across all the interfaces defined
without duplicating the code size.
2023-06-30 23:40:03 +02:00
Marco Trevisan (Treviño)
23180d433e gdbus-codegen: Try to reuse default glib marshallers for simpler signals marshallers
If a signal signautre is simple enough we can just reuse the default
marshallers by simply creating a wrapper marshaller
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
c5d9004236 gdbus-codegen: Use direct-access GValue macros for marshallers and GValues
This is the same we're doing in code generated by glib-genmarshaller and
what gmarshal does internally.

Since the generated gdbus C code can be considered private too, this is
safe to do, and will allow faster access to GValue objects.
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
8943ceae6c gdbus-codegen: Generate marshallers for method handlers signals
Get rid completely of the usage of the generic marshaller in gdbus
generated code, using instead specific marshallers.

Code is not yet optimized fully since we may still have duplicated
functions to be generated.

Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/3028
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
6de362fcae gdbus-test-codegen: Add test to check that fd lists can be passed
Add a simple implementation to check that fd-passing works when using
generated code, this is going to be useful to test special marshalling
case.
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
3d313147f0 gio/test-codegen: use valid interface name for FdPassing test
So that it can be ran for real, not only tested for generation
2023-06-30 22:59:37 +02:00
Marco Trevisan (Treviño)
7b750972e8 meson/gio: Increase timeout for the codegen python tests
It's adding more stuff, let's ensure it wont timeout for no reason in
some platforms.

As per this mark also it as 'slow'
2023-06-30 22:59:25 +02:00
Marco Trevisan (Treviño)
1cd5c5678a gdbus-codegen: Generate signal marshallers for each interface signal
We relied on g_cclosure_marshal_generic() to easily generate signal
marshallers, but this relies on inspecting each parameter type with ffi
and this implies a performance hit, other than breaking the stack-frame
unwinder used by Linux perf and so by sysprof.

Given that we know the types we work on, it's easy enough to generate
the marshallers ourself.

Helps with: https://gitlab.gnome.org/GNOME/glib/-/issues/3028
2023-06-30 22:17:46 +02:00
Marco Trevisan (Treviño)
51c023f189 tests/codegen: Add checks for signal emission enums
These are checked to be correct by code compilation, but let's ensure we
also have some kind of forma check on the expected syntax.
2023-06-30 22:17:46 +02:00
Marco Trevisan (Treviño)
4b05e06e1c gdbus-codegen: Address more black cleanups 2023-06-30 22:17:46 +02:00
Marco Trevisan (Treviño)
1b345e411f meson: Add all the gdbus-codegen based tests to the proper suite
So it's easier to run them all with --suite=gdbus-codegen
2023-06-30 18:11:18 +02:00
Luca Bacci
2dc0a43bc0 glocalfileinfo: Fix GLocalFileStat getters on MinGW x86
For some reason, `time_t` is defined as being 32 bits wide on that
platform, which causes truncation of the timestamps from `struct stat`.

Avoid that problem by consistently using a 64-bit return value from the
`struct stat` accessors.

Helps: #3039
2023-06-30 15:00:56 +01:00
Marco Trevisan (Treviño)
88d48a7a22 codegen: Use g_signal_emit to emit signals
We were using emit_by_name which implies looking up for the signal name,
while the generated code can easily remember the signal ID and use it
instead, allowing direct access to the signal emission.
2023-06-29 22:20:05 +02:00
Philip Withnall
9845f880ca glocalfileinfo: Delete some redundant code
`_g_stat_has_field (statbuf, G_LOCAL_FILE_STAT_FIELD_ATIME)` will always
return `TRUE` on Windows (since it uses a basic `struct stat`), so the
platform-inspecific code is equivalent to the Windows-specific code.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-06-28 17:49:45 +01:00
Philip Withnall
c3762deb78 glocalfileinfo: Fix incorrect use of struct statx.st_mtimensec on Android
`GLocalFileStat` is a platform-specific abstraction around `struct stat`
or `struct statx`. If `struct statx` is available, it will use that by
preference as it has more features.

`glocalfileinfo.c` was, in some places, incorrectly accessing the fields
of `GLocalFileStat` directly rather than through its `_g_stat_*()`
getters. While it correctly accounted for the platform-specific
differences between `st_mtimensec` and `st_mtim.tv_nsec`, it hadn’t been
updated to deal with `stx_mtime`.

On Android, `st_mtimensec` is defined as a fallback for
`st_mtim.tv_nsec` (even though it doesn’t need to be). This caused GLib
to take the `st_mtimensec` code path rather than the `stx_mtime` code
path, and hence try to dereference `st_mtim` in a `struct statx`.

Fix that by correctly using the `_g_stat_*()` getters consistently.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #3039
2023-06-28 17:32:25 +01:00
Philip Withnall
989b4cb8bd gapplication: Tweak option group description
To match the documented style for all option group descriptions.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #3007
2023-06-28 17:04:59 +01:00
Ondrej Holy
c083a4d1a6 gio-tool-mount: Add option to show progress when unmounting 2023-06-28 15:51:51 +00:00
N.Pranav Krishna
b963bcf8c5 Added Annotations 2023-06-27 16:49:43 +00:00
Christian Hergert
d972ba03b4 listmodel: add documentation about unique instances
This has subtly been required and the original intention, so make it more
discoverable by adding to the documentation.

Fixes #3030
2023-06-21 11:01:52 -07:00
Matthias Clasen
4171fba2fe gapplication: Clarify docs
D-Bus does not support maybe types, therefore
using such types are action parameters in
GApplication does not work.

Fixes: #3027
2023-06-10 08:04:49 -04:00
Philip Withnall
8cad32a118 Revert "tests: Temporarily disable socket test due to a kernel bug"
This reverts commit 1507585869.

This should now be fixed:
https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/981#note_1760399.

Fixes: #2879
2023-06-07 12:29:03 +01:00
Maximiliano Sandoval R
389398d444
resolver: Add space in documentations
It is standard practice to put a space in between Returns and Since in docstrings.
2023-06-04 17:33:00 +02:00
Philip Withnall
fbc66b834e Merge branch 'mcatanzaro/#2829' into 'main'
Improve depfile generated by glib-compile-resources

Closes #2829

See merge request GNOME/glib!3460
2023-06-01 09:36:15 +00:00
Michael Catanzaro
3e3a0304f7 Improve depfile generated by glib-compile-resources
glib-compile-resources --dependency-file= currently generates a depfile
with rules that look like this:

foo.xml: resource1 resource2

This means that if any of the files listed in the GResource manifest
foo.xml change, rebuild foo.xml because foo.xml depends on those files.
This is not useful because the XML manifest is not expected to be a
generated dependency and even if it was, changes to the listed files
would not imply any need to regenerate the manifest. What we really do
need to regenerate is the C source file that is generated by
glib-compile-resources after processing the XML manifest and all the
resource files. That is, the rule should look like this:

foo.c: foo.xml resource1 resource2

as suggested by Hans Ulrich Niedermann in the issue report.

Fixes #2829
2023-05-31 14:50:21 -05:00
Jason Francis
c556a4d8f8
gfileinfo: add (type filename) annotation to symlink_target functions 2023-05-31 00:54:38 -04:00
Michael Catanzaro
cc5bb80b9a Fix failure to respect default port of proxy URLs
Currently we require explicitly specifying the port when configuring a
proxy server, which is seriously weird. I take the fact that nobody
reported a bug until 2022 to indicate that almost nobody is using
proxies. Whatever. Let's assume that if no port is provided, the default
port for the protocol should be used instead.

For example, you can now specify in GNOME settings that your proxy server
is https://example.com and it will work. Previously, you had to write
https://example.com:443. Yuck!

This was originally reported as GProxyResolver bug, but nothing is
actually wrong there. It's actually GProxyAddressEnumerator that gets
tripped up by URLs returned by GProxyResolver without a default port.
This breaks GSocketClient.

Fixing this requires exposing GUri's _default_scheme_port() function to
GIO. I considered copy/pasting it since it's not very much code, but I
figure the private call mechanism is probably not too expensive, and I
don't like code duplication.

Fixes #2832
2023-05-30 09:49:43 -05:00
Philip Withnall
1aefcf4e0e Merge branch 'ok/termux-build-issues' into 'main'
gio, tests: adaptations for building with bionic libc from termux

Closes #3008

See merge request GNOME/glib!3443
2023-05-30 13:04:17 +00:00
Philip Withnall
ad464d5563 Merge branch 'main' into 'main'
gio/tests/portal-support: Fix snap test ordering race

Closes #3020

See merge request GNOME/glib!3454
2023-05-30 12:29:06 +00:00
Philip Withnall
0196a36022 Merge branch 'more-atomic-exchange-full' into 'main'
gdataset, gobject: Use atomic compare and exchange full to set pointers

See merge request GNOME/glib!3426
2023-05-30 11:59:40 +00:00
Marco Trevisan (Treviño)
ea904fba1a gresource: Use compare and exchange full to get registered resources 2023-05-30 12:34:41 +01:00
Philip Withnall
28f83c9cf7 gresource: Ensure lazy_register_resources is always accessed atomically
On some platforms, pointer-sized reads are not necessarily atomic, so we
always need to use the correct atomic access primitives.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-05-30 12:33:48 +01:00
Richard Purdie
c63cf19d9a gio/tests/portal-support: Fix snap test ordering race
When the gnome test runner executes the tests, the test appear to execute in disk
order. This means it sometimes works and sometimes we see breakage in portal-support-snap
and portal-support-snap-classic.

The issue is that some tests create config files but some don't. If they run
in the wrong order, tests see config files they shouldn't and break.

Fix this by deleting the files after each test run, properly cleaning up after
themselves. The cleanup code is based upon gtestutils.c:rm_rf().

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-30 12:28:45 +01:00
Guido Günther
b3b23072f3 gactionmap: Add g_action_map_remove_action_entries()
Since we have a convenience method to add actions let's allow to remove
them just as easily. This makes resource cleanup as simple as initially
adding the entries.
2023-05-26 10:30:40 +01:00
Guido Günther
ac840b954f gactionmap: Move declaration of loop var in g_action_map_add_action_entries() 2023-05-25 17:45:17 +02:00
Guido Günther
596fec811d gactionmap: Check for < 0 in g_action_map_add_action_entries()
Assume that all negative values mean `NULL` terminated. Everything else
will cause a disaster anyway.
2023-05-25 17:43:09 +02:00
Philip Withnall
ecbe360a38 Merge branch '3003-glib-compile-schemas-failed' into 'main'
glib-compile-resources: Fix non-ASCII arg parsing on Windows

Closes #3003

See merge request GNOME/glib!3446
2023-05-23 17:16:27 +00:00
Daniyar Tleulin
49537e298c glib-compile-schemas: Fix non-ASCII arg parsing on Windows
When the source directory contains non-ASCII symbols,
argument parsing previously failed on MINGW64.

Fixes: #3003
2023-05-23 16:49:21 +06:00
Daniyar Tleulin
0305d237dd glib-compile-resources: Fix non-ASCII arg parsing on Windows
When the source directory contains non-ASCII symbols,
argument parsing previously failed on MINGW64.

Fixes: #3003
2023-05-23 16:48:41 +06:00
Sonny Piers
0b73d72a44 gio: Add g_file_new_build_filenamev 2023-05-23 10:14:28 +00:00
Øyvind Kolås
786f379d78 gio/tests: avoid shadowing of libc names under bionic libc
Makes the tests compile using clang with meson directly under
termux on android, this build environment does not approve of
overloading libc symbols.

Fixes: #3008

foo
2023-05-22 22:44:52 +02:00
Øyvind Kolås
3050c16aea gio: define hasmntopt ourselves under bionic libc
This is a workaround for build conditions one ends up with under termux,
where the defined __ANDROID_API__ level is lower than what is provided
by gcc installed for it, the libc .so nevertheless contains these symbols
thus enabling the codepaths. This definition is only in use when meson
detected the presence of this symbol in the libc.

Fixes #3008

foo
2023-05-22 22:44:52 +02:00
Carlos Garnacho
4641b02ca2 gio: Add test for local enumerator cancellation
Check that the enumerator is able to cancel if told so.
2023-05-19 11:53:18 +00:00