diff options
Diffstat (limited to 'common/propertymapper.cpp')
-rw-r--r-- | common/propertymapper.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/common/propertymapper.cpp b/common/propertymapper.cpp index 249221a..4cfe154 100644 --- a/common/propertymapper.cpp +++ b/common/propertymapper.cpp | |||
@@ -42,6 +42,15 @@ flatbuffers::uoffset_t variantToProperty<Sink::ApplicationDomain::BLOB>(const QV | |||
42 | } | 42 | } |
43 | 43 | ||
44 | template <> | 44 | template <> |
45 | flatbuffers::uoffset_t variantToProperty<Sink::ApplicationDomain::Reference>(const QVariant &property, flatbuffers::FlatBufferBuilder &fbb) | ||
46 | { | ||
47 | if (property.isValid()) { | ||
48 | return fbb.CreateString(property.value<Sink::ApplicationDomain::Reference>().value.toStdString()).o; | ||
49 | } | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | template <> | ||
45 | flatbuffers::uoffset_t variantToProperty<QByteArray>(const QVariant &property, flatbuffers::FlatBufferBuilder &fbb) | 54 | flatbuffers::uoffset_t variantToProperty<QByteArray>(const QVariant &property, flatbuffers::FlatBufferBuilder &fbb) |
46 | { | 55 | { |
47 | if (property.isValid()) { | 56 | if (property.isValid()) { |
@@ -130,6 +139,16 @@ QVariant propertyToVariant<Sink::ApplicationDomain::BLOB>(const flatbuffers::Str | |||
130 | } | 139 | } |
131 | 140 | ||
132 | template <> | 141 | template <> |
142 | QVariant propertyToVariant<Sink::ApplicationDomain::Reference>(const flatbuffers::String *property) | ||
143 | { | ||
144 | if (property) { | ||
145 | // We have to copy the memory, otherwise it would become eventually invalid | ||
146 | return QVariant::fromValue(Sink::ApplicationDomain::Reference{QString::fromStdString(property->c_str()).toUtf8()}); | ||
147 | } | ||
148 | return QVariant(); | ||
149 | } | ||
150 | |||
151 | template <> | ||
133 | QVariant propertyToVariant<QByteArray>(const flatbuffers::String *property) | 152 | QVariant propertyToVariant<QByteArray>(const flatbuffers::String *property) |
134 | { | 153 | { |
135 | if (property) { | 154 | if (property) { |