Commit Graph

2638 Commits

Author SHA1 Message Date
Philip Withnall
bb4bec0921 gmessages: Expose a property for enabling debug message output
This is an API analogue of the G_MESSAGES_DEBUG environment variable. It
is intended to be exposed outside applications (for example, as a D-Bus
interface — see follow-up commits) so that there is a uniform interface
for controlling the debug output of an application.

Helps: #1190
2022-01-26 15:17:02 +00:00
Marc-André Lureau
83d45c4f35 gio: compile GUnixConnection on all platforms
On !UNIX, return an error for send_fd() & receive_fd().
(the unixfdmessage unit is not compiled on !UNIX)

The header is installed under the common GIO include directory.

Ensure G_TYPE_UNIX_CONNECTION is registered on all platforms.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
af1777d3d3 meson: compile GUnixCredentialsMessage on all platforms
The header is now also installed under the common GIO include directory.

Sorry if it breaks any build, you had to use the correct header path.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
3308cfb020 gio: compile GUnixSocketAddress on all platforms
Move the header under the common GIO include directory.

Sorry if it breaks any build, you had to use the correct header path.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
4339192b53 gio: add fallback afunix.h header
afunix.h is only recently distributed with Windows SDK & MinGW.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:23 +04:00
Emmanuele Bassi
1437be8049 docs: Add --generate-rst to the gdbus-codegen docs 2022-01-22 01:30:16 +00:00
Philip Withnall
3be0fc867e Merge branch 'wip/hash-table-from' into 'main'
ghash: Add g_hash_table_new_similar

See merge request GNOME/glib!2405
2022-01-19 11:19:07 +00:00
Jonas Ådahl
283d9e0c15 ghash: Add g_hash_table_new_similar()
This function creates a new hash table, but inherits the functions used
for the hash, comparison, and key/value memory management functions from
another hash table.

The primary use case is to implement a behaviour where you maintain a
hash table by regenerating it, letting the values not migrated be freed.
See the following pseudo code:

```
GHashTable *ht;

init(GList *resources) {
  ht = g_hash_table_new (g_str_hash, g_str_equal, g_free, g_free);
  for (r in resources)
    g_hash_table_insert (ht, strdup (resource_get_key (r)), create_value (r));
}

update(GList *resources) {
  GHashTable *new_ht = g_hash_table_new_similar (ht);

  for (r in resources) {
    if (g_hash_table_steal_extended (ht, resource_get_key (r), &key, &value))
      g_hash_table_insert (new_ht, key, value);
    else
      g_hash_table_insert (new_ht, strdup (resource_get_key (r)), create_value (r));
  }
  g_hash_table_unref (ht);
  ht = new_ht;
}
```
2022-01-18 22:19:55 +01:00
Alexander Schwinn
28d833a075 Make clear in doc that signals are emitted synchroniously 2022-01-18 08:53:20 +00:00
Patrick Griffis
96ce3feeb9 gtlscertificate: Add ability to load PKCS #12 encrypted files
This depends on the GTlsBackend implementing these properties
2022-01-07 11:27:56 -06:00
Sophie Herold
68eab1d999 utils: Add XDG_STATE_HOME support 2021-12-24 20:11:39 +00:00
Mohammed Sadiq
3bd2ab4550 docs: Improve GVariant docs
Fix a typo and expand examples to include freeing memory
where it's not obvious
2021-11-29 15:24:15 +05:30
Marc-André Lureau
b4631c44ad galloca: Add new API g_alloca0 and g_newa0
Added `g_alloca0()` which wraps `g_alloca()` and initializes
allocated memory to zeroes.

Added `g_newa0()` which wraps `g_alloca0()` in a typesafe manner.

Refreshed and tweaked by Nishal Kulkarni.
2021-11-26 12:24:23 +00:00
Sebastian Dröge
6d8045ddb4 Merge branch 'gdbus-call-interactive' into 'main'
gdbus: Add --interactive option to `gdbus call`

