clients: make meta data subtypes of NMObjBaseInst

Yes, this wastes 4 times an unused GType instance
in the class structure.
This commit is contained in:
Thomas Haller 2017-06-07 14:43:58 +02:00
parent b8bc80bcdb
commit 343c967e66
2 changed files with 18 additions and 4 deletions

View file

@ -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;

View file

@ -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;