diff options
author | rbuj <[email protected]> | 2020-12-18 11:10:55 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-12-19 23:19:02 +0100 |
commit | c47ffa433de0dbf94d57aacbccac5c0cb440951d (patch) | |
tree | 7e473899532a949c9c6a1fb04d5e374f4f9e8520 /netspeed/src/netspeed.c | |
parent | 43afa6d5de37f36c196459bb441311a65bcc386c (diff) | |
download | mate-applets-c47ffa433de0dbf94d57aacbccac5c0cb440951d.tar.bz2 mate-applets-c47ffa433de0dbf94d57aacbccac5c0cb440951d.tar.xz |
netspeed: show all ipv6 addrs in device details dialog
Diffstat (limited to 'netspeed/src/netspeed.c')
-rw-r--r-- | netspeed/src/netspeed.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/netspeed/src/netspeed.c b/netspeed/src/netspeed.c index b3e88847..eaa1b5ae 100644 --- a/netspeed/src/netspeed.c +++ b/netspeed/src/netspeed.c @@ -688,7 +688,6 @@ fill_details_dialog (MateNetspeedApplet *applet) { char *text; char ipv4_text [INET_ADDRSTRLEN]; - char ipv6_text [INET6_ADDRSTRLEN]; if (applet->devinfo->ip) { format_ipv4 (applet->devinfo->ip, ipv4_text); @@ -723,10 +722,23 @@ fill_details_dialog (MateNetspeedApplet *applet) gtk_label_set_text (GTK_LABEL (applet->ptpip_text), text); /* check if we got an ipv6 address */ - format_ipv6 (applet->devinfo->ipv6, ipv6_text); - if (strlen (ipv6_text) > 2) { - gtk_label_set_text (GTK_LABEL (applet->ipv6_text), ipv6_text); - gtk_widget_show (applet->ipv6_box); + GSList *ipv6_address_list = get_ip_address_list (applet->devinfo->name, FALSE); + if (ipv6_address_list != NULL) { + GSList *iterator; + GString *string = NULL; + + for (iterator = ipv6_address_list; iterator; iterator = iterator->next) { + if (string == NULL) + string = g_string_new ((char*) iterator->data); + else + g_string_append_printf (string, "\n%s", (char*) iterator->data); + } + if (string != NULL) { + gtk_label_set_text (GTK_LABEL (applet->ipv6_text), string->str); + gtk_widget_show (applet->ipv6_box); + } + g_string_free (string, TRUE); + g_slist_free_full (ipv6_address_list, g_free); } else { gtk_widget_hide (applet->ipv6_box); } |