[network-manager-applet/th/c-e-import-fixes-bgo774290: 5/10] c-e: tag NewConnectionTypeFilterFunc with a special argument



commit 0cc660978f9aeaff718a5c79e3fa51fcce3116b7
Author: Thomas Haller <thaller redhat com>
Date:   Fri Nov 11 15:36:37 2016 +0100

    c-e: tag NewConnectionTypeFilterFunc with a special argument

 src/connection-editor/connection-helpers.c |    6 +++---
 src/connection-editor/connection-helpers.h |    6 +++++-
 src/connection-editor/page-bond.c          |    4 +++-
 src/connection-editor/page-bridge.c        |    4 +++-
 src/connection-editor/page-team.c          |    4 +++-
 src/connection-editor/page-vlan.c          |   20 +++++++++++---------
 src/connection-editor/page-vpn.c           |    4 +++-
 7 files changed, 31 insertions(+), 17 deletions(-)
---
diff --git a/src/connection-editor/connection-helpers.c b/src/connection-editor/connection-helpers.c
index ece0680..cfe519f 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 05640b5..db56f30 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 5e02a2b..2662fb1 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 1c33a7e..2d48bc8 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 87adbea..3bdfbbe 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 33e515c..a1380c3 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 7d327d1..f0f1b3d 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;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]