summaryrefslogtreecommitdiffstats
path: root/common/typeindex.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-19 20:14:54 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-19 20:14:54 +0200
commitea4d0708e63b7dc7ee0b1cb150f1e09da1f52046 (patch)
treecde644a4f18f2a27b9a3d511a40c792147be9a2f /common/typeindex.cpp
parent8f06f8a31682760b385ba740db28429d7914730a (diff)
downloadsink-ea4d0708e63b7dc7ee0b1cb150f1e09da1f52046.tar.gz
sink-ea4d0708e63b7dc7ee0b1cb150f1e09da1f52046.zip
Don't try to remove empty values from the index.
Indexes don't allow empty keys, so this will always fail.
Diffstat (limited to 'common/typeindex.cpp')
-rw-r--r--common/typeindex.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp
index fca083c..8d1b7f3 100644
--- a/common/typeindex.cpp
+++ b/common/typeindex.cpp
@@ -124,7 +124,10 @@ void TypeIndex::remove(const QByteArray &identifier, const Sink::ApplicationDoma
124 for (const auto &property : mProperties) { 124 for (const auto &property : mProperties) {
125 const auto value = bufferAdaptor.getProperty(property); 125 const auto value = bufferAdaptor.getProperty(property);
126 // FIXME don't always convert to byte array 126 // FIXME don't always convert to byte array
127 Index(indexName(property), transaction).remove(getByteArray(value), identifier); 127 const auto data = getByteArray(value);
128 if (data.isEmpty()) {
129 Index(indexName(property), transaction).remove(data, identifier);
130 }
128 } 131 }
129 for (auto it = mSortedProperties.constBegin(); it != mSortedProperties.constEnd(); it++) { 132 for (auto it = mSortedProperties.constBegin(); it != mSortedProperties.constEnd(); it++) {
130 const auto propertyValue = bufferAdaptor.getProperty(it.key()); 133 const auto propertyValue = bufferAdaptor.getProperty(it.key());