diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-21 21:28:23 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-15 16:14:19 +0200 |
commit | 9a9bb39f7641a818434cafa0dae0c8aa47124c0b (patch) | |
tree | 3da0b8642fb73f1fe8762291a7b3a8ed171444d6 /common/remoteidmap.cpp | |
parent | 07d9eaaa97dfa63bb3ff9767c6b2e152ad8a04e0 (diff) | |
download | sink-9a9bb39f7641a818434cafa0dae0c8aa47124c0b.tar.gz sink-9a9bb39f7641a818434cafa0dae0c8aa47124c0b.zip |
Incremental fetch of mails
Diffstat (limited to 'common/remoteidmap.cpp')
-rw-r--r-- | common/remoteidmap.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common/remoteidmap.cpp b/common/remoteidmap.cpp index 20a054d..2c3e5c7 100644 --- a/common/remoteidmap.cpp +++ b/common/remoteidmap.cpp | |||
@@ -75,3 +75,20 @@ QByteArray RemoteIdMap::resolveLocalId(const QByteArray &bufferType, const QByte | |||
75 | return remoteId; | 75 | return remoteId; |
76 | } | 76 | } |
77 | 77 | ||
78 | QByteArray RemoteIdMap::readValue(const QByteArray &key) | ||
79 | { | ||
80 | QByteArray value; | ||
81 | mTransaction.openDatabase("values").scan(key, [&value](const QByteArray &, const QByteArray &v) { | ||
82 | value = v; | ||
83 | return false; | ||
84 | }, [](const Sink::Storage::Error &) { | ||
85 | //Ignore errors because we may not find the value | ||
86 | }); | ||
87 | return value; | ||
88 | } | ||
89 | |||
90 | void RemoteIdMap::writeValue(const QByteArray &key, const QByteArray &value) | ||
91 | { | ||
92 | mTransaction.openDatabase("values").write(key, value); | ||
93 | } | ||
94 | |||