[X2Go-Commits] [libx2goclient] 09/18: src/x2goclient-network-ssh.{c, h}: implement usage of session-path property in base class.
git-admin at x2go.org
git-admin at x2go.org
Mon Aug 19 15:47:03 CEST 2019
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository libx2goclient.
commit 7aa1bcaf61900098f0e37916e6874fa35ded3fc9
Author: Mihai Moldovan <ionic at ionic.de>
Date: Mon Aug 19 14:15:11 2019 +0200
src/x2goclient-network-ssh.{c,h}: implement usage of session-path property in base class.
---
src/x2goclient-network-ssh.c | 28 ++++++++++++++++++++++++++--
src/x2goclient-network-ssh.h | 2 +-
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c
index 756a7a3..16ae82d 100644
--- a/src/x2goclient-network-ssh.c
+++ b/src/x2goclient-network-ssh.c
@@ -113,8 +113,32 @@ static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass *klass)
static void x2goclient_network_ssh_init (X2GoClientNetworkSSH *self) {
}
-X2GoClientNetworkSSH* x2goclient_network_ssh_new (void) {
- return (g_object_new (X2GOCLIENT_TYPE_NETWORK_SSH, NULL));
+X2GoClientNetworkSSH* x2goclient_network_ssh_new (const char *session_path) {
+ X2GoClientNetworkSSH *ret = NULL;
+
+ GArray *prop_names = g_array_new (FALSE, TRUE, sizeof (gchar*));
+ GArray *prop_values = g_array_new (FALSE, TRUE, sizeof (GValue));
+
+ if (session_path) {
+ gchar *tmp_name = "session-path";
+ g_array_append_val (prop_names, tmp_name);
+ GValue tmp_val = G_VALUE_INIT;
+ g_value_init (&tmp_val, G_TYPE_STRING);
+ g_value_set_string (&tmp_val, session_path);
+ g_array_append_val (prop_values, tmp_val);
+ }
+
+ ret = (X2GoClientNetworkSSH*)(g_object_new_with_properties (X2GOCLIENT_TYPE_NETWORK_SSH,
+ prop_names->len,
+ (const gchar **)(prop_names->data),
+ (const GValue*)(prop_values->data)));
+
+ g_array_free (prop_names, TRUE);
+ prop_names = NULL;
+ g_array_free (prop_values, TRUE);
+ prop_values = NULL;
+
+ return (ret);
}
static void x2goclient_network_ssh_dispose (GObject *object) {
diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h
index fee6793..05be387 100644
--- a/src/x2goclient-network-ssh.h
+++ b/src/x2goclient-network-ssh.h
@@ -39,7 +39,7 @@ X2GoClientNetworkOptionsSSH* x2goclient_network_options_ssh_new (void);
#define X2GOCLIENT_TYPE_NETWORK_SSH (x2goclient_network_ssh_get_type ())
G_DECLARE_FINAL_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT, NETWORK_SSH, X2GoClientNetwork)
-X2GoClientNetworkSSH* x2goclient_network_ssh_new (void);
+X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar *session_path);
gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH *self);
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
More information about the x2go-commits
mailing list