See merge request GNOME/glib!2329
2021-11-22 13:58:46 +00:00
Alvarito050506
03753cda79 Better detection of the cleanup attribute.
Use g_macro__has_attribute to detect it instead of
hardcoding __GNUC__ || __clang__. This adds support
for a few compiler and is consistent with the rest
of the gmacros.h file.
2021-11-16 15:13:07 +00:00
gonyere
5eeac53793 Changed gendered terms to be gender-neutral 2021-11-12 21:32:21 -05:00
Philip Withnall
b75a16b048 gdbus: Add --interactive option to gdbus call
This allows the flag to allow interactive auth to be set. Previously, it
was unconditionally unset.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-11 11:26:22 +00:00
Vinícius dos Santos Oliveira
7ba86be594 Add g_main_context_new_with_flags()
This constructor is useful to set options that can't change after
creation.
2021-09-21 14:50:30 +01:00
Philip Withnall
94b74c761d gversionmacros: Add version macros for GLib 2.72
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-09-17 11:35:21 +01:00
Evan Miller
508352339a Fix false deprecation warnings on old GCC/MSVC
Closes #2472
2021-09-07 11:21:20 +01:00
Simon McVittie
a076dbcb68 gtestutils: Allow failing a test with a printf-style message
This allows a pattern like

    g_test_message ("cannot reticulate splines: %s", error->message);
    g_test_fail ();

to be replaced by the simpler

    g_test_fail_printf ("cannot reticulate splines: %s", error->message);

with the secondary benefit of making the message available to TAP
consumers as part of the "not ok" message.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-08-19 09:49:11 +01:00
Simon McVittie
182d9995ca gtestutils: Allow skipping tests with a printf-style message
Forming the g_test_skip() message from printf-style arguments seems
common enough to deserve a convenience function.

g_test_incomplete() is mechanically almost equivalent to g_test_skip()
(the semantics are different but the implementation is very similar),
so give it a similar mechanism for symmetry.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-08-19 09:41:08 +01:00
Bastien Nocera
9645cbffa8 gio: Add portal version of GPowerProfileMonitor 2021-08-13 01:32:31 +02:00
Philip Withnall
709df8eeb4 Merge branch 'docgen-fixes' into 'main'
Adapt documentation to gi-docgen

See merge request GNOME/glib!2206
2021-08-03 13:53:38 +00:00
Guido Günther
791218a5f5 GNotification: Allow to set a category
Some backends like the FDO one allow to set a category. This helps the
notification daemon to select a proper feedback type.
2021-08-02 19:26:38 +02:00
Emmanuele Bassi
6081e92daf docs: Match GZlib(De)Compressor section with the type name
Otherwise the introspection scanner won't be able to match the
documentation stanza to the corresponding type.
2021-08-02 13:27:55 +01:00
Patrick Griffis
889bdb994f Add GPowerProfileMonitor 2021-07-28 15:56:02 +02:00
Emmanuele Bassi
ef15a4e720 docs: Add new symbols 2021-07-27 12:27:53 +01:00
Philip Withnall
ef6a551739 Merge branch 'main' into 'main'
Fix some test suite memory leaks

See merge request GNOME/glib!2195
2021-07-26 10:06:08 +00:00
Matthias Clasen
bb4d390577 mainloop: Add g_source_set_static_name
g_source_set_name duplicates the string, and this is
showing up as one of the more prominent sources of strdups
in GTK profiles, despite all the names we use being literals.

Add a variant that avoids the overhead.
2021-07-24 11:26:40 -04:00
GOUJON Évan
353f0b5235 glib/gtestutils: Introduce and use a g_test_suite_free function 2021-07-23 22:16:44 +02:00
GOUJON Évan
f0c0d8b67c glib/gtestutils: Introduce and use a g_test_case_free function 2021-07-23 22:10:08 +02:00
nitinosiris
ee589aaa32 API: Add g_module_open_full()
g_module_open_full() is wrapper around g_module_open() function
which returns a GError in case of failure.

