From 20b4d255509d5a490619afef50e49477ea09c71d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 15 Dec 2016 12:19:54 +0100 Subject: Set references as references from sinksh. --- sinksh/syntax_modules/sink_create.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sinksh/syntax_modules/sink_create.cpp') diff --git a/sinksh/syntax_modules/sink_create.cpp b/sinksh/syntax_modules/sink_create.cpp index 95a4cce..9f5d010 100644 --- a/sinksh/syntax_modules/sink_create.cpp +++ b/sinksh/syntax_modules/sink_create.cpp @@ -94,7 +94,12 @@ bool resource(const QStringList &args, State &state) object.setResourceType(resourceType.toLatin1()); for (auto i = map.begin(); i != map.end(); ++i) { - object.setProperty(i.key().toLatin1(), i.value()); + //FIXME we need a generic way to convert the value to the right type + if (i.key() == ApplicationDomain::SinkResource::Account::name) { + object.setAccount(i.value().toUtf8()); + } else { + object.setProperty(i.key().toLatin1(), i.value()); + } } auto result = store.create(object).exec(); @@ -150,7 +155,12 @@ bool identity(const QStringList &args, State &state) auto object = ApplicationDomain::ApplicationDomainType::createEntity("", identifier); for (auto i = map.begin(); i != map.end(); ++i) { - object.setProperty(i.key().toLatin1(), i.value()); + //FIXME we need a generic way to convert the value to the right type + if (i.key() == ApplicationDomain::Identity::Account::name) { + object.setAccount(i.value().toUtf8()); + } else { + object.setProperty(i.key().toLatin1(), i.value()); + } } auto result = store.create(object).exec(); -- cgit v1.2.3