diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-15 16:21:06 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-16 10:39:59 +0100 |
commit | f7a42de9bfd6e34f1dc46da433d3f45976b1cd0e (patch) | |
tree | 421899ff287eb44459587aee6549ff098ab564fd /sinksh/syntax_modules/sink_modify.cpp | |
parent | 73ef798bf849a01418895c2e88300e1c6730b665 (diff) | |
download | sink-f7a42de9bfd6e34f1dc46da433d3f45976b1cd0e.tar.gz sink-f7a42de9bfd6e34f1dc46da433d3f45976b1cd0e.zip |
PropertyParser to properly parse different property types.
Diffstat (limited to 'sinksh/syntax_modules/sink_modify.cpp')
-rw-r--r-- | sinksh/syntax_modules/sink_modify.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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(); |