diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-11 16:34:38 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-11 16:34:38 +0100 |
commit | 4bb71b2142223d4a81a449c6bfcfa22918c6fc90 (patch) | |
tree | 00ddbe2f5ecbb189d81f8367089d43ef9f1f6a91 /common/typeindex.cpp | |
parent | 88d97300ed6d604f5cbe426bb8c5e2fd52762518 (diff) | |
download | sink-4bb71b2142223d4a81a449c6bfcfa22918c6fc90.tar.gz sink-4bb71b2142223d4a81a449c6bfcfa22918c6fc90.zip |
Avoid warnings when trying to write empty keys.
Diffstat (limited to 'common/typeindex.cpp')
-rw-r--r-- | common/typeindex.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp index b1bcf6a..37c0517 100644 --- a/common/typeindex.cpp +++ b/common/typeindex.cpp | |||
@@ -36,7 +36,7 @@ void TypeIndex::addProperty<QByteArray>(const QByteArray &property) | |||
36 | { | 36 | { |
37 | auto indexer = [this, property](const QByteArray &identifier, const QVariant &value, Sink::Storage::Transaction &transaction) { | 37 | auto indexer = [this, property](const QByteArray &identifier, const QVariant &value, Sink::Storage::Transaction &transaction) { |
38 | // Trace() << "Indexing " << mType + ".index." + property << value.toByteArray(); | 38 | // Trace() << "Indexing " << mType + ".index." + property << value.toByteArray(); |
39 | if (value.isValid()) { | 39 | if (value.isValid() && !value.toByteArray().isEmpty()) { |
40 | Index(mType + ".index." + property, transaction).add(value.toByteArray(), identifier); | 40 | Index(mType + ".index." + property, transaction).add(value.toByteArray(), identifier); |
41 | } else { | 41 | } else { |
42 | Index(mType + ".index." + property, transaction).add("toplevel", identifier); | 42 | Index(mType + ".index." + property, transaction).add("toplevel", identifier); |
@@ -51,7 +51,7 @@ void TypeIndex::addProperty<QString>(const QByteArray &property) | |||
51 | { | 51 | { |
52 | auto indexer = [this, property](const QByteArray &identifier, const QVariant &value, Sink::Storage::Transaction &transaction) { | 52 | auto indexer = [this, property](const QByteArray &identifier, const QVariant &value, Sink::Storage::Transaction &transaction) { |
53 | // Trace() << "Indexing " << mType + ".index." + property << value.toByteArray(); | 53 | // Trace() << "Indexing " << mType + ".index." + property << value.toByteArray(); |
54 | if (value.isValid()) { | 54 | if (value.isValid() && !value.toByteArray().isEmpty()) { |
55 | Index(mType + ".index." + property, transaction).add(value.toByteArray(), identifier); | 55 | Index(mType + ".index." + property, transaction).add(value.toByteArray(), identifier); |
56 | } else { | 56 | } else { |
57 | Index(mType + ".index." + property, transaction).add("toplevel", identifier); | 57 | Index(mType + ".index." + property, transaction).add("toplevel", identifier); |