[network-manager-applet/lr/import: 5/5] fixup! editor: add connection argument to the new page function
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/lr/import: 5/5] fixup! editor: add connection argument to the new page function
- Date: Thu, 10 Nov 2016 18:09:46 +0000 (UTC)
commit c97b00d60590df686521b6a3f01e812274b17b41
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Thu Nov 10 18:42:47 2016 +0100
fixup! editor: add connection argument to the new page function
src/connection-editor/main.c | 2 ++
src/connection-editor/nm-connection-list.c | 2 +-
src/connection-editor/page-bluetooth.c | 3 ++-
src/connection-editor/page-bond.c | 4 ++--
src/connection-editor/page-bridge.c | 4 ++--
src/connection-editor/page-dsl.c | 4 ++--
src/connection-editor/page-ethernet.c | 4 ++--
src/connection-editor/page-infiniband.c | 4 ++--
src/connection-editor/page-mobile.c | 3 ++-
src/connection-editor/page-team.c | 4 ++--
src/connection-editor/page-vlan.c | 4 ++--
src/connection-editor/page-vpn.c | 4 ++--
src/connection-editor/page-wifi.c | 4 ++--
13 files changed, 25 insertions(+), 21 deletions(-)
---
diff --git a/src/connection-editor/main.c b/src/connection-editor/main.c
index 60b2236..752472a 100644
--- a/src/connection-editor/main.c
+++ b/src/connection-editor/main.c
@@ -58,6 +58,8 @@ idle_create_connection (gpointer user_data)
NMConnection *connection = g_object_get_data (G_OBJECT (list), "nm-connection-editor-connection");
nm_connection_list_create (list, ctype, detail, connection);
+
+ nm_g_object_unref (connection);
return FALSE;
}
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index 25c9d03..dfe6f28 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -927,7 +927,7 @@ nm_connection_list_create (NMConnectionList *self, GType ctype, const char *deta
new_connection_of_type (GTK_WINDOW (self->dialog),
detail,
NULL,
- connection,
+ g_object_ref (connection),
self->client,
types[i].new_connection_func,
really_add_connection,
diff --git a/src/connection-editor/page-bluetooth.c b/src/connection-editor/page-bluetooth.c
index 45eabdb..6a1c5a0 100644
--- a/src/connection-editor/page-bluetooth.c
+++ b/src/connection-editor/page-bluetooth.c
@@ -280,6 +280,7 @@ out:
nma_mobile_wizard_destroy (wizard);
g_object_unref (info->client);
+ g_object_unref (info->connection);
g_free (info);
}
@@ -302,7 +303,7 @@ bluetooth_connection_new (GtkWindow *parent,
info->client = g_object_ref (client);
info->user_data = user_data;
info->type = NM_SETTING_BLUETOOTH_TYPE_PANU;
- info->connection = connection;
+ info->connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
dialog = gtk_dialog_new_with_buttons (_("Bluetooth Type"),
parent,
diff --git a/src/connection-editor/page-bond.c b/src/connection-editor/page-bond.c
index 8b10e38..4bbfaac 100644
--- a/src/connection-editor/page-bond.c
+++ b/src/connection-editor/page-bond.c
@@ -614,8 +614,7 @@ bond_connection_new (GtkWindow *parent,
const char *iface;
char *my_iface;
- if (!connection)
- connection = nm_simple_connection_new ();
+ connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
ce_page_complete_connection (connection,
_("Bond connection %d"),
NM_SETTING_BOND_SETTING_NAME,
@@ -647,5 +646,6 @@ bond_connection_new (GtkWindow *parent,
g_free (my_iface);
(*result_func) (connection, FALSE, NULL, user_data);
+ g_object_unref (connection);
}
diff --git a/src/connection-editor/page-bridge.c b/src/connection-editor/page-bridge.c
index 8774a81..fd2b0f1 100644
--- a/src/connection-editor/page-bridge.c
+++ b/src/connection-editor/page-bridge.c
@@ -308,8 +308,7 @@ bridge_connection_new (GtkWindow *parent,
const char *iface;
char *my_iface;
- if (!connection)
- connection = nm_simple_connection_new ();
+ connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
ce_page_complete_connection (connection,
_("Bridge connection %d"),
NM_SETTING_BRIDGE_SETTING_NAME,
@@ -341,5 +340,6 @@ bridge_connection_new (GtkWindow *parent,
g_free (my_iface);
(*result_func) (connection, FALSE, NULL, user_data);
+ g_object_unref (connection);
}
diff --git a/src/connection-editor/page-dsl.c b/src/connection-editor/page-dsl.c
index 12f24d5..8249e12 100644
--- a/src/connection-editor/page-dsl.c
+++ b/src/connection-editor/page-dsl.c
@@ -212,8 +212,7 @@ dsl_connection_new (GtkWindow *parent,
{
NMSetting *setting;
- if (!connection)
- connection = nm_simple_connection_new ();
+ connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
ce_page_complete_connection (connection,
_("DSL connection %d"),
NM_SETTING_PPPOE_SETTING_NAME,
@@ -230,6 +229,7 @@ dsl_connection_new (GtkWindow *parent,
nm_connection_add_setting (connection, setting);
(*result_func) (connection, FALSE, NULL, user_data);
+ g_object_unref (connection);
}
diff --git a/src/connection-editor/page-ethernet.c b/src/connection-editor/page-ethernet.c
index ee8bf2e..b330ebb 100644
--- a/src/connection-editor/page-ethernet.c
+++ b/src/connection-editor/page-ethernet.c
@@ -495,8 +495,7 @@ ethernet_connection_new (GtkWindow *parent,
PageNewConnectionResultFunc result_func,
gpointer user_data)
{
- if (!connection)
- connection = nm_simple_connection_new ();
+ connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
ce_page_complete_connection (connection,
_("Ethernet connection %d"),
NM_SETTING_WIRED_SETTING_NAME,
@@ -505,5 +504,6 @@ ethernet_connection_new (GtkWindow *parent,
nm_connection_add_setting (connection, nm_setting_wired_new ());
(*result_func) (connection, FALSE, NULL, user_data);
+ g_object_unref (connection);
}
diff --git a/src/connection-editor/page-infiniband.c b/src/connection-editor/page-infiniband.c
index a5e52af..6b0b2e6 100644
--- a/src/connection-editor/page-infiniband.c
+++ b/src/connection-editor/page-infiniband.c
@@ -246,8 +246,7 @@ infiniband_connection_new (GtkWindow *parent,
PageNewConnectionResultFunc result_func,
gpointer user_data)
{
- if (!connection)
- connection = nm_simple_connection_new ();
+ connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
ce_page_complete_connection (connection,
_("InfiniBand connection %d"),
NM_SETTING_INFINIBAND_SETTING_NAME,
@@ -256,5 +255,6 @@ infiniband_connection_new (GtkWindow *parent,
nm_connection_add_setting (connection, nm_setting_infiniband_new ());
(*result_func) (connection, FALSE, NULL, user_data);
+ g_object_unref (connection);
}
diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c
index bd5a477..6259dec 100644
--- a/src/connection-editor/page-mobile.c
+++ b/src/connection-editor/page-mobile.c
@@ -496,6 +496,7 @@ new_connection_mobile_wizard_done (NMAMobileWizard *wizard,
nma_mobile_wizard_destroy (wizard);
g_object_unref (info->client);
+ g_object_unref (info->connection);
g_free (info);
}
@@ -525,7 +526,7 @@ mobile_connection_new (GtkWindow *parent,
info->result_func = result_func;
info->client = g_object_ref (client);
info->user_data = user_data;
- info->connection = connection;
+ info->connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
wizard = nma_mobile_wizard_new (parent, NULL, NM_DEVICE_MODEM_CAPABILITY_NONE, FALSE,
new_connection_mobile_wizard_done, info);
diff --git a/src/connection-editor/page-team.c b/src/connection-editor/page-team.c
index c7ab6ae..e399960 100644
--- a/src/connection-editor/page-team.c
+++ b/src/connection-editor/page-team.c
@@ -1244,8 +1244,7 @@ team_connection_new (GtkWindow *parent,
const char *iface;
char *my_iface;
- if (!connection)
- connection = nm_simple_connection_new ();
+ connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
ce_page_complete_connection (connection,
_("Team connection %d"),
NM_SETTING_TEAM_SETTING_NAME,
@@ -1278,5 +1277,6 @@ team_connection_new (GtkWindow *parent,
g_free (my_iface);
(*result_func) (connection, FALSE, NULL, user_data);
+ g_object_unref (connection);
}
diff --git a/src/connection-editor/page-vlan.c b/src/connection-editor/page-vlan.c
index b1563b6..8bb7511 100644
--- a/src/connection-editor/page-vlan.c
+++ b/src/connection-editor/page-vlan.c
@@ -792,8 +792,7 @@ vlan_connection_new (GtkWindow *parent,
PageNewConnectionResultFunc result_func,
gpointer user_data)
{
- if (!connection)
- connection = nm_simple_connection_new ();
+ connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
ce_page_complete_connection (connection,
_("VLAN connection %d"),
NM_SETTING_VLAN_SETTING_NAME,
@@ -802,5 +801,6 @@ vlan_connection_new (GtkWindow *parent,
nm_connection_add_setting (connection, nm_setting_vlan_new ());
(*result_func) (connection, FALSE, NULL, user_data);
+ g_object_unref (connection);
}
diff --git a/src/connection-editor/page-vpn.c b/src/connection-editor/page-vpn.c
index 20b9c2b..3691572 100644
--- a/src/connection-editor/page-vpn.c
+++ b/src/connection-editor/page-vpn.c
@@ -307,8 +307,7 @@ vpn_connection_new (GtkWindow *parent,
if (!service_type)
service_type = detail;
- if (!connection)
- connection = nm_simple_connection_new ();
+ connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
s_vpn = nm_setting_vpn_new ();
g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, service_type, NULL);
@@ -322,4 +321,5 @@ vpn_connection_new (GtkWindow *parent,
complete_vpn_connection (connection, client);
(*result_func) (connection, FALSE, NULL, user_data);
+ g_object_unref (connection);
}
diff --git a/src/connection-editor/page-wifi.c b/src/connection-editor/page-wifi.c
index e2b4933..649167c 100644
--- a/src/connection-editor/page-wifi.c
+++ b/src/connection-editor/page-wifi.c
@@ -610,8 +610,7 @@ wifi_connection_new (GtkWindow *parent,
{
NMSetting *s_wifi;
- if (!connection)
- connection = nm_simple_connection_new ();
+ connection = connection ? g_object_ref (connection) : nm_simple_connection_new ();
ce_page_complete_connection (connection,
_("Wi-Fi connection %d"),
NM_SETTING_WIRELESS_SETTING_NAME,
@@ -622,6 +621,7 @@ wifi_connection_new (GtkWindow *parent,
nm_connection_add_setting (connection, s_wifi);
(*result_func) (connection, FALSE, NULL, user_data);
+ g_object_unref (connection);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]