Commit Graph

5 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
6a0591f06c gobject/tests/type-flags: Add tests for type final type flags
Ensure that final flag is properly checked and used.
2022-12-12 19:03:48 +01:00
Simon McVittie
b13e12b363 type-flags test: Force G_ENABLE_DIAGNOSTIC=1 to be set
Otherwise this test will succeed at build-time, but will fail when run
as an as-installed test via ginsttest-runner.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-14 12:36:32 +00:00
Matthias Clasen
fd0dd9e93c gobject: Add G_TYPE_FLAG_DEPRECATED
This can be used to mark entire types as deprecated,
and trigger a warning when they are instantiated
and `G_ENABLE_DIAGNOSTIC=1` is set in the environment.

There's currently no convenient macros for defining
types with the new flag, but you can do:

```c
_G_DEFINE_TYPE_EXTENDED_BEGIN (GtkAppChooserWidget,
                               gtk_app_chooser_widget,
                               GTK_TYPE_WIDGET,
                               G_TYPE_FLAG_DEPRECATED)
...
_G_DEFINE_TYPE_EXTENDED_END ()
```

Includes a unit test by Philip Withnall.
2022-11-09 12:07:31 +00:00
Michael Catanzaro
0ffe86a1f7 Replace most GObject warnings with criticals
All of these warnings indicate programmer error, so critical is most
appropriate here.

Exceptions: deprecation warnings are just warnings. Also, warnings that
are worded with uncertainty can remain warnings rather than criticals.
2022-08-09 13:18:47 -05:00
Emmanuele Bassi
9aacb4dd6f Add unit for the "final" GType flag
Check that we're emitting the correct set of warnings when trying to
derive a final type.
2021-07-27 12:27:53 +01:00