Closes #203
2021-07-21 21:45:51 +01:00
nitinosiris
75db4883fc GThreadPool: Add g_thread_pool_new_full()
g_thread_pool_new_full() is similar to g_thread_pool_new()
but with GDestroyNotify argument.

Closes #121
2021-07-02 18:42:59 +05:30
Philip Withnall
74595ab64a Merge branch 'wip/pwithnall/962-drop-embedded-pcre' into 'main'
pcre: Drop internal libpcre copy

Closes #962 and #642

See merge request GNOME/glib!2144
2021-06-21 14:07:45 +00:00
Philip Withnall
9570e67744 pcre: Drop internal libpcre copy
It’s no longer used and is a maintenance burden.

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

Fixes: #962
2021-06-16 16:45:10 +01:00
Philip Withnall
9fbd7f3dc1 build: Drop the internal_pcre option in favour of the subproject
This should maintain equivalent functionality, apart from that now you
have to pass `--force-fallback-for libpcre` to `meson configure` in
order to use the subproject; rather than specifying
`-Dinternal_pcre=true` to use the internal copy.

This also fixes #642, as the wrapdb copy of libpcre is version 8.37.

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

Helps: #962
Fixes: #642
2021-06-16 16:45:10 +01:00
Philip Withnall
4d6dbe0904 Merge branch 'g_dbus' into 'main'
gdbus: Add g_dbus_is_error_name() symbol for g_dbus_is_interface_name()

Closes #402

See merge request GNOME/glib!2156
2021-06-16 10:58:04 +00:00
nitinosiris
5b9a8e2048 gdbus: Add g_dbus_is_error_name() symbol for g_dbus_is_interface_name()
Closes #402
2021-06-16 08:05:50 +05:30
Simon McVittie
e0b6b8037d Distinguish more clearly between wait status and exit status
On Unix platforms, wait() and friends yield an integer that encodes
how the process exited. Confusingly, this is usually not the same as
the integer passed to exit() or returned from main(): conceptually it's
an integer encoding of this tagged union:

    enum { EXITED, SIGNALLED, ... } tag;
    union {
        int exit_status;         /* if EXITED */
        struct {
            int terminating_signal;
            bool core_dumped;
        } terminating_signal;    /* if SIGNALLED */
        ...
    } detail;

Meanwhile, on Windows, wait statuses and exit statuses are
interchangeable.

I find that it's clearer what is going on if we are consistent about
referring to the result of wait() as a "wait status", and the value
passed to exit() as an "exit status".

GSubprocess already gets this right: g_subprocess_get_status() returns
the wait status, while g_subprocess_get_exit_status() genuinely returns
the exit status. However, the GSpawn family of APIs has tended to
conflate the two.

Confusingly, g_spawn_check_exit_status() has always checked a wait
status, and it would not be correct to pass an exit status to it; so
let's deprecate it in favour of g_spawn_check_wait_status(), which
does the same thing that g_spawn_check_exit_status() always did.
Code that needs backwards-compatibility with older GLib can use:

    #if !GLIB_CHECK_VERSION(2, 69, 0)
    #define g_spawn_check_wait_status(x) (g_spawn_check_exit_status (x))
    #endif

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-15 14:33:14 +01:00
Philip Withnall
7b6ccc8bdb Merge branch 'range-checked' into 'main'
GBytes: add range-checked pointer getter

Closes #1098

See merge request GNOME/glib!2147
2021-06-15 12:01:12 +00:00
Nitin Wartkar
e3452ea01f GBytes: add range-checked pointer getter
Updated and improved by Nitin Wartkar.

Fixes: #1098
2021-06-15 12:01:11 +00:00
Philip Withnall
b95d9d1db6 Merge branch 'g_obj_take_ref' into 'main'
GObject: add g_object_take_ref()

Closes #1112

