[network-manager-applet/bg/device-empty-mac-rh1380424: 1/2] editor: remove @ifname_first argument from ce_page_setup_device_combo()
- From: Beniamino Galvani <bgalvani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/bg/device-empty-mac-rh1380424: 1/2] editor: remove @ifname_first argument from ce_page_setup_device_combo()
- Date: Tue, 3 Jan 2017 22:24:18 +0000 (UTC)
commit 6937c9fbc892f6d6633faa054d780e62cf6f8227
Author: Beniamino Galvani <bgalvani redhat com>
Date: Tue Jan 3 16:42:28 2017 +0100
editor: remove @ifname_first argument from ce_page_setup_device_combo()
It's always TRUE.
src/connection-editor/ce-page.c | 17 ++++++-----------
src/connection-editor/ce-page.h | 3 +--
src/connection-editor/page-bluetooth.c | 2 +-
src/connection-editor/page-ethernet.c | 2 +-
src/connection-editor/page-infiniband.c | 2 +-
src/connection-editor/page-ip-tunnel.c | 2 +-
src/connection-editor/page-wifi.c | 2 +-
7 files changed, 12 insertions(+), 18 deletions(-)
---
diff --git a/src/connection-editor/ce-page.c b/src/connection-editor/ce-page.c
index 6a5b21b..2e9e130 100644
--- a/src/connection-editor/ce-page.c
+++ b/src/connection-editor/ce-page.c
@@ -339,8 +339,7 @@ static char **
_get_device_list (CEPage *self,
GType device_type,
gboolean set_ifname,
- const char *mac_property,
- gboolean ifname_first)
+ const char *mac_property)
{
const GPtrArray *devices;
GPtrArray *interfaces;
@@ -371,12 +370,9 @@ _get_device_list (CEPage *self,
if (mac_property)
g_object_get (G_OBJECT (dev), mac_property, &mac, NULL);
- if (set_ifname && mac_property) {
- if (ifname_first)
- item = g_strdup_printf ("%s (%s)", ifname, mac);
- else
- item = g_strdup_printf ("%s (%s)", mac, ifname);
- } else
+ if (set_ifname && mac_property)
+ item = g_strdup_printf ("%s (%s)", ifname, mac);
+ else
item = g_strdup (set_ifname ? ifname : mac);
g_ptr_array_add (interfaces, item);
@@ -460,15 +456,14 @@ ce_page_setup_device_combo (CEPage *self,
GType device_type,
const char *ifname,
const char *mac,
- const char *mac_property,
- gboolean ifname_first)
+ const char *mac_property)
{
char **iter, *active_item = NULL;
int i, active_idx = -1;
char **device_list;
char *item;
- device_list = _get_device_list (self, device_type, TRUE, mac_property, ifname_first);
+ device_list = _get_device_list (self, device_type, TRUE, mac_property);
if (ifname && mac)
item = g_strdup_printf ("%s (%s)", ifname, mac);
diff --git a/src/connection-editor/ce-page.h b/src/connection-editor/ce-page.h
index 537f468..85acdf6 100644
--- a/src/connection-editor/ce-page.h
+++ b/src/connection-editor/ce-page.h
@@ -142,8 +142,7 @@ void ce_page_setup_device_combo (CEPage *self,
GType device_type,
const char *ifname,
const char *mac,
- const char *mac_property,
- gboolean ifname_first);
+ const char *mac_property);
gboolean ce_page_mac_entry_valid (GtkEntry *entry, int type, const char *property_name, GError **error);
gboolean ce_page_interface_name_valid (const char *iface, const char *property_name, GError **error);
gboolean ce_page_device_entry_get (GtkEntry *entry, int type,
diff --git a/src/connection-editor/page-bluetooth.c b/src/connection-editor/page-bluetooth.c
index b1c41bd..65eed70 100644
--- a/src/connection-editor/page-bluetooth.c
+++ b/src/connection-editor/page-bluetooth.c
@@ -78,7 +78,7 @@ populate_ui (CEPageBluetooth *self, NMConnection *connection)
bdaddr = nm_setting_bluetooth_get_bdaddr (setting);
ce_page_setup_device_combo (CE_PAGE (self), GTK_COMBO_BOX (priv->bdaddr),
NM_TYPE_DEVICE_BT, NULL,
- bdaddr, NM_DEVICE_BT_HW_ADDRESS, TRUE);
+ bdaddr, NM_DEVICE_BT_HW_ADDRESS);
g_signal_connect_swapped (priv->bdaddr, "changed", G_CALLBACK (ce_page_changed), self);
}
diff --git a/src/connection-editor/page-ethernet.c b/src/connection-editor/page-ethernet.c
index d35a0a3..e565651 100644
--- a/src/connection-editor/page-ethernet.c
+++ b/src/connection-editor/page-ethernet.c
@@ -244,7 +244,7 @@ populate_ui (CEPageEthernet *self)
s_mac = nm_setting_wired_get_mac_address (setting);
ce_page_setup_device_combo (CE_PAGE (self), GTK_COMBO_BOX (priv->device_combo),
NM_TYPE_DEVICE_ETHERNET, s_ifname,
- s_mac, NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, TRUE);
+ s_mac, NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS);
g_signal_connect (priv->device_combo, "changed", G_CALLBACK (stuff_changed), self);
/* Cloned MAC address */
diff --git a/src/connection-editor/page-infiniband.c b/src/connection-editor/page-infiniband.c
index f3b9845..639b353 100644
--- a/src/connection-editor/page-infiniband.c
+++ b/src/connection-editor/page-infiniband.c
@@ -103,7 +103,7 @@ populate_ui (CEPageInfiniband *self)
s_mac = nm_setting_infiniband_get_mac_address (setting);
ce_page_setup_device_combo (CE_PAGE (self), GTK_COMBO_BOX (priv->device_combo),
NM_TYPE_DEVICE_INFINIBAND, s_ifname,
- s_mac, NM_DEVICE_INFINIBAND_HW_ADDRESS, TRUE);
+ s_mac, NM_DEVICE_INFINIBAND_HW_ADDRESS);
g_signal_connect (priv->device_combo, "changed", G_CALLBACK (stuff_changed), self);
/* MTU */
diff --git a/src/connection-editor/page-ip-tunnel.c b/src/connection-editor/page-ip-tunnel.c
index d326f83..eca3a0c 100644
--- a/src/connection-editor/page-ip-tunnel.c
+++ b/src/connection-editor/page-ip-tunnel.c
@@ -96,7 +96,7 @@ populate_ui (CEPageIPTunnel *self, NMConnection *connection)
str = nm_setting_ip_tunnel_get_parent (setting);
ce_page_setup_device_combo (CE_PAGE (self), GTK_COMBO_BOX (priv->parent),
G_TYPE_NONE, str,
- NULL, NULL, TRUE);
+ NULL, NULL);
mode = nm_setting_ip_tunnel_get_mode (setting);
if (mode >= NM_IP_TUNNEL_MODE_IPIP && mode <= NM_IP_TUNNEL_MODE_VTI6)
diff --git a/src/connection-editor/page-wifi.c b/src/connection-editor/page-wifi.c
index 871f451..e0a460f 100644
--- a/src/connection-editor/page-wifi.c
+++ b/src/connection-editor/page-wifi.c
@@ -382,7 +382,7 @@ populate_ui (CEPageWifi *self)
s_mac = nm_setting_wireless_get_mac_address (setting);
ce_page_setup_device_combo (CE_PAGE (self), GTK_COMBO_BOX (priv->device_combo),
NM_TYPE_DEVICE_WIFI, s_ifname,
- s_mac, NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, TRUE);
+ s_mac, NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS);
g_signal_connect_swapped (priv->device_combo, "changed", G_CALLBACK (ce_page_changed), self);
/* Cloned MAC address */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]