diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-21 14:43:23 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-21 14:43:23 +0100 |
commit | 042d8fb10552d0bcc92647338d9d763357f35880 (patch) | |
tree | d03983d21128f753953e319f96a26a5e8968d7dd /common/propertymapper.cpp | |
parent | 00bb8525c973fc583137c7bc307d3cff76ad24d5 (diff) | |
download | sink-042d8fb10552d0bcc92647338d9d763357f35880.tar.gz sink-042d8fb10552d0bcc92647338d9d763357f35880.zip |
Support the attachment property
Diffstat (limited to 'common/propertymapper.cpp')
-rw-r--r-- | common/propertymapper.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/propertymapper.cpp b/common/propertymapper.cpp index 17a73cb..5348b11 100644 --- a/common/propertymapper.cpp +++ b/common/propertymapper.cpp | |||
@@ -68,6 +68,16 @@ QVariant propertyToVariant<QByteArray>(const flatbuffers::String *property) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | template <> | 70 | template <> |
71 | QVariant propertyToVariant<QByteArray>(const flatbuffers::Vector<uint8_t> *property) | ||
72 | { | ||
73 | if (property) { | ||
74 | //We have to copy the memory, otherwise it would become eventually invalid | ||
75 | return QByteArray(reinterpret_cast<const char *>(property->Data()), property->Length()); | ||
76 | } | ||
77 | return QVariant(); | ||
78 | } | ||
79 | |||
80 | template <> | ||
71 | QVariant propertyToVariant<bool>(uint8_t property) | 81 | QVariant propertyToVariant<bool>(uint8_t property) |
72 | { | 82 | { |
73 | return static_cast<bool>(property); | 83 | return static_cast<bool>(property); |