See merge request GNOME/glib!2146
2021-06-15 11:28:00 +00:00
Allison Ryan Lortie
3764c6730e GObject: add g_object_take_ref()
This works in the same way as g_variant_take_ref(), and for the same
reason.

Updated and Rebased by Nitin Wartkar <nitinwartkar58@gmail.com>

Closes #1112
2021-06-11 18:13:34 +05:30
Philip Withnall
c0fe89c986 Merge branch 'gtypeof' into 'main'
glib_typeof: Move definition to its own header

See merge request GNOME/glib!1969
2021-06-10 12:26:27 +00:00
Ross Wollman
4d3618cbd1 tls: expose SAN details on GTlsCertificate
This changeset exposes

* `dns-names`
* `ip-addresses`

on GTlsCertificate provided by the underlying TLS Backend.

See https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/165 for the corresponding glib-networking changes.

Relates: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2113
Relates: https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/156/diffs
Relates: https://github.com/microsoft/playwright/issues/6759
2021-06-10 00:54:45 +00:00
Utkarsh Singh
47e161d082 compiling.xml: Don't recommend backticks 2021-06-09 10:13:27 +00:00
Michael Catanzaro
bf37392045 tls: add functions to get protocol version and ciphersuite name
This adds g_tls_connection_get_protocol_version(),
g_tls_connection_get_ciphersuite_name(), and DTLS variants. This will
allow populating TLS connection information in the WebKit web inspector.

This is WIP because we found it's not quite possibly to implement
correctly with GnuTLS. See glib-networking!151.
2021-06-03 10:56:15 -05:00
Philip Withnall
be24b0c622 docs: Wrap a code example more tightly to reduce minimum page width
Otherwise the page has a horizontal scrollbar in Devhelp on some
machines.

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

Fixes: #2414
2021-06-03 12:52:51 +01:00
Michael Catanzaro
7a51163cf9 Merge branch 'feature/cert-info' into 'master'
tls: expose cert details on GTlsCertificate

See merge request GNOME/glib!2113
2021-06-01 20:25:21 +00:00
Ross A. Wollman
a17c28790a tls: expose cert details on GTlsCertificate
This changeset exposes

* `not-valid-before`
* `not-valid-after`
* `subject-name`
* `issuer-name`

on GTlsCertificate provided by the underlying TLS Backend.

In order to make use of these changes,
see the related [glib-networking MR][glib-networking].

This change aims to help populate more of the [`Certificate`][wk-cert]
info in the WebKit Inspector Protocol on Linux.

This changeset stems from work in Microsoft Playwright to [add more info
into its HAR capture][pw] generated from the Inspector Protocol events
and will bring feature parity across WebKit platforms.

[wk-cert]: 8afe31a018/Source/JavaScriptCore/inspector/protocol/Security.json
[pw]: https://github.com/microsoft/playwright/pull/6631
[glib-networking]: https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/156
2021-06-01 16:24:33 +00:00
Dan Williams
9cb1bb0fb2 Add g_prefix_error_literal()
Because sometimes you don't want a lone "%s", and you don't
want the compiler yelling at you about format strings that
don't have any format in them.

