From 3dd8f3e4e242bc1a036ab5a8b01fe90f8162a7ef Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 3 May 2018 10:38:58 +0200 Subject: proto change for X2Go Sessions: Rename "SessionType*" to "Command*". --- src/defines.h | 6 +++--- src/org.ArcticaProject.RemoteLogon.xml | 4 ++-- src/x2go-server.c | 38 +++++++++++++++++----------------- src/x2go-server.h | 4 ++-- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/defines.h b/src/defines.h index a29d90f..721e14c 100644 --- a/src/defines.h +++ b/src/defines.h @@ -44,9 +44,9 @@ #define JSON_URI "URL" #define JSON_USERNAME "Username" #define JSON_PASSWORD "Password" -#define JSON_DOMAIN_REQ "DomainRequired" #define JSON_DOMAIN "WindowsDomain" -#define JSON_SESSIONTYPE "SessionType" -#define JSON_SESSIONTYPE_REQ "SessionTypeRequired" +#define JSON_DOMAIN_REQ "DomainRequired" +#define JSON_COMMNAD "Command" +#define JSON_COMMNAD_REQ "CommandRequired" #endif /* __DEFINES_H__ */ diff --git a/src/org.ArcticaProject.RemoteLogon.xml b/src/org.ArcticaProject.RemoteLogon.xml index 41016e8..c762729 100644 --- a/src/org.ArcticaProject.RemoteLogon.xml +++ b/src/org.ArcticaProject.RemoteLogon.xml @@ -7,7 +7,7 @@ s: server uri b: last used server a(sbva{sv}): properties for the server - s: type: "username", "password", "domain", "email", "sessiontype" + s: type: "username", "password", "domain", "email", "command" b: required v: default value a{sv}: properties for the value @@ -15,7 +15,7 @@ "domains": a(s) for value 'domain': a list of domains that are read only "read-only": b - for value 'sessiontype': TODO -> a subset of session profile parameters... + for value 'command': TODO -> a subset of session profile parameters... "nothing-yet": s a(si): applications pinned for the server s: ID of the application (desktop file) diff --git a/src/x2go-server.c b/src/x2go-server.c index 3b740de..377f6f7 100644 --- a/src/x2go-server.c +++ b/src/x2go-server.c @@ -60,8 +60,8 @@ x2go_server_init (X2GoServer *self) { self->username = NULL; self->password = NULL; - self->sessiontype = NULL; - self->sessiontype_required = FALSE; + self->command = NULL; + self->command_required = FALSE; return; } @@ -91,7 +91,7 @@ x2go_server_finalize (GObject *object) g_clear_pointer(&server->username, g_free); g_clear_pointer(&server->password, password_clear); - g_clear_pointer(&server->sessiontype, g_free); + g_clear_pointer(&server->command, g_free); G_OBJECT_CLASS (x2go_server_parent_class)->finalize (object); return; @@ -129,17 +129,17 @@ get_properties (Server * server) g_variant_builder_add_value(&passbuilder, g_variant_parse(G_VARIANT_TYPE_VARDICT, "{}", NULL, NULL, NULL)); g_variant_builder_add_value(&propbuilder, g_variant_builder_end(&passbuilder)); - GVariantBuilder sessiontypebuilder; - g_variant_builder_init(&sessiontypebuilder, G_VARIANT_TYPE_TUPLE); - g_variant_builder_add_value(&sessiontypebuilder, g_variant_new_string("x2gosession")); - g_variant_builder_add_value(&sessiontypebuilder, g_variant_new_boolean(rserver->sessiontype_required)); - if (rserver->sessiontype == NULL) { - g_variant_builder_add_value(&sessiontypebuilder, g_variant_new_variant(g_variant_new_string(""))); + GVariantBuilder commandbuilder; + g_variant_builder_init(&commandbuilder, G_VARIANT_TYPE_TUPLE); + g_variant_builder_add_value(&commandbuilder, g_variant_new_string("command")); + g_variant_builder_add_value(&commandbuilder, g_variant_new_boolean(rserver->command_required)); + if (rserver->command == NULL) { + g_variant_builder_add_value(&commandbuilder, g_variant_new_variant(g_variant_new_string(""))); } else { - g_variant_builder_add_value(&sessiontypebuilder, g_variant_new_variant(g_variant_new_string(rserver->sessiontype))); + g_variant_builder_add_value(&commandbuilder, g_variant_new_variant(g_variant_new_string(rserver->command))); } - g_variant_builder_add_value(&sessiontypebuilder, g_variant_parse(G_VARIANT_TYPE_VARDICT, "{}", NULL, NULL, NULL)); - g_variant_builder_add_value(&propbuilder, g_variant_builder_end(&sessiontypebuilder)); + g_variant_builder_add_value(&commandbuilder, g_variant_parse(G_VARIANT_TYPE_VARDICT, "{}", NULL, NULL, NULL)); + g_variant_builder_add_value(&propbuilder, g_variant_builder_end(&commandbuilder)); return g_variant_builder_end(&propbuilder); } @@ -209,18 +209,18 @@ x2go_server_new_from_json (JsonObject * object) } } - if (json_object_has_member(object, JSON_SESSIONTYPE)) { - JsonNode * node = json_object_get_member(object, JSON_SESSIONTYPE); + if (json_object_has_member(object, JSON_COMMNAD)) { + JsonNode * node = json_object_get_member(object, JSON_COMMNAD); if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE && json_node_get_value_type(node) == G_TYPE_STRING) { - const gchar * sessiontype = json_node_get_string(node); - server->sessiontype = g_strdup(sessiontype); + const gchar * command = json_node_get_string(node); + server->command = g_strdup(command); } } - if (json_object_has_member(object, JSON_SESSIONTYPE_REQ)) { - JsonNode * node = json_object_get_member(object, JSON_SESSIONTYPE_REQ); + if (json_object_has_member(object, JSON_COMMNAD_REQ)) { + JsonNode * node = json_object_get_member(object, JSON_COMMNAD_REQ); if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE && json_node_get_value_type(node) == G_TYPE_BOOLEAN) { - server->sessiontype_required = json_node_get_boolean(node); + server->command_required = json_node_get_boolean(node); } } diff --git a/src/x2go-server.h b/src/x2go-server.h index 6135321..11ec64d 100644 --- a/src/x2go-server.h +++ b/src/x2go-server.h @@ -47,8 +47,8 @@ struct _X2GoServer { gchar * username; gchar * password; - gchar * sessiontype; - gboolean sessiontype_required; + gchar * command; + gboolean command_required; }; GType x2go_server_get_type (void); -- cgit v1.2.3