diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/storage_lmdb.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index 283205f..8e9b05c 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -28,11 +28,11 @@ public: | |||
28 | }; | 28 | }; |
29 | 29 | ||
30 | Storage::Private::Private(const QString &s, const QString &n) | 30 | Storage::Private::Private(const QString &s, const QString &n) |
31 | : transaction(0), | 31 | : storageRoot(s), |
32 | name(n), | ||
33 | transaction(0), | ||
32 | readTransaction(false), | 34 | readTransaction(false), |
33 | firstOpen(true), | 35 | firstOpen(true) |
34 | storageRoot(s), | ||
35 | name(n) | ||
36 | { | 36 | { |
37 | QDir dir; | 37 | QDir dir; |
38 | dir.mkdir(storageRoot); | 38 | dir.mkdir(storageRoot); |
@@ -148,7 +148,7 @@ void Storage::abortTransaction() | |||
148 | 148 | ||
149 | bool Storage::write(const char *key, size_t keySize, const char *value, size_t valueSize) | 149 | bool Storage::write(const char *key, size_t keySize, const char *value, size_t valueSize) |
150 | { | 150 | { |
151 | write(std::string(key, keySize), std::string(value, valueSize)); | 151 | return write(std::string(key, keySize), std::string(value, valueSize)); |
152 | } | 152 | } |
153 | 153 | ||
154 | bool Storage::write(const std::string &sKey, const std::string &sValue) | 154 | bool Storage::write(const std::string &sKey, const std::string &sValue) |
@@ -269,13 +269,6 @@ qint64 Storage::diskUsage() const | |||
269 | 269 | ||
270 | void Storage::removeFromDisk() const | 270 | void Storage::removeFromDisk() const |
271 | { | 271 | { |
272 | QDir dir(d->path); | ||
273 | dir.remove("data.mdb"); | ||
274 | dir.remove("lock.mdb"); | ||
275 | } | ||
276 | |||
277 | void Storage::removeFromDisk() const | ||
278 | { | ||
279 | QDir dir(d->storageRoot); | 272 | QDir dir(d->storageRoot); |
280 | dir.remove("data.mdb"); | 273 | dir.remove("data.mdb"); |
281 | dir.remove("lock.mdb"); | 274 | dir.remove("lock.mdb"); |