From ca7360881454a35d903331b84bfb06c074d4997c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 7 Jun 2017 14:43:58 +0200 Subject: clients: make meta data subtypes of NMObjBaseInst Yes, this wastes 4 times an unused GType instance in the class structure. --- clients/cli/utils.h | 5 ++++- clients/common/nm-meta-setting-desc.h | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/clients/cli/utils.h b/clients/cli/utils.h index 1724d4391e..19145974ea 100644 --- a/clients/cli/utils.h +++ b/clients/cli/utils.h @@ -129,7 +129,10 @@ typedef enum { } G_STMT_END struct _NmcMetaGenericInfo { - const NMMetaType *meta_type; + union { + NMObjBaseInst parent; + const NMMetaType *meta_type; + }; NmcGenericInfoType info_type; const char *name; const char *name_header; diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index c1fd902210..e61b1fc4a6 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -20,6 +20,7 @@ #ifndef __NM_META_SETTING_DESC_H__ #define __NM_META_SETTING_DESC_H__ +#include "nm-utils/nm-obj.h" #include "nm-meta-setting.h" struct _NMDevice; @@ -284,7 +285,10 @@ enum { #define nm_meta_property_info_vpn_service_type (nm_meta_setting_infos_editor[NM_META_SETTING_TYPE_VPN].properties[_NM_META_PROPERTY_TYPE_VPN_SERVICE_TYPE]) struct _NMMetaPropertyInfo { - const NMMetaType *meta_type; + union { + NMObjBaseInst parent; + const NMMetaType *meta_type; + }; const NMMetaSettingInfoEditor *setting_info; @@ -316,7 +320,10 @@ typedef struct _NMMetaSettingValidPartItem { } NMMetaSettingValidPartItem; struct _NMMetaSettingInfoEditor { - const NMMetaType *meta_type; + union { + NMObjBaseInst parent; + const NMMetaType *meta_type; + }; const NMMetaSettingInfo *general; const char *alias; const char *pretty_name; @@ -341,6 +348,7 @@ struct _NMMetaSettingInfoEditor { }; struct _NMMetaType { + NMObjBaseClass parent; const char *type_name; const char *(*get_name) (const NMMetaAbstractInfo *abstract_info, gboolean for_header); @@ -364,7 +372,10 @@ struct _NMMetaType { }; struct _NMMetaAbstractInfo { - const NMMetaType *meta_type; + union { + NMObjBaseInst parent; + const NMMetaType *meta_type; + }; }; extern const NMMetaType nm_meta_type_setting_info_editor; -- cgit v1.2.1