diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-08-10 11:23:35 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-08-10 11:23:35 +0200 |
commit | 66f359d8eec2c9adde2f3083c791eee101170d2d (patch) | |
tree | e35ff39d65e23b0d70f72168db7925291b8bbd35 | |
parent | 004cbb420e7a2b44cb2fde3b9e37f9dc3e60067e (diff) | |
download | connman-66f359d8eec2c9adde2f3083c791eee101170d2d.tar.gz connman-66f359d8eec2c9adde2f3083c791eee101170d2d.tar.bz2 connman-66f359d8eec2c9adde2f3083c791eee101170d2d.zip |
Use type2string function if element name is not provided
-rw-r--r-- | src/element.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/element.c b/src/element.c index 6086b7b1..ff66bc06 100644 --- a/src/element.c +++ b/src/element.c @@ -623,33 +623,8 @@ int connman_element_register(struct connman_element *element, __connman_element_load(element); - if (element->name == NULL) { - switch (element->type) { - case CONNMAN_ELEMENT_TYPE_IPV4: - element->name = g_strdup("ipv4"); - break; - case CONNMAN_ELEMENT_TYPE_IPV6: - element->name = g_strdup("ipv6"); - break; - case CONNMAN_ELEMENT_TYPE_DHCP: - element->name = g_strdup("dhcp"); - break; - case CONNMAN_ELEMENT_TYPE_BOOTP: - element->name = g_strdup("bootp"); - break; - case CONNMAN_ELEMENT_TYPE_ZEROCONF: - element->name = g_strdup("zeroconf"); - break; - case CONNMAN_ELEMENT_TYPE_RESOLVER: - element->name = g_strdup("resolver"); - break; - case CONNMAN_ELEMENT_TYPE_INTERNET: - element->name = g_strdup("internet"); - break; - default: - break; - } - } + if (element->name == NULL) + element->name = g_strdup(type2string(element->type)); element->parent = parent; |