NetworkManager/contrib
Thomas Haller 6cbad14721
contrib: discourage g_type_class_add_private() via "checkpatch.pl"
Our GObject structs should be internal API. In which case, we should
embed the private data in the struct themselves (`_priv`) and use the
_NM_GET_PRIVATE() macro. The advantage is better debugability because
following G_TYPE_INSTANCE_GET_PRIVATE() in the debugger is very
cumbersome. Another (less relevant) advantage is better performance.

Thus, warn about uses of g_type_class_add_private() and
G_TYPE_INSTANCE_GET_PRIVATE().

Note that if the struct and is in a header file (which is usually only
necessary when subclassing the type), then the private data should be
an opaque pointer `_priv` instead, and we should use the _NM_GET_PRIVATE_PTR()
macro. In that case, the use of g_type_class_add_private() and
G_TYPE_INSTANCE_GET_PRIVATE() is correct and the warning is false. But
this is only a warning, for the unusual case where we have deep object
hierarchies.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1396
2022-10-03 17:23:29 +02:00
..
alpine contrib/packages: install pexpect 2022-06-30 10:20:44 +02:00
art/logo artwork: introduce NetworkManager stickers 2019-09-30 17:36:59 +02:00
debian contrib/packages: install pexpect 2022-06-30 10:20:44 +02:00
editors contrib: add emacs config for hacking on NM 2015-08-11 13:42:26 -04:00
fedora contrib: fix syntax error in "configure-for-system.sh" 2022-09-08 15:29:10 +02:00
scripts contrib: discourage g_type_class_add_private() via "checkpatch.pl" 2022-10-03 17:23:29 +02:00