mirror of
				https://github.com/max-moser/network-manager-wireguard.git
				synced 2025-11-04 09:03:49 +03:00 
			
		
		
		
	Move import-export to shared/ in order to be able to use it in the actual plugin
This commit is contained in:
		
							parent
							
								
									94046d0b8c
								
							
						
					
					
						commit
						03ccd23708
					
				@ -35,7 +35,8 @@ ui_DATA =
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
shared_sources = \
 | 
					shared_sources = \
 | 
				
			||||||
	shared/nm-utils/nm-shared-utils.c \
 | 
						shared/nm-utils/nm-shared-utils.c \
 | 
				
			||||||
	shared/utils.c
 | 
						shared/utils.c \
 | 
				
			||||||
 | 
						shared/import-export.c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
###############################################################################
 | 
					###############################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -102,9 +103,7 @@ EXTRA_DIST += \
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
plugin_sources = \
 | 
					plugin_sources = \
 | 
				
			||||||
	properties/nm-openvpn-editor-plugin.c \
 | 
						properties/nm-openvpn-editor-plugin.c \
 | 
				
			||||||
	properties/nm-openvpn-editor-plugin.h \
 | 
						properties/nm-openvpn-editor-plugin.h
 | 
				
			||||||
	properties/import-export.c \
 | 
					 | 
				
			||||||
	properties/import-export.h
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
editor_sources = \
 | 
					editor_sources = \
 | 
				
			||||||
	properties/resources.c \
 | 
						properties/resources.c \
 | 
				
			||||||
@ -400,6 +399,8 @@ EXTRA_DIST += \
 | 
				
			|||||||
	shared/nm-service-defines.h \
 | 
						shared/nm-service-defines.h \
 | 
				
			||||||
	shared/utils.c \
 | 
						shared/utils.c \
 | 
				
			||||||
	shared/utils.h \
 | 
						shared/utils.h \
 | 
				
			||||||
 | 
						shared/import-export.c \
 | 
				
			||||||
 | 
						shared/import-export.h \
 | 
				
			||||||
	$(NULL)
 | 
						$(NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CLEANFILES += \
 | 
					CLEANFILES += \
 | 
				
			||||||
 | 
				
			|||||||
@ -1183,8 +1183,8 @@ args_write_line_setting_value (GString *f,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/*****************************************************************************/
 | 
					/*****************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static GString *
 | 
					GString *
 | 
				
			||||||
do_export_create (NMConnection *connection, const char *path, GError **error)
 | 
					create_config_string (NMConnection *connection, GError **error)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	NMSettingConnection *s_con;
 | 
						NMSettingConnection *s_con;
 | 
				
			||||||
	NMSettingVpn *s_vpn;
 | 
						NMSettingVpn *s_vpn;
 | 
				
			||||||
@ -1203,14 +1203,6 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
 | 
				
			|||||||
	GArray *ips;
 | 
						GArray *ips;
 | 
				
			||||||
	nm_auto(_auto_free_gstring_p) GString *f = NULL;
 | 
						nm_auto(_auto_free_gstring_p) GString *f = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!path || !path[0]) {
 | 
					 | 
				
			||||||
		g_set_error_literal (error,
 | 
					 | 
				
			||||||
		                     NMV_EDITOR_PLUGIN_ERROR,
 | 
					 | 
				
			||||||
		                     NMV_EDITOR_PLUGIN_ERROR_FILE_NOT_VPN,
 | 
					 | 
				
			||||||
		                     _("missing path argument"));
 | 
					 | 
				
			||||||
		return NULL;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	s_con = nm_connection_get_setting_connection (connection);
 | 
						s_con = nm_connection_get_setting_connection (connection);
 | 
				
			||||||
	s_vpn = nm_connection_get_setting_vpn (connection);
 | 
						s_vpn = nm_connection_get_setting_vpn (connection);
 | 
				
			||||||
	if (!s_con || !s_vpn) {
 | 
						if (!s_con || !s_vpn) {
 | 
				
			||||||
@ -1330,7 +1322,7 @@ do_export (const char *path, NMConnection *connection, GError **error)
 | 
				
			|||||||
	nm_auto(_auto_free_gstring_p) GString *f = NULL;
 | 
						nm_auto(_auto_free_gstring_p) GString *f = NULL;
 | 
				
			||||||
	gs_free_error GError *local = NULL;
 | 
						gs_free_error GError *local = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	f = do_export_create (connection, path, error);
 | 
						f = create_config_string (connection, error);
 | 
				
			||||||
	if (!f)
 | 
						if (!f)
 | 
				
			||||||
		return FALSE;
 | 
							return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -33,4 +33,6 @@ NMConnection *do_import (const char *path, const char *contents, gsize contents_
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
gboolean do_export (const char *path, NMConnection *connection, GError **error);
 | 
					gboolean do_export (const char *path, NMConnection *connection, GError **error);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					GString *create_config_string (NMConnection *connection, GError **error);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user