network: Remove helper functions
They're not complex enough or used in enough places to warrant keeping. They can be better refactored in the classes that use them.
This commit is contained in:
parent
75b4e5e061
commit
7f410ee1c6
5 changed files with 36 additions and 52 deletions
|
@ -419,17 +419,20 @@ nm_device_mobile_refresh_ui (NetDeviceMobile *self)
|
|||
|
||||
ipv4_config = nm_device_get_ip4_config (nm_device);
|
||||
if (ipv4_config != NULL) {
|
||||
g_autofree gchar *ipv4_text = NULL;
|
||||
GPtrArray *addresses;
|
||||
const gchar *ipv4_text = NULL;
|
||||
g_autofree gchar *dns_text = NULL;
|
||||
const gchar *route_text;
|
||||
|
||||
ipv4_text = panel_get_ip4_address_as_string (ipv4_config);
|
||||
addresses = nm_ip_config_get_addresses (ipv4_config);
|
||||
if (addresses->len > 0)
|
||||
ipv4_text = nm_ip_address_get_address (g_ptr_array_index (addresses, 0));
|
||||
gtk_label_set_label (self->ipv4_label, ipv4_text);
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->ipv4_heading_label), ipv4_text != NULL);
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->ipv4_label), ipv4_text != NULL);
|
||||
have_ipv4_address = ipv4_text != NULL;
|
||||
|
||||
dns_text = panel_get_ip4_dns_as_string (ipv4_config);
|
||||
dns_text = g_strjoinv (" ", (char **) nm_ip_config_get_nameservers (ipv4_config));
|
||||
gtk_label_set_label (self->dns_label, dns_text);
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->dns_heading_label), dns_text != NULL);
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->dns_label), dns_text != NULL);
|
||||
|
@ -449,9 +452,12 @@ nm_device_mobile_refresh_ui (NetDeviceMobile *self)
|
|||
|
||||
ipv6_config = nm_device_get_ip6_config (nm_device);
|
||||
if (ipv6_config != NULL) {
|
||||
g_autofree gchar *ipv6_text = NULL;
|
||||
GPtrArray *addresses;
|
||||
const gchar *ipv6_text = NULL;
|
||||
|
||||
ipv6_text = panel_get_ip6_address_as_string (ipv6_config);
|
||||
addresses = nm_ip_config_get_addresses (ipv6_config);
|
||||
if (addresses->len > 0)
|
||||
ipv6_text = nm_ip_address_get_address (g_ptr_array_index (addresses, 0));
|
||||
gtk_label_set_label (self->ipv6_label, ipv6_text);
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->ipv6_heading_label), ipv6_text != NULL);
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->ipv6_label), ipv6_text != NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue