[network-manager-applet] wireless-security: Make wireless_security_get_type() into a macro



commit ed7412397eccec977c3c1466660c3dd2c8a099ef
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Mar 13 13:06:40 2018 +0100

    wireless-security: Make wireless_security_get_type() into a macro
    
    And use WIRELESS_TYPE_SECURITY, rather than calling out to
    wireless_security_get_type() directly. This looks nicer in GtkListStore
    definitions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=794295

 src/connection-editor/page-wifi-security.c |    2 +-
 src/libnm-gtk/nm-wifi-dialog.c             |    2 +-
 src/libnma/nma-wifi-dialog.c               |    2 +-
 src/wireless-security/wireless-security.h  |    9 ++++-----
 4 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c
index 19fd285..b34f427 100644
--- a/src/connection-editor/page-wifi-security.c
+++ b/src/connection-editor/page-wifi-security.c
@@ -324,7 +324,7 @@ finish_setup (CEPageWifiSecurity *self, gpointer unused, GError *error, gpointer
        if (s_wireless_sec)
                default_type = get_default_type_for_security (s_wireless_sec);
 
-       sec_model = gtk_list_store_new (4, G_TYPE_STRING, wireless_security_get_type (), G_TYPE_BOOLEAN, 
G_TYPE_BOOLEAN);
+       sec_model = gtk_list_store_new (4, G_TYPE_STRING, WIRELESS_TYPE_SECURITY, G_TYPE_BOOLEAN, 
G_TYPE_BOOLEAN);
 
        if (security_valid (NMU_SEC_NONE, mode)) {
                gtk_list_store_append (sec_model, &iter);
diff --git a/src/libnm-gtk/nm-wifi-dialog.c b/src/libnm-gtk/nm-wifi-dialog.c
index d6786fd..71c5bd3 100644
--- a/src/libnm-gtk/nm-wifi-dialog.c
+++ b/src/libnm-gtk/nm-wifi-dialog.c
@@ -897,7 +897,7 @@ security_combo_init (NMAWifiDialog *self, gboolean secrets_only)
                wep_type = NM_WEP_KEY_TYPE_PASSPHRASE;
        }
 
-       sec_model = gtk_list_store_new (2, G_TYPE_STRING, wireless_security_get_type ());
+       sec_model = gtk_list_store_new (2, G_TYPE_STRING, WIRELESS_TYPE_SECURITY);
 
        if (nm_utils_security_valid (NMU_SEC_NONE, dev_caps, !!priv->ap, is_adhoc, ap_flags, ap_wpa, ap_rsn)) 
{
                gtk_list_store_append (sec_model, &iter);
diff --git a/src/libnma/nma-wifi-dialog.c b/src/libnma/nma-wifi-dialog.c
index 72b98a7..50d8363 100644
--- a/src/libnma/nma-wifi-dialog.c
+++ b/src/libnma/nma-wifi-dialog.c
@@ -898,7 +898,7 @@ security_combo_init (NMAWifiDialog *self, gboolean secrets_only)
                wep_type = NM_WEP_KEY_TYPE_PASSPHRASE;
        }
 
-       sec_model = gtk_list_store_new (2, G_TYPE_STRING, wireless_security_get_type ());
+       sec_model = gtk_list_store_new (2, G_TYPE_STRING, WIRELESS_TYPE_SECURITY);
 
        if (nm_utils_security_valid (NMU_SEC_NONE, dev_caps, !!priv->ap, is_adhoc, ap_flags, ap_wpa, ap_rsn)) 
{
                gtk_list_store_append (sec_model, &iter);
diff --git a/src/wireless-security/wireless-security.h b/src/wireless-security/wireless-security.h
index cb6553b..caba4a8 100644
--- a/src/wireless-security/wireless-security.h
+++ b/src/wireless-security/wireless-security.h
@@ -24,6 +24,10 @@
 #define WIRELESS_SECURITY_H
 
 typedef struct _WirelessSecurity WirelessSecurity;
+GType wireless_security_get_type (void);
+
+#define WIRELESS_TYPE_SECURITY (wireless_security_get_type ())
+#define WIRELESS_SECURITY(x) ((WirelessSecurity *) x)
 
 typedef void (*WSChangedFunc) (WirelessSecurity *sec, gpointer user_data);
 
@@ -55,9 +59,6 @@ struct _WirelessSecurity {
        WSDestroyFunc destroy;
 };
 
-#define WIRELESS_SECURITY(x) ((WirelessSecurity *) x)
-
-
 GtkWidget *wireless_security_get_widget (WirelessSecurity *sec);
 
 void wireless_security_set_changed_notify (WirelessSecurity *sec,
@@ -91,8 +92,6 @@ WirelessSecurity *wireless_security_ref (WirelessSecurity *sec);
 
 void wireless_security_unref (WirelessSecurity *sec);
 
-GType wireless_security_get_type (void);
-
 /* Below for internal use only */
 
 #include "ws-wep-key.h"


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