Closes #663
2021-05-28 17:15:46 +02:00
alex-tee
232b40da7b gstrvbuilder: add addv and add_many to the API 2021-05-26 12:41:18 +00:00
Xavier Claessens
090d65712d glib_typeof: Move definition to its own header
It is cleaner to define glib_typeof() in a header included after
gversionmacros.h so we can use GLIB_VERSION_MIN_REQUIRED directly
instead of doing it everywhere glib_typeof() is used.
2021-05-17 12:07:30 -04:00
Emmanuel Fleury
2e4524cd36 Add the G_OPTION_ENTRY_NULL macro to properly initialize GOptionEntry arrays 2021-05-13 12:57:06 +02:00
Geyslan G. Bem
8cc03f8cd8 docs: Standardize spelling of serializ*
Changes serialis* to serializ* as proposed in #2399.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
2021-05-07 08:51:22 -03:00
Robin Verdenal-Tallieux
514c2d8197 gmacros: Add __ to noinline to prevent conflict with macro in pixman
Fixes: #2388
2021-05-03 09:37:00 +00:00
Marco Trevisan (Treviño)
fbb198f968 gpattern: Move match and match_string functions into GPatternSpec
This allows introspection to properly handle them as GPatternSpec
methods, as per this deprecate g_pattern_match() and
g_pattern_match_string() functions.
2021-04-27 16:25:09 +02:00
Marco Trevisan (Treviño)
b8a9f4b436 boxed: Register GPatternSpec as boxed type 2021-04-27 16:25:09 +02:00
Marco Trevisan (Treviño)
474ece6d61 gpattern: Implement copy function
Add copy ability for pattern spec, so that it can be used as a boxed
type.
2021-04-27 16:25:09 +02:00
Aleksandr Mezin
2b9bf7b162 gmacros.h: use g_macro__has_attribute() where possible
Fall back to compiler version checks only when `__has_attribute()` is not
available.

clang-cl doesn't define `__GNU__`, but still accepts attributes. This change
gets rid of a lot of warnings when building GLib with clang-cl. For GCC and
non-cl Clang nothing should change.
2021-04-16 14:45:03 +06:00
Chun-wei Fan
35154a3519 glib-sections.txt: Add g_macro__has_extension in private section
This should satisfy the documentation build check.
2021-03-31 10:50:27 +08:00
Abanoub Ghadban
240cc7da97 gfileinfo: Add APIs to get and set {access,creation}_date_time 2021-03-28 23:07:39 +02:00
liuyangming
8fb3101715 gtree: Make g_tree_remove_all() public
g_tree_remove_all is useful and the corresponding function in GHashTable
is exposed, so make this function public is meaningful.
2021-03-23 11:36:57 +00:00
Simon McVittie
6c5a227bcc gmain: Add g_steal_fd() to API
This is basically glnx_steal_fd() from libglnx. We already had two
private implementations of it in GLib.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-03-22 11:48:10 +00:00
Simon McVittie
1248b642ad gversionmacros: Add version macros for GLib 2.70
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-03-18 13:58:41 +00:00
Philip Withnall
b31f3f5f80 gspawn: Add new g_spawn_async_with_pipes_and_fds() API
This is a simple wrapper around the new source/target FD mapping
functionality in `fork_exec()`.

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

Helps: #2097
2021-02-16 13:44:00 +00:00
Joshua Lee
c576a4cd82 string: Add find and replace function
This adds g_string_replace(), a function that replaces instances of one string
with another in a GString. It allows the caller to specify the maximum number
of replacements to perform, and returns the number of replacements performed
to the caller.

Fixes: #225
2021-02-09 10:50:16 +00:00
Philip Withnall
f8cf0b8672 gstrfuncs: Add g_memdup2() function
This will replace the existing `g_memdup()` function, which has an
unavoidable security flaw of taking its `byte_size` argument as a
`guint` rather than as a `gsize`. Most callers will expect it to be a
`gsize`, and may pass in large values which could silently be truncated,
resulting in an undersize allocation compared to what the caller
expects.

This could lead to a classic buffer overflow vulnerability for many
callers of `g_memdup()`.

`g_memdup2()`, in comparison, takes its `byte_size` as a `gsize`.

Spotted by Kevin Backhouse of GHSL.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: GHSL-2021-045
Helps: #2319
2021-02-04 14:13:03 +00:00
Xavier Claessens
4273c43902 glib_typeof: It is an API break that should be opt-in
That changes the return type of functions like g_object_ref() that can
break C++ applications like Webkit. Note that it is not an ABI break.

It must thus be opt-in the same way we did when adding this to
g_object_ref() for GNU C compilers in the first place. Unfortunately it
cannot be done directly in gmacros.h because GLIB_VERSION_2_68 is not
defined there, and gversionmacros.h cannot be included there because
there is some strict ordering in which those headers must be included.

