[gnome-control-center/gbsneto/cleanup-network-panel: 17/23] net-proxy: Turn into a final class



commit 0b35233412d02972c4df75c789377f9f0a1fdc88
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Oct 31 21:51:54 2018 -0300

    net-proxy: Turn into a final class
    
    Same case of NetVpn and NetDeviceWifi.

 panels/network/net-proxy.c |  8 +++++++-
 panels/network/net-proxy.h | 26 +++-----------------------
 2 files changed, 10 insertions(+), 24 deletions(-)
---
diff --git a/panels/network/net-proxy.c b/panels/network/net-proxy.c
index f3f17865a..4a77a3532 100644
--- a/panels/network/net-proxy.c
+++ b/panels/network/net-proxy.c
@@ -35,11 +35,17 @@ typedef enum
         N_MODES
 } ProxyMode;
 
-struct _NetProxyPrivate
+typedef struct
 {
         GSettings        *settings;
         GtkBuilder       *builder;
         GtkToggleButton  *mode_radios[3];
+} NetProxyPrivate;
+
+struct _NetProxy
+{
+        NetObject                parent;
+        NetProxyPrivate         *priv;
 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (NetProxy, net_proxy, NET_TYPE_OBJECT)
diff --git a/panels/network/net-proxy.h b/panels/network/net-proxy.h
index 5eece5b29..f647e7d75 100644
--- a/panels/network/net-proxy.h
+++ b/panels/network/net-proxy.h
@@ -28,29 +28,9 @@
 
 G_BEGIN_DECLS
 
-#define NET_TYPE_PROXY          (net_proxy_get_type ())
-#define NET_PROXY(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), NET_TYPE_PROXY, NetProxy))
-#define NET_PROXY_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST((k), NET_TYPE_PROXY, NetProxyClass))
-#define NET_IS_PROXY(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), NET_TYPE_PROXY))
-#define NET_IS_PROXY_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), NET_TYPE_PROXY))
-#define NET_PROXY_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), NET_TYPE_PROXY, NetProxyClass))
-
-typedef struct _NetProxyPrivate         NetProxyPrivate;
-typedef struct _NetProxy                NetProxy;
-typedef struct _NetProxyClass           NetProxyClass;
-
-struct _NetProxy
-{
-        NetObject                parent;
-        NetProxyPrivate         *priv;
-};
-
-struct _NetProxyClass
-{
-        NetObjectClass           parent_class;
-};
-
-GType            net_proxy_get_type                     (void);
+#define NET_TYPE_PROXY (net_proxy_get_type ())
+G_DECLARE_FINAL_TYPE (NetProxy, net_proxy, NET, PROXY, NetObject)
+
 NetProxy        *net_proxy_new                          (void);
 
 G_END_DECLS


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