diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-09 14:00:26 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-09 14:00:26 +0200 |
commit | 3062983d075761c457249b8c3c1248aa0d45e46a (patch) | |
tree | 9ff6d0956d3ad77a53f465eb7897e500edad2b8a /common/domainadaptor.h | |
parent | f10d223559b16c576093eea080dc0d5638ab3323 (diff) | |
download | sink-3062983d075761c457249b8c3c1248aa0d45e46a.tar.gz sink-3062983d075761c457249b8c3c1248aa0d45e46a.zip |
Use QByteArray instead of QString
All identifiers should be latin1 and we make this explicit by using
QByteArray. QString is reserved for strings that can be UTF-8 or alike.
Diffstat (limited to 'common/domainadaptor.h')
-rw-r--r-- | common/domainadaptor.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/domainadaptor.h b/common/domainadaptor.h index e46e893..692c8c1 100644 --- a/common/domainadaptor.h +++ b/common/domainadaptor.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #include "entity_generated.h" | 22 | #include "entity_generated.h" |
23 | #include <QVariant> | 23 | #include <QVariant> |
24 | #include <QString> | 24 | #include <QByteArray> |
25 | #include <functional> | 25 | #include <functional> |
26 | #include "clientapi.h" //for domain parts | 26 | #include "clientapi.h" //for domain parts |
27 | 27 | ||
@@ -35,7 +35,7 @@ template<typename BufferType> | |||
35 | class PropertyMapper | 35 | class PropertyMapper |
36 | { | 36 | { |
37 | public: | 37 | public: |
38 | void setProperty(const QString &key, const QVariant &value, BufferType *buffer) | 38 | void setProperty(const QByteArray &key, const QVariant &value, BufferType *buffer) |
39 | { | 39 | { |
40 | if (mWriteAccessors.contains(key)) { | 40 | if (mWriteAccessors.contains(key)) { |
41 | auto accessor = mWriteAccessors.value(key); | 41 | auto accessor = mWriteAccessors.value(key); |
@@ -43,7 +43,7 @@ public: | |||
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 | ||
46 | virtual QVariant getProperty(const QString &key, BufferType const *buffer) const | 46 | virtual QVariant getProperty(const QByteArray &key, BufferType const *buffer) const |
47 | { | 47 | { |
48 | if (mReadAccessors.contains(key)) { | 48 | if (mReadAccessors.contains(key)) { |
49 | auto accessor = mReadAccessors.value(key); | 49 | auto accessor = mReadAccessors.value(key); |
@@ -51,8 +51,8 @@ public: | |||
51 | } | 51 | } |
52 | return QVariant(); | 52 | return QVariant(); |
53 | } | 53 | } |
54 | QHash<QString, std::function<QVariant(BufferType const *)> > mReadAccessors; | 54 | QHash<QByteArray, std::function<QVariant(BufferType const *)> > mReadAccessors; |
55 | QHash<QString, std::function<void(const QVariant &, BufferType*)> > mWriteAccessors; | 55 | QHash<QByteArray, std::function<void(const QVariant &, BufferType*)> > mWriteAccessors; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | //The factory should define how to go from an entitybuffer (local + resource buffer), to a domain type adapter. | 58 | //The factory should define how to go from an entitybuffer (local + resource buffer), to a domain type adapter. |