This means that applications that does not define
GLIB_VERSION_MIN_REQUIRED will still get an API break, so we encourage
them to declare their minimum requirement to avoir such issues in the
future too.
2021-01-27 09:26:39 -05:00
Jonas Ådahl
657d18fdbb gtestutils: Add g_test_get_path() API
I found myself wanting to know the test that is currently being run,
where e.g. __func__ would be inconvenient to use, because e.g. the place
the string was needed was not in the test case function. Using __func__
also relies on the test function itself containing the whole path, while
loosing the "/" information that is part of the test path.
2021-01-25 16:34:12 +01:00
MARTINSONS Frederic
47355c358d Add g_dbus_utils_object_path_escape and g_dbus_utils_object_path_unescape
These two APIs are useful to publish an object which path content is not
controlled (e.g. dynamically built or coming from external source).

Closes #968

(Rebased and tweaked by Frederic Martinsons)

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-01-20 13:23:24 +00:00
Philip Withnall
bff359dde6 docs: Add documentation for GLIB_VERSION_CUR_STABLE and PREV_STABLE
It was missing. Oh no!

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-01-19 15:52:29 +00:00
Philip Withnall
ba414ee100 giomodule: Ignore GIO_MODULE_DIR when running as setuid
Even if the modules in the given directory never get chosen to be used,
loading arbitrary code from a user-provided directory is not safe when
running as setuid, as the process’ environment comes from an untrusted
source.

Also ignore `GIO_EXTRA_MODULES`.

Spotted by Simon McVittie.

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

Fixes: #2168
2021-01-07 15:02:24 +00:00
Philip Withnall
8a5cc02142 Merge branch 'extended-error' into 'master'
Extended error

See merge request GNOME/glib!1304
2021-01-06 16:02:27 +00:00
Krzesimir Nowak
ae72f9de35 gerror: Add support for extended errors
This commit adds a G_DEFINE_EXTENDED_ERROR macro and
g_error_domain_register() functions to register extended error
domains.
2021-01-06 15:44:59 +00:00
Philip Withnall
9716a26ab6 Merge branch '1281-to-pixdata-docs' into 'master'
gresource: Document the `to-pixdata` option as being deprecated

Closes #1281

See merge request GNOME/glib!1826
2021-01-04 12:58:42 +00:00
Philip Withnall
0c85348efc Merge branch 'appinfo-shellany-uwplaunch' into 'master'
GWin32AppInfo: support getting info about UWP apps and launching them

Closes #1991

See merge request GNOME/glib!1772
2021-01-04 12:55:58 +00:00
Philip Withnall
37ec6f1da7 docs: Ignore new win32 private headers
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-23 01:43:37 +00:00
Philip Withnall
b63e9889a8 gresource: Document the to-pixdata option as being deprecated
Just embed a PNG instead. gdk-pixbuf deprecated its pixdata support in
version 2.32, in 2015.

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

Fixes: #1281
2020-12-22 18:42:05 +00:00
Philip Withnall
e7f9ae61dc docs: Mention GInitiallyUnowned when introducing refcounts
For completeness.

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

Fixes: #1568
2020-12-12 18:47:00 +00:00
Ondrej Holy
aa1e91e838 Merge branch '2098-add-gio-restore-support' into 'master'
Add restore option for trash gio-tool subcommand

Closes #2098

See merge request GNOME/glib!1778
2020-12-09 12:40:59 +00:00
Ondrej Holy
0458ad893a Merge branch '54-add-gio-launch-command' into 'master'
Add gio launch command to execute desktop file

Closes #54

See merge request GNOME/glib!1779
2020-12-09 12:36:41 +00:00
Frederic Martinsons
c3a073e96f Add gio launch command to execute desktop file
This command will try to execute a desktop file, before that
it will load the input as a keyfile for checking its existence
and its validity (as a keyfile).
File arguments are allowed after the desktop file.

