diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-15 12:19:54 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-15 12:19:54 +0100 |
commit | 20b4d255509d5a490619afef50e49477ea09c71d (patch) | |
tree | 41269e9d8e0f9417733aeac3e2fbfa9748c88c29 /sinksh | |
parent | 2b517b2fd28e804e82036f55967a1777c1b8d2e9 (diff) | |
download | sink-20b4d255509d5a490619afef50e49477ea09c71d.tar.gz sink-20b4d255509d5a490619afef50e49477ea09c71d.zip |
Set references as references from sinksh.
Diffstat (limited to 'sinksh')
-rw-r--r-- | sinksh/syntax_modules/sink_create.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
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) | |||
94 | object.setResourceType(resourceType.toLatin1()); | 94 | object.setResourceType(resourceType.toLatin1()); |
95 | 95 | ||
96 | for (auto i = map.begin(); i != map.end(); ++i) { | 96 | for (auto i = map.begin(); i != map.end(); ++i) { |
97 | object.setProperty(i.key().toLatin1(), i.value()); | 97 | //FIXME we need a generic way to convert the value to the right type |
98 | if (i.key() == ApplicationDomain::SinkResource::Account::name) { | ||
99 | object.setAccount(i.value().toUtf8()); | ||
100 | } else { | ||
101 | object.setProperty(i.key().toLatin1(), i.value()); | ||
102 | } | ||
98 | } | 103 | } |
99 | 104 | ||
100 | auto result = store.create(object).exec(); | 105 | auto result = store.create(object).exec(); |
@@ -150,7 +155,12 @@ bool identity(const QStringList &args, State &state) | |||
150 | auto object = ApplicationDomain::ApplicationDomainType::createEntity<ApplicationDomain::Identity>("", identifier); | 155 | auto object = ApplicationDomain::ApplicationDomainType::createEntity<ApplicationDomain::Identity>("", identifier); |
151 | 156 | ||
152 | for (auto i = map.begin(); i != map.end(); ++i) { | 157 | for (auto i = map.begin(); i != map.end(); ++i) { |
153 | object.setProperty(i.key().toLatin1(), i.value()); | 158 | //FIXME we need a generic way to convert the value to the right type |
159 | if (i.key() == ApplicationDomain::Identity::Account::name) { | ||
160 | object.setAccount(i.value().toUtf8()); | ||
161 | } else { | ||
162 | object.setProperty(i.key().toLatin1(), i.value()); | ||
163 | } | ||
154 | } | 164 | } |
155 | 165 | ||
156 | auto result = store.create(object).exec(); | 166 | auto result = store.create(object).exec(); |