Move import-export to shared/ in order to be able to use it in the actual plugin
parent
94046d0b8c
commit
03ccd23708
|
@ -35,7 +35,8 @@ ui_DATA =
|
|||
|
||||
shared_sources = \
|
||||
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 = \
|
||||
properties/nm-openvpn-editor-plugin.c \
|
||||
properties/nm-openvpn-editor-plugin.h \
|
||||
properties/import-export.c \
|
||||
properties/import-export.h
|
||||
properties/nm-openvpn-editor-plugin.h
|
||||
|
||||
editor_sources = \
|
||||
properties/resources.c \
|
||||
|
@ -400,6 +399,8 @@ EXTRA_DIST += \
|
|||
shared/nm-service-defines.h \
|
||||
shared/utils.c \
|
||||
shared/utils.h \
|
||||
shared/import-export.c \
|
||||
shared/import-export.h \
|
||||
$(NULL)
|
||||
|
||||
CLEANFILES += \
|
||||
|
|
|
@ -1183,8 +1183,8 @@ args_write_line_setting_value (GString *f,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static GString *
|
||||
do_export_create (NMConnection *connection, const char *path, GError **error)
|
||||
GString *
|
||||
create_config_string (NMConnection *connection, GError **error)
|
||||
{
|
||||
NMSettingConnection *s_con;
|
||||
NMSettingVpn *s_vpn;
|
||||
|
@ -1203,14 +1203,6 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
|
|||
GArray *ips;
|
||||
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_vpn = nm_connection_get_setting_vpn (connection);
|
||||
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;
|
||||
gs_free_error GError *local = NULL;
|
||||
|
||||
f = do_export_create (connection, path, error);
|
||||
f = create_config_string (connection, error);
|
||||
if (!f)
|
||||
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);
|
||||
|
||||
GString *create_config_string (NMConnection *connection, GError **error);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue