diff options
Diffstat (limited to 'common/synchronizerstore.cpp')
-rw-r--r-- | common/synchronizerstore.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/synchronizerstore.cpp b/common/synchronizerstore.cpp index 0d1e154..2bd54f2 100644 --- a/common/synchronizerstore.cpp +++ b/common/synchronizerstore.cpp | |||
@@ -49,7 +49,7 @@ void SynchronizerStore::updateRemoteId(const QByteArray &bufferType, const QByte | |||
49 | recordRemoteId(bufferType, localId, remoteId); | 49 | recordRemoteId(bufferType, localId, remoteId); |
50 | } | 50 | } |
51 | 51 | ||
52 | QByteArray SynchronizerStore::resolveRemoteId(const QByteArray &bufferType, const QByteArray &remoteId) | 52 | QByteArray SynchronizerStore::resolveRemoteId(const QByteArray &bufferType, const QByteArray &remoteId, bool insertIfMissing) |
53 | { | 53 | { |
54 | if (remoteId.isEmpty()) { | 54 | if (remoteId.isEmpty()) { |
55 | SinkWarning() << "Cannot resolve empty remote id for type: " << bufferType; | 55 | SinkWarning() << "Cannot resolve empty remote id for type: " << bufferType; |
@@ -58,7 +58,7 @@ QByteArray SynchronizerStore::resolveRemoteId(const QByteArray &bufferType, cons | |||
58 | // Lookup local id for remote id, or insert a new pair otherwise | 58 | // Lookup local id for remote id, or insert a new pair otherwise |
59 | Index index("rid.mapping." + bufferType, mTransaction); | 59 | Index index("rid.mapping." + bufferType, mTransaction); |
60 | QByteArray sinkId = index.lookup(remoteId); | 60 | QByteArray sinkId = index.lookup(remoteId); |
61 | if (sinkId.isEmpty()) { | 61 | if (sinkId.isEmpty() && insertIfMissing) { |
62 | sinkId = Sink::Storage::DataStore::generateUid(); | 62 | sinkId = Sink::Storage::DataStore::generateUid(); |
63 | index.add(remoteId, sinkId); | 63 | index.add(remoteId, sinkId); |
64 | Index("localid.mapping." + bufferType, mTransaction).add(sinkId, remoteId); | 64 | Index("localid.mapping." + bufferType, mTransaction).add(sinkId, remoteId); |