Commit Graph

29121 Commits

Author SHA1 Message Date
Philip Withnall
bc6d03c3c9 gsocketclient: Document async operation timeout/completion behaviour
These calls are where the `GSocketClient` Happy Eyeballs code relies on
other components within GLib (and glib-networking) to complete
asynchronous operations in a timely manner. `GSocketClient` doesn’t add
its own timeouts to monitor these async operations, so if the
implementations are buggy then a `GSocketClient` operation could stall
forever.

Make that a bit clearer.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-11-29 15:55:48 +00:00
Philip Withnall
240b8bbc2d gsocketclient: Clarify some internal comments
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-11-29 15:55:48 +00:00
Philip Withnall
641bea17f2 Merge branch '3037-capitalisation' into 'main'
docs: Consistently capitalise page titles

Closes #3037

See merge request GNOME/glib!3737
2023-11-29 15:48:02 +00:00
Philip Withnall
69c6413182 gsocketclient: Rename an internal variable and change it to a counter
This introduces no functional changes, but makes it a little clearer
what the variable signifies, and provides a little more information when
debugging things.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-11-29 15:27:16 +00:00
Philip Withnall
48963118b2 Merge branch 'wip/sophie-h/remove-nick-blurb' into 'main'
Remove all nicks and blurbs from param specs

Closes #2991

See merge request GNOME/glib!3411
2023-11-29 13:54:41 +00:00
Philip Withnall
c4b47c708d gwin32appinfo: Use correct gettext macro
`P_()` is for pspec strings — it gave us the option to split them out to
a separate translation domain. `_()` is for normal strings.

Spotted by Sophie Herold: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3411#note_1733329

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-29 13:41:34 +00:00
Sophie Herold
0d268c4825 Remove all nicks and blurbs from param specs
Nicks and blurbs don't have any practical use for gio/gobject libraries.
Leaving tests untouched since this features is still used by other libraries.

Closes #2991
2023-11-29 13:41:34 +00:00
Philip Withnall
f3aebf0c15 gio: Add various missing property documentation comments
Previously these properties would have been documented using the strings
from the pspec, but those will be removed in the following commit. Re-add
the documentation using those strings, but as gi-docgen documentation
comments.

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

Helps: #2991
2023-11-29 13:41:12 +00:00
Philip Withnall
7b2ac3c82e docs: Consistently capitalise page titles
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:13:13 +00:00
Philip Withnall
266f570f3c gsignal: Add missing (scope forever) annotations
Signals (as opposed to signal connections) can never be unregistered, so
these closures have to be around forever.

Fixes some g-ir-scanner warnings.

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

Helps: #3037
2023-11-29 12:04:59 +00:00
Philip Withnall
47869719be gboxed: Add missing (scope forever) annotations
Boxed types can never be unregistered, so these closures have to be
around forever.

Fixes some g-ir-scanner warnings.

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

Helps: #3037
2023-11-29 12:04:12 +00:00
Philip Withnall
58208c4ace gvarianttype: Add a missing argument name
To make it match its definition and documentation comment. This fixes a
g-ir-scanner warning.

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

Helps: #3037
2023-11-29 12:03:34 +00:00
Philip Withnall
81d96f5898 gmarkup: Add a missing (element-type) annotation
Fixes a g-ir-scanner warning.

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

Helps: #3037
2023-11-29 12:03:15 +00:00
Philip Withnall
02725b9bbd ghashtable: Add various missing (transfer) annotations
Fixes some g-ir-scanner warnings.

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

Helps: #3037
2023-11-29 12:02:49 +00:00
Philip Withnall
c7dfd218ea gerror: Add missing (scope forever) annotations
Extended error domains can never be unregistered, so these closures
have to be around forever.

Fixes some g-ir-scanner warnings.

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

Helps: #3037
2023-11-29 12:02:04 +00:00
Philip Withnall
c1547f62bc gbytearray: Add missing (transfer) annotations
`GByteArray` is a bit odd in that it allows call-chaining. All the
instances of that were missing a `(transfer none)` annotation though.

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

Helps: #3037
2023-11-29 12:01:12 +00:00
Philip Withnall
8f08c1a038 gthread: Make some argument names match up
This fixes a warning from g-ir-scanner as the declaration and
documentation comment didn’t match.

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

Helps: #3037
2023-11-29 12:00:35 +00:00
Philip Withnall
f14cd8de14 gcompletion: Make argument names match up
This fixes some warnings from g-ir-scanner.

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

