summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-11-11 15:36:37 +0100
committerThomas Haller <thaller@redhat.com>2016-11-22 11:47:29 +0100
commit0cc660978f9aeaff718a5c79e3fa51fcce3116b7 (patch)
treed6e9baf4a2832f5ca7846bd391db9e65f1cf2f03
parent79a94106e31170e0e38427f15b15b523c5853a93 (diff)
downloadnetwork-manager-applet-0cc660978f9aeaff718a5c79e3fa51fcce3116b7.tar.gz
c-e: tag NewConnectionTypeFilterFunc with a special argument
-rw-r--r--src/connection-editor/connection-helpers.c6
-rw-r--r--src/connection-editor/connection-helpers.h6
-rw-r--r--src/connection-editor/page-bond.c4
-rw-r--r--src/connection-editor/page-bridge.c4
-rw-r--r--src/connection-editor/page-team.c4
-rw-r--r--src/connection-editor/page-vlan.c20
-rw-r--r--src/connection-editor/page-vpn.c4
7 files changed, 31 insertions, 17 deletions
diff --git a/src/connection-editor/connection-helpers.c b/src/connection-editor/connection-helpers.c
index ece06802..cfe519f1 100644
--- a/src/connection-editor/connection-helpers.c
+++ b/src/connection-editor/connection-helpers.c
@@ -348,11 +348,11 @@ set_up_connection_type_combo (GtkComboBox *combo,
for (i = 0; list[i].name; i++) {
if (type_filter_func) {
if ( ( list[i].setting_types[0] == G_TYPE_INVALID
- || !type_filter_func (list[i].setting_types[0], user_data))
+ || !type_filter_func (FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_CALL, list[i].setting_types[0], user_data))
&& ( list[i].setting_types[1] == G_TYPE_INVALID
- || !type_filter_func (list[i].setting_types[1], user_data))
+ || !type_filter_func (FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_CALL, list[i].setting_types[1], user_data))
&& ( list[i].setting_types[2] == G_TYPE_INVALID
- || !type_filter_func (list[i].setting_types[2], user_data)))
+ || !type_filter_func (FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_CALL, list[i].setting_types[2], user_data)))
continue;
}
diff --git a/src/connection-editor/connection-helpers.h b/src/connection-editor/connection-helpers.h
index 05640b59..db56f302 100644
--- a/src/connection-editor/connection-helpers.h
+++ b/src/connection-editor/connection-helpers.h
@@ -34,7 +34,11 @@ typedef struct {
ConnectionTypeData *get_connection_type_list (void);
-typedef gboolean (*NewConnectionTypeFilterFunc) (GType type,
+struct _func_tag_new_connection_type_filter;
+#define FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_IMPL struct _func_tag_new_connection_type_filter *_dummy
+#define FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_CALL ((struct _func_tag_new_connection_type_filter *) NULL)
+typedef gboolean (*NewConnectionTypeFilterFunc) (FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_IMPL,
+ GType type,
gpointer user_data);
struct _func_tag_new_connection_result;
diff --git a/src/connection-editor/page-bond.c b/src/connection-editor/page-bond.c
index 5e02a2ba..2662fb11 100644
--- a/src/connection-editor/page-bond.c
+++ b/src/connection-editor/page-bond.c
@@ -361,7 +361,9 @@ populate_ui (CEPageBond *self)
}
static gboolean
-connection_type_filter (GType type, gpointer self)
+connection_type_filter (FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_IMPL,
+ GType type,
+ gpointer self)
{
CEPageBondPrivate *priv = CE_PAGE_BOND_GET_PRIVATE (self);
diff --git a/src/connection-editor/page-bridge.c b/src/connection-editor/page-bridge.c
index 1c33a7e4..2d48bc87 100644
--- a/src/connection-editor/page-bridge.c
+++ b/src/connection-editor/page-bridge.c
@@ -162,7 +162,9 @@ create_connection (CEPageMaster *master, NMConnection *connection)
}
static gboolean
-connection_type_filter (GType type, gpointer user_data)
+connection_type_filter (FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_IMPL,
+ GType type,
+ gpointer self)
{
return nm_utils_check_virtual_device_compatibility (NM_TYPE_SETTING_BRIDGE, type);
}
diff --git a/src/connection-editor/page-team.c b/src/connection-editor/page-team.c
index 87adbea3..3bdfbbe7 100644
--- a/src/connection-editor/page-team.c
+++ b/src/connection-editor/page-team.c
@@ -1070,7 +1070,9 @@ create_connection (CEPageMaster *master, NMConnection *connection)
}
static gboolean
-connection_type_filter (GType type, gpointer self)
+connection_type_filter (FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_IMPL,
+ GType type,
+ gpointer self)
{
CEPageTeamPrivate *priv = CE_PAGE_TEAM_GET_PRIVATE (self);
diff --git a/src/connection-editor/page-vlan.c b/src/connection-editor/page-vlan.c
index 33e515cc..a1380c31 100644
--- a/src/connection-editor/page-vlan.c
+++ b/src/connection-editor/page-vlan.c
@@ -238,13 +238,13 @@ edit_parent (FUNC_TAG_NEW_CONNECTION_RESULT_IMPL,
s_con = nm_connection_get_setting_connection (CE_PAGE (self)->connection);
g_object_set (G_OBJECT (s_con),
- NM_SETTING_CONNECTION_AUTOCONNECT, TRUE,
- NULL);
+ NM_SETTING_CONNECTION_AUTOCONNECT, TRUE,
+ NULL);
editor = nm_connection_editor_new (priv->toplevel,
- connection,
- CE_PAGE (self)->client);
+ connection,
+ CE_PAGE (self)->client);
if (!editor) {
g_object_unref (connection);
return;
@@ -255,7 +255,9 @@ edit_parent (FUNC_TAG_NEW_CONNECTION_RESULT_IMPL,
}
static gboolean
-connection_type_filter (GType type, gpointer user_data)
+connection_type_filter (FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_IMPL,
+ GType type,
+ gpointer self)
{
return nm_utils_check_virtual_device_compatibility (NM_TYPE_SETTING_VLAN, type);
}
@@ -273,10 +275,10 @@ parent_changed (GtkWidget *widget, gpointer user_data)
if (parent_id == priv->parents_len - 1) {
gtk_entry_set_text (priv->parent_entry, "");
new_connection_dialog (priv->toplevel,
- CE_PAGE (self)->client,
- connection_type_filter,
- edit_parent,
- self);
+ CE_PAGE (self)->client,
+ connection_type_filter,
+ edit_parent,
+ self);
return;
}
diff --git a/src/connection-editor/page-vpn.c b/src/connection-editor/page-vpn.c
index 7d327d12..f0f1b3d2 100644
--- a/src/connection-editor/page-vpn.c
+++ b/src/connection-editor/page-vpn.c
@@ -212,7 +212,9 @@ complete_vpn_connection (NMConnection *connection, NMClient *client)
#define NEW_VPN_CONNECTION_SECONDARY_LABEL _("Select the type of VPN you wish to use for the new connection. If the type of VPN connection you wish to create does not appear in the list, you may not have the correct VPN plugin installed.")
static gboolean
-vpn_type_filter_func (GType type, gpointer user_data)
+vpn_type_filter_func (FUNC_TAG_NEW_CONNECTION_TYPE_FILTER_IMPL,
+ GType type,
+ gpointer user_data)
{
return type == NM_TYPE_SETTING_VPN;
}