summary refs log tree commit diff
path: root/libnm-core/nm-setting-proxy.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-04-11 21:28:04 +0200
committerMichael Biebl <biebl@debian.org>2020-04-11 21:28:04 +0200
commit1e5977b62f896e844b548c3007ace9e1dfa7f9ed (patch)
tree7a7416ed410e72b6200f3d860fd315ec11cc106b /libnm-core/nm-setting-proxy.c
parentb012fa6e1d808e0736c009799c62d835cbfcc1dd (diff)
New upstream version 1.23.90 upstream/1.23.90
Diffstat (limited to 'libnm-core/nm-setting-proxy.c')
-rw-r--r--libnm-core/nm-setting-proxy.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libnm-core/nm-setting-proxy.c b/libnm-core/nm-setting-proxy.c
index 9e83339c..a81b2d03 100644
--- a/libnm-core/nm-setting-proxy.c
+++ b/libnm-core/nm-setting-proxy.c
@@ -34,10 +34,10 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
 );
 
 typedef struct {
-	NMSettingProxyMethod method;
-	gboolean browser_only;
 	char *pac_url;
 	char *pac_script;
+	int method;
+	bool browser_only:1;
 } NMSettingProxyPrivate;
 
 G_DEFINE_TYPE (NMSettingProxy, nm_setting_proxy, NM_TYPE_SETTING)
@@ -119,11 +119,8 @@ static gboolean
 verify (NMSetting *setting, NMConnection *connection, GError **error)
 {
 	NMSettingProxyPrivate *priv = NM_SETTING_PROXY_GET_PRIVATE (setting);
-	NMSettingProxyMethod method;
 
-	method = priv->method;
-
-	if (!NM_IN_SET (method,
+	if (!NM_IN_SET (priv->method,
 	                NM_SETTING_PROXY_METHOD_NONE,
 	                NM_SETTING_PROXY_METHOD_AUTO)) {
 		g_set_error (error,
@@ -134,7 +131,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
 		return FALSE;
 	}
 
-	if (method != NM_SETTING_PROXY_METHOD_AUTO) {
+	if (priv->method != NM_SETTING_PROXY_METHOD_AUTO) {
 		if (priv->pac_url) {
 			g_set_error (error,
 			             NM_CONNECTION_ERROR,
@@ -241,8 +238,9 @@ set_property (GObject *object, guint prop_id,
 /*****************************************************************************/
 
 static void
-nm_setting_proxy_init (NMSettingProxy *setting)
+nm_setting_proxy_init (NMSettingProxy *self)
 {
+	nm_assert (NM_SETTING_PROXY_GET_PRIVATE (self)->method == NM_SETTING_PROXY_METHOD_NONE);
 }
 
 /**
@@ -306,7 +304,6 @@ nm_setting_proxy_class_init (NMSettingProxyClass *klass)
 	    g_param_spec_int (NM_SETTING_PROXY_METHOD, "", "",
 	                      G_MININT32, G_MAXINT32, NM_SETTING_PROXY_METHOD_NONE,
 	                      G_PARAM_READWRITE |
-	                      G_PARAM_CONSTRUCT |
 	                      G_PARAM_STATIC_STRINGS);
 
 	/**