Helps: #3037
2023-11-29 12:00:14 +00:00
Philip Withnall
d07c59ed4e glib: Add (scope call) to a load of sort/equal callbacks
This fixes a load of g-ir-scanner warnings.

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

Helps: #3037
2023-11-29 11:59:47 +00:00
Philip Withnall
d930b9058f gtlspassword: Add a missing (out) annotation
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 11:58:16 +00:00
Philip Withnall
045186a6f2 gthreadedresolver: Mark internal functions as private
This removes a few more g-ir-scanner warnings.

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

Helps: #3037
2023-11-29 11:57:54 +00:00
Philip Withnall
f50ef45220 gnetworking: Hide POSIX networking symbols from g-ir-scanner
They’re not part of the GLib API and don’t need to be exposed to the
scanner.

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

Helps: #3037
2023-11-29 11:57:20 +00:00
Philip Withnall
2a8b0c2388 gicon: Fix an invalid introspection annotation
`(hash)` is not an annotation — it’s probably a typo for `(virtual
hash)`.

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

Helps: #3037
2023-11-29 11:56:46 +00:00
Philip Withnall
d71d4507b8 gfileinfo: Drop an incorrect (transfer) annotation
This fixes a g-ir-scanner warning.

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

Helps: #3037
2023-11-29 11:56:16 +00:00
Philip Withnall
002f846312 gio: Add some missing (scope) annotations
This removes some of the gobject-introspection warnings.

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

Helps: #3037
2023-11-29 11:55:49 +00:00
Philip Withnall
7d0140eea0 gdbusmessage: Reformat a doc comment to gi-docgen format
In an attempt to make gobject-introspection stop warning about using
deprecated gtk-doc `Type:` tags.

It doesn’t work — the gobject-introspection parser is not clever enough
to notice the tag is inside a code block.

Still, a useful port.

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

Helps: #3037
2023-11-29 11:54:13 +00:00
Philip Withnall
e8edaeeb87 build: Rename -Dgtk_doc option to -Ddocumentation
Because the documentation is no longer built using gtk-doc.

Keep the old option around, but deprecated.

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

Helps: #3037
2023-11-29 10:26:37 +00:00
Philip Withnall
f6a1599e3c Merge branch '3183-arg0-paths' into 'main'
gdbusconnection: Support matching object paths with arg0 matching

Closes #3183

See merge request GNOME/glib!3720
2023-11-29 10:09:45 +00:00
Philip Withnall
93eeed4023 Merge branch 'wip/pwithnall/3119-Ey-years' into 'main'
gdatetime: Disable ERA support on platforms which don’t support this

See merge request GNOME/glib!3734
2023-11-29 00:14:18 +00:00
Philip Withnall
4b8bbd6f33 meson: Fail configure if nl_langinfo() supports a weird set of options
The `#include <langinfo.h>` in `gdatetime.c` is currently predicated on
`HAVE_LANGINFO_TIME`, but it’s needed for all the `HAVE_LANGINFO_*`
features.

It seems the code implicitly assumes that `HAVE_LANGINFO_TIME` will be
true if any other `HAVE_LANGINFO_*` macros are true. While I haven’t
seen this assumption be broken in practice, it seems prudent to
explicitly encode that in the configure tests. It’s easy enough to do.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-28 23:56:22 +00:00
Philip Withnall
8ee00cbad8 gdatetime: Disable ERA support on platforms which don’t support this
So far, that’s BSD: it supports `nl_langinfo()`, but not `ERA`.

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

Helps: #3119
2023-11-28 23:56:22 +00:00
Philip Withnall
26f70e7605 ci: Remove unused variable from run-style-check-diff.sh
This was forgotten in commit c2e21a8164.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-28 23:45:22 +00:00
Philip Withnall
bfa2f9091f ci: Fix printing info message at end of run-style-check-diff.sh
The changes in commit 95479256df didn’t
completely work (or some other change has broken them since): the
informational message at the end of the script is now not printed.

Fix that by stopping bash exiting immediately if the subshell exits, by
using it in a boolean expression.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-28 23:43:33 +00:00
Philip Withnall
9eda0b2fcd gdatetime: Fix typo in comment
This was pointed out in the review for !3696 but owing to a mistake by
me, the fix was not included in the version of the MR which was merged.

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

Helps: #3119
2023-11-28 23:14:40 +00:00
Philip Withnall
c8e3302007 gdatetime: Fix copyright/author information on recent GDateTime changes
I wrote the changes before clarifying the copyright status of my
contract with the GNOME Foundation, and forgot to update them.

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

