Commit Graph

20604 Commits

Author SHA1 Message Date
Florentina Mușat
179fdc5239 Update Romanian translation 2019-08-05 14:03:50 +00:00
Philip Withnall
37b2093f28 Merge branch 'contributing-fixes' into 'master'
Remove mentions of mailing lists from the documentation

See merge request GNOME/glib!1002
2019-08-05 10:20:40 +00:00
Emmanuele Bassi
57b6b4b1e8 Merge branch 'g-object-get-property-zero-init' into 'master'
g_object_get_property: Improve documentation for use of G_VALUE_INIT

See merge request GNOME/glib!1023
2019-08-01 09:47:56 +00:00
Simon McVittie
41d31cd4b7 g_object_get_property: Document accepting G_VALUE_INIT as new API
Code intended to be portable to older versions of GLib cannot rely
on this being considered valid.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-08-01 09:29:52 +01:00
Simon McVittie
bf8b669061 g_object_get_property: Clarify meaning of G_TYPE_INVALID
"Uninitialized value" is partially correct, since it has not been
initialized with a type, but it's more precise to say
"zero-initialized value". It is still a programming error to pass a
pointer to uninitialized memory with arbitrary contents as the value.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-08-01 09:29:52 +01:00
Daniel Mustieles
1f79c7f7c0 Updated Spanish translation 2019-07-30 09:38:18 +02: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
b80fcc6cb8 tests: Remove unneeded ";" in G_DEFINE_INTERFACE_WITH_CODE 2019-07-29 17:28:01 +02: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
6bebef1691 2.61.2
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-07-29 14:04:40 +01:00
Philip Withnall
018eaf5169 Merge branch '1438-deprecate-gtimeval' into 'master'
Deprecate GTimeVal- and GTime-based APIs

Closes #1438

See merge request GNOME/glib!1004
2019-07-29 12:59:50 +00:00
Emmanuele Bassi
5c5034ab8b Merge branch '1792-again-marshal-params' into 'master'
glib-genmarshal: Avoid a param ref for static param valist arguments

Closes #1792

See merge request GNOME/glib!928
2019-07-29 11:45:07 +00:00
Philip Withnall
14b087ea18 gmain.c: Fix comment about Y2038 safety of g_get_real_time()
This comment was correct until commit adf1f98f62, when the `GTimeVal`
which the result was put into (introducing the Y2038-unsafety) was
dropped.

The adjustment and scaling of the `FILETIME` should not make it
Y2038-unsafe: the maximum `FILETIME` is 2^64-1. Subtracting the epoch
adjustment and dividing by 10 gives the timestamp 1833029933770955161,
which is in June 58086408216 (at just after 3am UTC). I think that’s
enough time to be going on with.

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

Helps: #1438
2019-07-29 12:27:29 +01: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
2d62503fb0 gdatetime: Stop using deprecated g_get_current_time()
This requires some reworking of the internal g_date_time_new_from_unix()
function, since it previously operated in seconds, which wasn’t high
enough resolution — the g_get_current_time() code path used to operate
in microseconds.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
2df27e3416 tests: Ignore deprecated functions in a few main loop and timer tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
2ed76969d0 tests: Ignore deprecated functions in parts of GDateTime tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
82e3e109dd glib: Stop using g_get_current_time() in various places
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
c0f958de5b glib: Stop mentioning deprecated g_get_current_time() in docs
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
a3f22f0c2c gbookmarkfile: Use GDateTime instead of GTimeVal internally
Avoid using a deprecated type.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
aa261ca24a gasyncqueue: Ignore use of deprecated types in deprecated APIs
It’s unavoidable.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
45b74b02b8 gdate: Deprecate methods which use GTimeVal
GTimeVal is not year-2038-safe.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
ec0cc39de0 gmain: Add deprecation ignore guards around other GTimeVal usage
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
fe760ba442 gmain: Swap implementations of g_get_current_time() + g_get_real_time()
The former is now deprecated, so it makes sense to base its
implementation on the latter, rather than the other way around.

This introduces no functional changes.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
626b6f5ea7 gmain: Deprecate g_get_current_time() because it uses GTimeVal
GTimeVal is not year-2038-safe.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
b8540db1bf glib: Deprecate API using GTimeVal in gtimer.h
GTimeVal is not year-2038-safe.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
e971b25c6a gdatetime: Deprecate GDateTime API which uses GTimeVal
GTimeVal is not year-2038-safe.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
44d1fa3070 gdate: Fix minor typo in GTimeVal documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-07-29 12:27:29 +01:00
Philip Withnall
e3f88f311f gtypes: Deprecate GTimeVal in favour of guint64 or GDateTime
GTimeVal is subject to the year 2038 problem, since its `tv_sec` field
is a `glong`, which is 32 bits on 32-bit platforms.

Use `guint64` to represent microsecond-precision time since the Unix
epoch; or use `GDateTime` for full date/time representation.

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

Fixes: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
e357619d24 gdate: Minor documentation formatting improvements for GTime
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-07-29 12:27:29 +01:00
Philip Withnall
5983cc8742 gdate: Deprecate GTime
It’s not Y2038-safe, as it’s 32-bit. While it was previously deprecated
in the documentation, now add the deprecation annotation for the
compiler.

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

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
dbabd2b8a7 gdatetime: Add g_date_time_format_iso8601() convenience function
This is a simple wrapper around g_date_time_format_iso8601() which
always produces ISO 8601 dates, without people having to remember the
format string for them (and with the convenience of terminating UTC
dates with ‘Z’ rather than ‘+00’).

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
014e8d0547 Merge branch 'wip/lantw/gapplication-remove-inactivity_timeout-source-on-finalize' into 'master'
gapplication: remove inactivity_timeout source on finalize

See merge request GNOME/glib!1009
2019-07-29 09:50:39 +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
Emmanuele Bassi
d62cabc624 Merge branch '1847-log-structured-max-version' into 'master'
gmessages: Only use structured logs if GLIB_VERSION_MAX_ALLOWED is ≥2.56

Closes #1847

See merge request GNOME/glib!1008
2019-07-28 10:49:57 +00: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
54f94b1303 gmessages: Only use structured logs if GLIB_VERSION_MAX_ALLOWED is ≥2.56
Only redefine g_message() and friends to use structured logging if the
compiling code is OK with depending on GLib functionality from ≥2.56.

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

Fixes: #1847
2019-07-26 20:49:01 +01:00
Philip Withnall
517f756acf Merge branch 'rnagy/glib-mkdir' into 'master'
Resubmission of !832 “Try to create the complete path right away and fall back”

See merge request GNOME/glib!1007
2019-07-26 10:57:53 +00:00
Robert Nagy
ca98741251 gfileutils: Try creating complete path first
Try to create the complete path right away and fall back
to creating all path elements one by one.

This also helps to avoid TOCTTOU problems and avoids walking
the path all the time, providing a nice performance gain, by
avoiding syscalls.
2019-07-26 11:28:43 +01:00
Robert Nagy
6f55306e04 gfileutils: Ignore ENOENT from all except the last element
Ignore ENOENT errors up until the last element while trying to create each
of the path elements in case a restricted file-system is being used where
path elements can be hidden or non-accessible.
2019-07-26 11:27:50 +01:00