summaryrefslogtreecommitdiffstats
path: root/sinksh/syntax_modules
diff options
context:
space:
mode:
Diffstat (limited to 'sinksh/syntax_modules')
-rw-r--r--sinksh/syntax_modules/sink_create.cpp6
-rw-r--r--sinksh/syntax_modules/sink_list.cpp6
-rw-r--r--sinksh/syntax_modules/sink_modify.cpp9
3 files changed, 11 insertions, 10 deletions
diff --git a/sinksh/syntax_modules/sink_create.cpp b/sinksh/syntax_modules/sink_create.cpp
index 9f5d010..f18a990 100644
--- a/sinksh/syntax_modules/sink_create.cpp
+++ b/sinksh/syntax_modules/sink_create.cpp
@@ -25,12 +25,11 @@
25 25
26#include "common/resource.h" 26#include "common/resource.h"
27#include "common/storage.h" 27#include "common/storage.h"
28#include "common/domain/event.h"
29#include "common/domain/folder.h"
30#include "common/resourceconfig.h" 28#include "common/resourceconfig.h"
31#include "common/log.h" 29#include "common/log.h"
32#include "common/storage.h" 30#include "common/storage.h"
33#include "common/definitions.h" 31#include "common/definitions.h"
32#include "common/propertyparser.h"
34 33
35#include "sinksh_utils.h" 34#include "sinksh_utils.h"
36#include "state.h" 35#include "state.h"
@@ -62,7 +61,8 @@ bool create(const QStringList &allArgs, State &state)
62 61
63 auto map = SinkshUtils::keyValueMapFromArgs(args); 62 auto map = SinkshUtils::keyValueMapFromArgs(args);
64 for (auto i = map.begin(); i != map.end(); ++i) { 63 for (auto i = map.begin(); i != map.end(); ++i) {
65 object->setProperty(i.key().toLatin1(), i.value()); 64 const auto property = i.key().toLatin1();
65 object->setProperty(property, Sink::PropertyParser::parse(type.toLatin1(), property, i.value()));
66 } 66 }
67 67
68 auto result = store.create(*object).exec(); 68 auto result = store.create(*object).exec();
diff --git a/sinksh/syntax_modules/sink_list.cpp b/sinksh/syntax_modules/sink_list.cpp
index 837f60d..d63749b 100644
--- a/sinksh/syntax_modules/sink_list.cpp
+++ b/sinksh/syntax_modules/sink_list.cpp
@@ -25,13 +25,12 @@
25 25
26#include "common/resource.h" 26#include "common/resource.h"
27#include "common/storage.h" 27#include "common/storage.h"
28#include "common/domain/event.h"
29#include "common/domain/folder.h"
30#include "common/resourceconfig.h" 28#include "common/resourceconfig.h"
31#include "common/log.h" 29#include "common/log.h"
32#include "common/storage.h" 30#include "common/storage.h"
33#include "common/definitions.h" 31#include "common/definitions.h"
34#include "common/store.h" 32#include "common/store.h"
33#include "common/propertyparser.h"
35 34
36#include "sinksh_utils.h" 35#include "sinksh_utils.h"
37#include "state.h" 36#include "state.h"
@@ -109,7 +108,8 @@ bool list(const QStringList &args_, State &state)
109 if (options.options.contains("filter")) { 108 if (options.options.contains("filter")) {
110 for (const auto &f : options.options.value("filter")) { 109 for (const auto &f : options.options.value("filter")) {
111 auto filter = f.split("="); 110 auto filter = f.split("=");
112 query.filter(filter.at(0).toLatin1(), QVariant::fromValue(Sink::ApplicationDomain::Reference{filter.at(1).toLatin1()})); 111 const auto property = filter.value(0).toLatin1();
112 query.filter(property, Sink::PropertyParser::parse(type.toLatin1(), property, filter.value(1)));
113 } 113 }
114 } 114 }
115 if (options.options.contains("id")) { 115 if (options.options.contains("id")) {
diff --git a/sinksh/syntax_modules/sink_modify.cpp b/sinksh/syntax_modules/sink_modify.cpp
index 4d637d8..2579550 100644
--- a/sinksh/syntax_modules/sink_modify.cpp
+++ b/sinksh/syntax_modules/sink_modify.cpp
@@ -25,12 +25,11 @@
25 25
26#include "common/resource.h" 26#include "common/resource.h"
27#include "common/storage.h" 27#include "common/storage.h"
28#include "common/domain/event.h"
29#include "common/domain/folder.h"
30#include "common/resourceconfig.h" 28#include "common/resourceconfig.h"
31#include "common/log.h" 29#include "common/log.h"
32#include "common/storage.h" 30#include "common/storage.h"
33#include "common/definitions.h" 31#include "common/definitions.h"
32#include "common/propertyparser.h"
34 33
35#include "sinksh_utils.h" 34#include "sinksh_utils.h"
36#include "state.h" 35#include "state.h"
@@ -65,7 +64,8 @@ bool modify(const QStringList &args, State &state)
65 64
66 auto map = SinkshUtils::keyValueMapFromArgs(args); 65 auto map = SinkshUtils::keyValueMapFromArgs(args);
67 for (auto i = map.begin(); i != map.end(); ++i) { 66 for (auto i = map.begin(); i != map.end(); ++i) {
68 object->setProperty(i.key().toLatin1(), i.value()); 67 const auto property = i.key().toLatin1();
68 object->setProperty(property, Sink::PropertyParser::parse(type.toLatin1(), property, i.value()));
69 } 69 }
70 70
71 auto result = store.modify(*object).exec(); 71 auto result = store.modify(*object).exec();
@@ -91,7 +91,8 @@ bool resource(const QStringList &args, State &state)
91 91
92 auto map = SinkshUtils::keyValueMapFromArgs(args); 92 auto map = SinkshUtils::keyValueMapFromArgs(args);
93 for (auto i = map.begin(); i != map.end(); ++i) { 93 for (auto i = map.begin(); i != map.end(); ++i) {
94 object->setProperty(i.key().toLatin1(), i.value()); 94 const auto property = i.key().toLatin1();
95 object->setProperty(property, Sink::PropertyParser::parse("resource", property, i.value()));
95 } 96 }
96 97
97 auto result = store.modify(*object).exec(); 98 auto result = store.modify(*object).exec();