Helps: #3119
2023-11-28 23:13:27 +00:00
Philip Withnall
2ada5ba0f1 Merge branch '3119-Ey-years' into 'main'
gdatetime: Add support for %E modifier to g_date_time_format()

Closes #3119

See merge request GNOME/glib!3696
2023-11-28 20:08:10 +00:00
Philip Withnall
517a3ac861 tests: Set locale to C.UTF-8 in datetime tests
It was previously set (by default) to `C`, so this commit doesn’t change
the locale behaviour of the tests, but does ensure that messages printed
by the tests are correctly formatted in UTF-8 rather than transliterated
to ASCII.

That makes interpreting test output easier.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-11-28 19:32:03 +00:00
Philip Withnall
09fe2aa78d gdatetime: Fix a minor leak on changing locale
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-11-28 19:32:03 +00:00
Philip Withnall
454064f82d gdate: Fix some typos in a documentation comment
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-11-28 19:32:03 +00:00
Philip Withnall
df4aea7620 gdatetime: Add support for %E modifier to g_date_time_format()
The `%E` modifier causes dates to be formatted using an alternative era
representation for years. This doesn’t do anything for most dates, but
in locales such as Thai and Japanese it causes years to be printed using
era names.

In Thai, this means the Thai solar calendar
(https://en.wikipedia.org/wiki/Thai_solar_calendar). In Japanese, this
means Japanese era names
(https://en.wikipedia.org/wiki/Japanese_era_name).

The `%E` modifier syntax follows what’s supported in glibc — see
nl_langinfo(3).

Supporting this is quite involved, as it means loading the `ERA`
description from libc and parsing it.

Unit tests are included.

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

Fixes: #3119
2023-11-28 19:32:02 +00:00
Philip Withnall
96c317418a gdbusconnection: Support matching object paths with arg0 matching
GDBus has always supported matching strings with arg0 matching
(`G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH`). In D-Bus 1.5, support was added
to the spec for also matching object paths. This got forgotten about and
was never added to GDBus, meaning that
`G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH` won’t match against a signal arg0
of type `o`.

Fix that, and add a unit test.

To do so, we need to add a new `g_dbus_message_get_arg0_path()` API to
complement the existing `g_dbus_message_get_arg0()` API. The approach of
letting `g_dbus_message_get_arg0()` return an object-path *or* a string
would not work, as it’s also called in the implementation of
`G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE`, which must only match
string-typed arg0 values and not object-path-typed ones.

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

Fixes: #3183
2023-11-28 14:42:41 +00:00
Philip Withnall
10e9a917be gdbusmessage: Cache the arg0 value
Technically we can’t rely on it being kept alive by the `message->body`
pointer, unless we can guarantee that the `GVariant` is always
serialised. That’s not necessarily the case, so keep a separate ref on
the arg0 value at all times.

This avoids a potential use-after-free.

Spotted by Thomas Haller in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3720#note_1924707.

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

Helps: #3183
2023-11-28 14:09:42 +00:00
Philip Withnall
ded4976337 Merge branch 'migrate-to-gi-docgen14' into 'main'
Switch to using gi-docgen for docs (batch 14)

Closes #3037

See merge request GNOME/glib!3724
2023-11-28 14:06:23 +00:00
Michael Catanzaro
6ecf380f22 Merge branch 'alpine-ci-name' into 'main'
ci: Make the Alpine CI name more consistent

See merge request GNOME/glib!3733
2023-11-28 13:57:20 +00:00
Matthias Clasen
6ca2934928 build: Remove all remaining gtk-doc build infrastructure
It’s no longer needed: the documentation is built by gi-docgen now.

Fixes: #3037
2023-11-28 13:52:35 +00:00
Philip Withnall
0fe3a9d1df docs: Drop the tools tutorial page
It’s completely out of date.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
54eb9b8900 docs: Convert the resources page to Markdown
And change mentions of ‘mailing lists’ to ‘support’ while I’m there.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
2c4a0c83e1 docs: Drop the regex-syntax page
Point people to the official PCRE documentation instead, which is going
to be more up to date. This saves us periodically having to copy in and
reformat the PCRE documentation.

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

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
ed5c17018f docs: Convert the programming page to Markdown
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-28 13:52:05 +00:00
Philip Withnall
59a4a239a1 docs: Remove the ‘changes to GLib’ page
We haven’t made any backwards-incompatible changes since GLib 2.2 in
2002. It’s probably not very useful to tell people about those any more.

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

Helps: #3037
2023-11-28 13:52:05 +00:00