Skip to content

[th/libnm-settings-properties] refactor more properties in libnm/NMSetting to use "direct" macros

Thomas Haller requested to merge th/libnm-settings-properties into main

Advantages of the direct macros:

  • less boiler plate code, in particular avoid things that we can get wrong (like, g_free() in finalize() or initializing the default value).

  • it enforces the idea of having property "types". We want that NMSetting properties behave similar (depending on a small set of "types"). The "direct" macros suggest the way how to implement such properties that are backed by a GObject property. This is the preferred (semi new) way, and we should move existing code over to the preferred way (in particular, because new properties get added by cargo culting existing ones).

  • I didn't measure it, but it seems clear that this also performs better, because we avoid going through the GValue API.

Merge request reports