diff options
author | Dan Winship <danw@gnome.org> | 2014-07-29 09:22:07 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2014-09-04 09:20:10 -0400 |
commit | ca9938f458521b24b262be79a6f86a89f6d630a6 (patch) | |
tree | 2e1a057c45f5dc10ce3eaccd9f8b439daef8dcb3 /libnm-core/nm-setting-wired.c | |
parent | 99e1699d8971f7cb5787989eed301ecb7f2eb863 (diff) | |
download | NetworkManager-ca9938f458521b24b262be79a6f86a89f6d630a6.tar.gz |
libnm-core: drop NMParamSpecSpecialized, add nm_property_compare()
NMParamSpecSpecialized existed basically to provide a version of
GParamSpecBoxed that could compare dbus-glib-valued properties
correctly.
However, g_param_values_cmp() was only used by NM directly in one
place (NMSetting's compare_property()), and we don't actually need to
indirect through GParamSpec there; we could just call
NMParamSpecSpecialized's value-comparison function directly.
So, change all NMParamSpecSpecialized properties to GParamSpecBoxed,
rename the _gvalues_compare() function it used to
"nm_property_compare()", and use that from NMSetting.
(g_param_values_cmp() also gets used internally by
g_param_value_defaults(), but all NMParamSpecSpecialized properties
have a default value of NULL, so GParamSpecBoxed's pointer-equality
check will do the job just fine there.)
Diffstat (limited to 'libnm-core/nm-setting-wired.c')
-rw-r--r-- | libnm-core/nm-setting-wired.c | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/libnm-core/nm-setting-wired.c b/libnm-core/nm-setting-wired.c index a302cb81f4..3e20c8b846 100644 --- a/libnm-core/nm-setting-wired.c +++ b/libnm-core/nm-setting-wired.c @@ -26,7 +26,6 @@ #include <glib/gi18n.h> #include "nm-setting-wired.h" -#include "nm-param-spec-specialized.h" #include "nm-utils.h" #include "nm-utils-private.h" #include "nm-dbus-glib-types.h" @@ -907,11 +906,11 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) **/ g_object_class_install_property (object_class, PROP_MAC_ADDRESS, - _nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS, "", "", - DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE | - NM_SETTING_PARAM_INFERRABLE | - G_PARAM_STATIC_STRINGS)); + g_param_spec_boxed (NM_SETTING_WIRED_MAC_ADDRESS, "", "", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingWired:cloned-mac-address: @@ -921,11 +920,11 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) **/ g_object_class_install_property (object_class, PROP_CLONED_MAC_ADDRESS, - _nm_param_spec_specialized (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, "", "", - DBUS_TYPE_G_UCHAR_ARRAY, - G_PARAM_READWRITE | - NM_SETTING_PARAM_INFERRABLE | - G_PARAM_STATIC_STRINGS)); + g_param_spec_boxed (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, "", "", + DBUS_TYPE_G_UCHAR_ARRAY, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingWired:mac-address-blacklist: @@ -937,11 +936,11 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) **/ g_object_class_install_property (object_class, PROP_MAC_ADDRESS_BLACKLIST, - _nm_param_spec_specialized (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, "", "", - DBUS_TYPE_G_LIST_OF_STRING, - G_PARAM_READWRITE | - NM_SETTING_PARAM_FUZZY_IGNORE | - G_PARAM_STATIC_STRINGS)); + g_param_spec_boxed (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, "", "", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | + NM_SETTING_PARAM_FUZZY_IGNORE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingWired:mtu: @@ -971,11 +970,11 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) **/ g_object_class_install_property (object_class, PROP_S390_SUBCHANNELS, - _nm_param_spec_specialized (NM_SETTING_WIRED_S390_SUBCHANNELS, "", "", - DBUS_TYPE_G_ARRAY_OF_STRING, - G_PARAM_READWRITE | - NM_SETTING_PARAM_INFERRABLE | - G_PARAM_STATIC_STRINGS)); + g_param_spec_boxed (NM_SETTING_WIRED_S390_SUBCHANNELS, "", "", + DBUS_TYPE_G_ARRAY_OF_STRING, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingWired:s390-nettype: @@ -1001,9 +1000,9 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) **/ g_object_class_install_property (object_class, PROP_S390_OPTIONS, - _nm_param_spec_specialized (NM_SETTING_WIRED_S390_OPTIONS, "", "", - DBUS_TYPE_G_MAP_OF_STRING, - G_PARAM_READWRITE | - NM_SETTING_PARAM_INFERRABLE | - G_PARAM_STATIC_STRINGS)); + g_param_spec_boxed (NM_SETTING_WIRED_S390_OPTIONS, "", "", + DBUS_TYPE_G_MAP_OF_STRING, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); } |