Skip to content

[th/connection-get-setting-cleanup] cleanup nm_connection_get_setting*() variants

Thomas Haller requested to merge th/connection-get-setting-cleanup into main
  • Expose _nm_connection_get_setting_by_metatype() in internal header, it's the most efficient variant so make it accessible.
  • rework the existing nm_connection_get_setting*() variants to avoid redundant lookups.
  • add nm_settings_connection_get_setting() helper

I mean, even calling NM_TYPE_SETTING_CONNECTION is a function call just to get the GType. Then, we need to lookup the NMMetaSettingInfo from the GType. Only then we get the meta_type enum that we need. _nm_connection_get_setting_by_metatype() avoids that and the looked up type is known at compile time.

Merge request reports