[network-manager-applet/nma-0-9-10] applet: remove pos from applet_menu_item_add_complex_separator_helper()
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/nma-0-9-10] applet: remove pos from applet_menu_item_add_complex_separator_helper()
- Date: Mon, 8 Dec 2014 18:57:21 +0000 (UTC)
commit 9e20eedc54dfc974804148bd954f646586b92ac8
Author: Pavel Šimerda <psimerda redhat com>
Date: Tue Nov 25 15:29:38 2014 +0100
applet: remove pos from applet_menu_item_add_complex_separator_helper()
Remove a redundant parameter that was allways set to -1 by the caller
and the related code.
(cherry picked from commit 995b6800661948c4f6760641effdee924f40c440)
src/applet-device-bond.c | 2 +-
src/applet-device-bridge.c | 2 +-
src/applet-device-broadband.c | 2 +-
src/applet-device-bt.c | 2 +-
src/applet-device-cdma.c | 2 +-
src/applet-device-ethernet.c | 2 +-
src/applet-device-gsm.c | 2 +-
src/applet-device-infiniband.c | 2 +-
src/applet-device-team.c | 2 +-
src/applet-device-vlan.c | 2 +-
src/applet-device-wifi.c | 2 +-
src/applet-device-wimax.c | 2 +-
src/applet.c | 9 ++-------
src/applet.h | 3 +--
14 files changed, 15 insertions(+), 21 deletions(-)
---
diff --git a/src/applet-device-bond.c b/src/applet-device-bond.c
index 36e22f7..f14595c 100644
--- a/src/applet-device-bond.c
+++ b/src/applet-device-bond.c
@@ -73,7 +73,7 @@ bond_add_menu_item (NMDevice *device,
if (!device || !nma_menu_device_check_unusable (device)) {
if ((!active && g_slist_length (connections)) || (active && g_slist_length (connections) > 1))
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (connections))
applet_add_connection_items (device, connections, TRUE, active, NMA_ADD_INACTIVE,
menu, applet);
diff --git a/src/applet-device-bridge.c b/src/applet-device-bridge.c
index 4352411..6b3b4d7 100644
--- a/src/applet-device-bridge.c
+++ b/src/applet-device-bridge.c
@@ -73,7 +73,7 @@ bridge_add_menu_item (NMDevice *device,
if (!device || !nma_menu_device_check_unusable (device)) {
if ((!active && g_slist_length (connections)) || (active && g_slist_length (connections) > 1))
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (connections))
applet_add_connection_items (device, connections, TRUE, active, NMA_ADD_INACTIVE,
menu, applet);
diff --git a/src/applet-device-broadband.c b/src/applet-device-broadband.c
index 2300c0d..856c5fe 100644
--- a/src/applet-device-broadband.c
+++ b/src/applet-device-broadband.c
@@ -767,7 +767,7 @@ add_menu_item (NMDevice *device,
/* Add the default / inactive connection items */
if (!nma_menu_device_check_unusable (device)) {
if ((!active && g_slist_length (connections)) || (active && g_slist_length (connections) > 1))
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (connections)) {
for (iter = connections; iter; iter = g_slist_next (iter)) {
diff --git a/src/applet-device-bt.c b/src/applet-device-bt.c
index 580268d..5531fa5 100644
--- a/src/applet-device-bt.c
+++ b/src/applet-device-bt.c
@@ -87,7 +87,7 @@ bt_add_menu_item (NMDevice *device,
if (!nma_menu_device_check_unusable (device)) {
/* Add menu items for existing bluetooth connections for this device */
if (g_slist_length (connections)) {
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
applet_add_connection_items (device, connections, TRUE, active, NMA_ADD_INACTIVE,
menu, applet);
}
}
diff --git a/src/applet-device-cdma.c b/src/applet-device-cdma.c
index 995bfcd..af54091 100644
--- a/src/applet-device-cdma.c
+++ b/src/applet-device-cdma.c
@@ -298,7 +298,7 @@ cdma_add_menu_item (NMDevice *device,
/* Add the default / inactive connection items */
if (!nma_menu_device_check_unusable (device)) {
if ((!active && g_slist_length (connections)) || (active && g_slist_length (connections) > 1))
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (connections)) {
for (iter = connections; iter; iter = g_slist_next (iter)) {
diff --git a/src/applet-device-ethernet.c b/src/applet-device-ethernet.c
index 6e1c5a3..b9b07b6 100644
--- a/src/applet-device-ethernet.c
+++ b/src/applet-device-ethernet.c
@@ -128,7 +128,7 @@ ethernet_add_menu_item (NMDevice *device,
if (!nma_menu_device_check_unusable (device)) {
if ((!active && g_slist_length (connections)) || (active && g_slist_length (connections) > 1))
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (connections))
applet_add_connection_items (device, connections, carrier, active, NMA_ADD_INACTIVE,
menu, applet);
diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c
index fd5e9dc..6a943ed 100644
--- a/src/applet-device-gsm.c
+++ b/src/applet-device-gsm.c
@@ -354,7 +354,7 @@ gsm_add_menu_item (NMDevice *device,
/* Add the default / inactive connection items */
if (!nma_menu_device_check_unusable (device)) {
if ((!active && g_slist_length (connections)) || (active && g_slist_length (connections) > 1))
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (connections)) {
for (iter = connections; iter; iter = g_slist_next (iter)) {
diff --git a/src/applet-device-infiniband.c b/src/applet-device-infiniband.c
index d72cb09..d9ae8a0 100644
--- a/src/applet-device-infiniband.c
+++ b/src/applet-device-infiniband.c
@@ -124,7 +124,7 @@ infiniband_add_menu_item (NMDevice *device,
if (!nma_menu_device_check_unusable (device)) {
if ((!active && g_slist_length (connections)) || (active && g_slist_length (connections) > 1))
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (connections))
applet_add_connection_items (device, connections, carrier, active, NMA_ADD_INACTIVE,
menu, applet);
diff --git a/src/applet-device-team.c b/src/applet-device-team.c
index 9c03784..5b17d60 100644
--- a/src/applet-device-team.c
+++ b/src/applet-device-team.c
@@ -69,7 +69,7 @@ team_add_menu_item (NMDevice *device,
if (!device || !nma_menu_device_check_unusable (device)) {
if ((!active && g_slist_length (connections)) || (active && g_slist_length (connections) > 1))
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (connections))
applet_add_connection_items (device, connections, TRUE, active, NMA_ADD_INACTIVE,
menu, applet);
diff --git a/src/applet-device-vlan.c b/src/applet-device-vlan.c
index 204230c..5a508ea 100644
--- a/src/applet-device-vlan.c
+++ b/src/applet-device-vlan.c
@@ -187,7 +187,7 @@ vlan_add_menu_item (NMDevice *device,
if (!device || !nma_menu_device_check_unusable (device)) {
if ((!active && g_slist_length (connections)) || (active && g_slist_length (connections) > 1))
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (connections))
applet_add_connection_items (device, connections, carrier, active, NMA_ADD_INACTIVE,
menu, applet);
diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c
index e8ff46f..82247f2 100644
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -834,7 +834,7 @@ wifi_add_menu_item (NMDevice *device,
GSList *topmenu_items = NULL;
guint32 num_for_toplevel = 5;
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
if (g_slist_length (menu_items) == (num_for_toplevel + 1))
num_for_toplevel++;
diff --git a/src/applet-device-wimax.c b/src/applet-device-wimax.c
index 8780011..d724c14 100644
--- a/src/applet-device-wimax.c
+++ b/src/applet-device-wimax.c
@@ -273,7 +273,7 @@ wimax_add_menu_item (NMDevice *device,
}
if (g_slist_length (sorted)) {
- applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"), -1);
+ applet_menu_item_add_complex_separator_helper (menu, applet, _("Available"));
/* And add menu items for each NSP */
for (iter = sorted; iter; iter = g_slist_next (iter)) {
diff --git a/src/applet.c b/src/applet.c
index 5011b31..db839fd 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -699,8 +699,7 @@ applet_menu_item_activate_helper (NMDevice *device,
void
applet_menu_item_add_complex_separator_helper (GtkWidget *menu,
NMApplet *applet,
- const gchar* label,
- int pos)
+ const gchar* label)
{
GtkWidget *menu_item = gtk_image_menu_item_new ();
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -720,11 +719,7 @@ applet_menu_item_add_complex_separator_helper (GtkWidget *menu,
"child", box,
"sensitive", FALSE,
NULL);
- if (pos < 0)
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
- else
- gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menu_item, pos);
- return;
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
}
GtkWidget *
diff --git a/src/applet.h b/src/applet.h
index 174e42a..2d80ac0 100644
--- a/src/applet.h
+++ b/src/applet.h
@@ -293,8 +293,7 @@ void applet_menu_item_disconnect_helper (NMDevice *device,
void applet_menu_item_add_complex_separator_helper (GtkWidget *menu,
NMApplet *applet,
- const gchar* label,
- int pos);
+ const gchar* label);
GtkWidget*
applet_menu_item_create_device_item_helper (NMDevice *device,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]