Closes #54

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-12-09 08:15:42 +01:00
Frederic Martinsons
725984fe8e gio-tool-trash: Add --restore subcommand
It search for attribute trash::orig-path and move the input file to it.
Possibly recreating the directory of orignal path and/or overwritting
the destination.

Closes #2098

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-12-07 17:18:51 +01:00
Frederic Martinsons
105e06cc2e gio-tool-trash: Add --list subcommand
This will print all the files in TrashCan along with their
original location.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-12-07 17:15:43 +01:00
Philip Withnall
5e1d368eec Merge branch 'binding-threadsafe-2' into 'master'
Make GBinding thread-safe (alternative approach)

See merge request GNOME/glib!1745
2020-12-04 14:23:10 +00:00
Sebastian Dröge
c8c829fa42 Add g_binding_dup_target() and g_binding_dup_source()
These new getters prevent the source/target from simply disappearing if
they're finalized from another thread in the meantime.
2020-11-26 10:49:23 +02:00
Emmanuel Fleury
c1d74e35c1 Adding macros G_NORETURN and G_NORETURN_FUNCPTR
This macro is borrowed from the gnulib project in the 'noreturn.h' file.

Fixes: #994
2020-11-25 11:34:05 +00:00
Sebastian Dröge
72360eb8bd Merge branch '553-tz-errors' into 'master'
gtimezone: Add new constructor which can report errors

Closes #553

See merge request GNOME/glib!1760
2020-11-22 08:35:33 +00:00
Sebastian Dröge
fa8a39c6c6 Merge branch 'py-fixes' into 'master'
Python formatting improvements

See merge request GNOME/glib!1757
2020-11-20 18:10:40 +00:00
Philip Withnall
fab561f8d0 gobject: Drop use of volatile from get_type() macros
http://isvolatileusefulwiththreads.in/c/

It’s possible that the variables here are only marked as volatile
because they’re arguments to `g_once_*()`. Those arguments will be
modified in a subsequent commit.

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

Helps: #600
2020-11-20 14:40:19 +00:00
Philip Withnall
c33de0dc5f docs: Clarify the meaning of --buildtype=plain a little
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #1833
2020-11-18 13:29:11 +00:00
Philip Withnall
8105c36e84 gtimezone: Add new constructor which can report errors
Add a new variant of `g_time_zone_new()` which returns `NULL` on
failure to load a timezone, rather than silently returning UTC.

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

Fixes: #553
2020-11-18 11:31:15 +00:00
Philip Withnall
d270b6c3db py: Various flake8 cleanups
None of these are particularly significant, but they do get the CI
output clean.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 15:50:07 +00:00
Philip Withnall
905b22a17e py: Reformat all Python files consistently
This commit is the unmodified results of running
```
black $(git ls-files '*.py')
```
with black version 19.10b0. See #2046.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17 15:50:07 +00:00
Niels De Graef
f98f2c5d0f gtestutils: Add g_assert_cmpstrv()
Add a test util function that helps asserting two string arrays are the
same, and which adds some useful information if they're not.

Fixes: #2015
2020-11-14 18:17:19 +00:00
Sebastian Dröge
ddef9ba2f8 Merge branch 'instantiatable' into 'master'
gobject: Standardise on the term ‘instantiatable’

See merge request GNOME/glib!1735
2020-11-13 15:29:07 +00:00
Norbert Pocs
a879c46a39 gdbus: Add FD support for gdbus call
Gdbus call could not take file handle (parameter 'h') as a parameter.

Original patch from Tim Waugh <twaugh@redhat.com>.

Fixes: #961
2020-11-06 17:19:27 +00:00
Benjamin Otte
98f0a5a7da gtype: Add g_type_interface_instantiatable_prerequisite()
This function returns the most specific instantiatable type
that is a prerequisite for a given interface.

This type is necessary in particular when dealing with GValues
because a GValue contains an instance of a type.

This commit includes tests for the new API.
2020-11-02 17:36:18 +00:00