summaryrefslogtreecommitdiff
path: root/src/nm-proxy-config.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-10-04 11:58:32 +0200
committerThomas Haller <thaller@redhat.com>2016-10-04 11:58:32 +0200
commit107089327c4ca10bd84a01410244304fb412ace3 (patch)
tree71b60c5c3d4e7529919d1373903f4026ca92d334 /src/nm-proxy-config.c
parent132234bb79d94ddd13d97aac6351c693cd374718 (diff)
downloadNetworkManager-107089327c4ca10bd84a01410244304fb412ace3.tar.gz
proxy: reorder parts in nm-proxy-config.c and nm-pacrunner-manager.c
Diffstat (limited to 'src/nm-proxy-config.c')
-rw-r--r--src/nm-proxy-config.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/nm-proxy-config.c b/src/nm-proxy-config.c
index 906951cab9..e051367a9f 100644
--- a/src/nm-proxy-config.c
+++ b/src/nm-proxy-config.c
@@ -26,6 +26,8 @@
#include "nm-core-internal.h"
+/*****************************************************************************/
+
typedef struct {
NMProxyConfigMethod method;
gboolean browser_only;
@@ -44,27 +46,10 @@ struct _NMProxyConfigClass {
G_DEFINE_TYPE (NMProxyConfig, nm_proxy_config, G_TYPE_OBJECT)
-#define NM_PROXY_CONFIG_GET_PRIVATE(self) \
- ({ \
- /* preserve the const-ness of self. Unfortunately, that
- * way, @self cannot be a void pointer */ \
- typeof (self) _self = (self); \
- \
- /* Get compiler error if variable is of wrong type */ \
- _nm_unused const NMProxyConfig *_self2 = (_self); \
- \
- nm_assert (NM_IS_PROXY_CONFIG (_self)); \
- &_self->_priv; \
- })
+#define NM_PROXY_CONFIG_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMProxyConfig, NM_IS_PROXY_CONFIG)
/*****************************************************************************/
-NMProxyConfig *
-nm_proxy_config_new (void)
-{
- return NM_PROXY_CONFIG (g_object_new (NM_TYPE_PROXY_CONFIG, NULL));
-}
-
void
nm_proxy_config_set_method (NMProxyConfig *config, NMProxyConfigMethod method)
{
@@ -165,6 +150,8 @@ nm_proxy_config_get_pac_script (const NMProxyConfig *config)
return priv->pac_script;
}
+/*****************************************************************************/
+
static void
nm_proxy_config_init (NMProxyConfig *config)
{
@@ -173,6 +160,12 @@ nm_proxy_config_init (NMProxyConfig *config)
priv->method = NM_PROXY_CONFIG_METHOD_NONE;
}
+NMProxyConfig *
+nm_proxy_config_new (void)
+{
+ return NM_PROXY_CONFIG (g_object_new (NM_TYPE_PROXY_CONFIG, NULL));
+}
+
static void
finalize (GObject *object)
{