summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/storage.h2
-rw-r--r--common/storage_common.cpp2
-rw-r--r--common/storage_lmdb.cpp4
3 files changed, 4 insertions, 4 deletions
diff --git a/common/storage.h b/common/storage.h
index 78faac0..09365b0 100644
--- a/common/storage.h
+++ b/common/storage.h
@@ -98,7 +98,7 @@ public:
98 * Set the default error handler. 98 * Set the default error handler.
99 */ 99 */
100 void setDefaultErrorHandler(const std::function<void(const Storage::Error &error)> &errorHandler); 100 void setDefaultErrorHandler(const std::function<void(const Storage::Error &error)> &errorHandler);
101 std::function<void(const Storage::Error &error)> defaultErrorHandler(); 101 std::function<void(const Storage::Error &error)> defaultErrorHandler() const;
102 102
103 /** 103 /**
104 * A basic error handler that writes to std::cerr. 104 * A basic error handler that writes to std::cerr.
diff --git a/common/storage_common.cpp b/common/storage_common.cpp
index 5728096..65f6e57 100644
--- a/common/storage_common.cpp
+++ b/common/storage_common.cpp
@@ -46,7 +46,7 @@ void Storage::setDefaultErrorHandler(const std::function<void(const Storage::Err
46 mErrorHandler = errorHandler; 46 mErrorHandler = errorHandler;
47} 47}
48 48
49std::function<void(const Storage::Error &error)> Storage::defaultErrorHandler() 49std::function<void(const Storage::Error &error)> Storage::defaultErrorHandler() const
50{ 50{
51 if (mErrorHandler) { 51 if (mErrorHandler) {
52 return mErrorHandler; 52 return mErrorHandler;
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp
index 4fcb11f..7bbf8b5 100644
--- a/common/storage_lmdb.cpp
+++ b/common/storage_lmdb.cpp
@@ -425,11 +425,11 @@ qint64 Storage::diskUsage() const
425void Storage::removeFromDisk() const 425void Storage::removeFromDisk() const
426{ 426{
427 const QString fullPath(d->storageRoot + '/' + d->name); 427 const QString fullPath(d->storageRoot + '/' + d->name);
428 qDebug() << "removing " << fullPath;
429 QMutexLocker locker(&d->sMutex); 428 QMutexLocker locker(&d->sMutex);
430 QDir dir(fullPath); 429 QDir dir(fullPath);
431 if (!dir.removeRecursively()) { 430 if (!dir.removeRecursively()) {
432 qWarning() << "Failed to remove directory" << d->storageRoot << d->name; 431 Error error(d->name.toLatin1(), ErrorCodes::GenericError, QString("Failed to remove directory %1 %2").arg(d->storageRoot).arg(d->name).toLatin1());
432 defaultErrorHandler()(error);
433 } 433 }
434 auto env = d->sEnvironments.take(fullPath); 434 auto env = d->sEnvironments.take(fullPath);
435 mdb_env_close(env); 435 mdb_env_close(env);