summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-05-28 09:23:58 +0200
committerLubomir Rintel <lkundrak@v3.sk>2018-06-11 15:06:49 +0200
commitbd6fe1781565eb8d7f2fd87f5256ec15dd51a6df (patch)
tree73d2c4af0c439755016a71d108460fb7e54bf513
parent87f5ff69277c566284de96eea19eb79bb244bada (diff)
downloadNetworkManager-bd6fe1781565eb8d7f2fd87f5256ec15dd51a6df.tar.gz
libnm/remote-connection: add filename property
-rw-r--r--libnm/libnm.ver1
-rw-r--r--libnm/nm-remote-connection.c37
-rw-r--r--libnm/nm-remote-connection.h4
3 files changed, 42 insertions, 0 deletions
diff --git a/libnm/libnm.ver b/libnm/libnm.ver
index 8afd01b070..60629ff65c 100644
--- a/libnm/libnm.ver
+++ b/libnm/libnm.ver
@@ -1351,6 +1351,7 @@ global:
nm_connection_get_setting_tc_config;
nm_device_ip_tunnel_get_flags;
nm_ip_tunnel_flags_get_type;
+ nm_remote_connection_get_filename;
nm_remote_connection_get_flags;
nm_setting_connection_get_mdns;
nm_setting_connection_mdns_get_type;
diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c
index bd60c41329..45b804f154 100644
--- a/libnm/nm-remote-connection.c
+++ b/libnm/nm-remote-connection.c
@@ -51,6 +51,7 @@ enum {
PROP_0,
PROP_UNSAVED,
PROP_FLAGS,
+ PROP_FILENAME,
PROP_VISIBLE,
LAST_PROP
@@ -61,6 +62,7 @@ typedef struct {
gboolean unsaved;
guint32 flags;
+ const char *filename;
gboolean visible;
} NMRemoteConnectionPrivate;
@@ -670,6 +672,22 @@ nm_remote_connection_get_flags (NMRemoteConnection *connection)
}
/**
+ * nm_remote_connection_get_filename:
+ * @connection: the #NMRemoteConnection
+ *
+ * Returns: file that stores the connection in case the connection is file-backed.
+ *
+ * Since: 1.12
+ **/
+const char *
+nm_remote_connection_get_filename (NMRemoteConnection *connection)
+{
+ g_return_val_if_fail (NM_IS_REMOTE_CONNECTION (connection), NULL);
+
+ return NM_REMOTE_CONNECTION_GET_PRIVATE (connection)->filename;
+}
+
+/**
* nm_remote_connection_get_visible:
* @connection: the #NMRemoteConnection
*
@@ -760,6 +778,7 @@ init_dbus (NMObject *object)
const NMPropertiesInfo property_info[] = {
{ NM_REMOTE_CONNECTION_UNSAVED, &priv->unsaved },
{ NM_REMOTE_CONNECTION_FLAGS, &priv->flags },
+ { NM_REMOTE_CONNECTION_FILENAME, &priv->filename },
{ NULL },
};
@@ -893,6 +912,9 @@ get_property (GObject *object, guint prop_id,
case PROP_FLAGS:
g_value_set_boolean (value, NM_REMOTE_CONNECTION_GET_PRIVATE (object)->flags);
break;
+ case PROP_FILENAME:
+ g_value_set_string (value, NM_REMOTE_CONNECTION_GET_PRIVATE (object)->filename);
+ break;
case PROP_VISIBLE:
g_value_set_boolean (value, NM_REMOTE_CONNECTION_GET_PRIVATE (object)->visible);
break;
@@ -966,6 +988,21 @@ nm_remote_connection_class_init (NMRemoteConnectionClass *remote_class)
G_PARAM_STATIC_STRINGS));
/**
+ * NMRemoteConnection:filename:
+ *
+ * File that stores the connection in case the connection is
+ * file-backed.
+ *
+ * Since: 1.12
+ **/
+ g_object_class_install_property
+ (object_class, PROP_FILENAME,
+ g_param_spec_string (NM_REMOTE_CONNECTION_FILENAME, "", "",
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS));
+
+ /**
* NMRemoteConnection:visible:
*
* %TRUE if the remote connection is visible to the current user, %FALSE if
diff --git a/libnm/nm-remote-connection.h b/libnm/nm-remote-connection.h
index d5b6a8c4bc..834b52d884 100644
--- a/libnm/nm-remote-connection.h
+++ b/libnm/nm-remote-connection.h
@@ -42,6 +42,7 @@ G_BEGIN_DECLS
#define NM_REMOTE_CONNECTION_PATH "path"
#define NM_REMOTE_CONNECTION_UNSAVED "unsaved"
#define NM_REMOTE_CONNECTION_FLAGS "flags"
+#define NM_REMOTE_CONNECTION_FILENAME "filename"
#define NM_REMOTE_CONNECTION_VISIBLE "visible"
/**
@@ -126,6 +127,9 @@ gboolean nm_remote_connection_get_unsaved (NMRemoteConnection *connection);
NM_AVAILABLE_IN_1_12
NMSettingsConnectionFlags nm_remote_connection_get_flags (NMRemoteConnection *connection);
+NM_AVAILABLE_IN_1_12
+const char *nm_remote_connection_get_filename (NMRemoteConnection *connection);
+
gboolean nm_remote_connection_get_visible (NMRemoteConnection *connection);
G_END_DECLS