summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/indexupdater.h8
-rw-r--r--common/typeindex.cpp5
2 files changed, 10 insertions, 3 deletions
diff --git a/common/indexupdater.h b/common/indexupdater.h
index 936d03a..79499c3 100644
--- a/common/indexupdater.h
+++ b/common/indexupdater.h
@@ -55,8 +55,12 @@ private:
55 55
56 void remove(const QVariant &value, const QByteArray &uid, Sink::Storage::Transaction &transaction) 56 void remove(const QVariant &value, const QByteArray &uid, Sink::Storage::Transaction &transaction)
57 { 57 {
58 // TODO hide notfound error 58 if (value.isValid()) {
59 Index(mIndexIdentifier, transaction).remove(value.toByteArray(), uid); 59 const auto data = value.toByteArray();
60 if (!data.isEmpty()) {
61 Index(mIndexIdentifier, transaction).remove(data, uid);
62 }
63 }
60 } 64 }
61 65
62 QByteArray mIndexIdentifier; 66 QByteArray mIndexIdentifier;
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());