summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sinksh/syntax_modules/sink_create.cpp14
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();