From c55e9e7e3cb38b07d1dd934ea68c1e97e660a517 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 4 Dec 2014 23:14:53 +0100 Subject: Ignore the name for now, and directly use the storageRoot --- store/database.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'store') diff --git a/store/database.cpp b/store/database.cpp index c58379c..0c4fd18 100644 --- a/store/database.cpp +++ b/store/database.cpp @@ -40,7 +40,7 @@ Database::Private::Private(const QString &s, const QString &n) if (mdb_env_create(&env)) { // TODO: handle error } else { - int rc = mdb_env_open(env, (storageRoot+name).toStdString().data(), 0, 0664); + int rc = mdb_env_open(env, storageRoot.toStdString().data(), 0, 0664); if (rc) { std::cerr << "mdb_env_open: " << rc << " " << mdb_strerror(rc) << std::endl; @@ -260,14 +260,13 @@ void Database::read(const std::string &sKey, const std::functionstorageRoot+d->name); + QFileInfo info(d->storageRoot + "/data.mdb"); return info.size(); } void Database::removeFromDisk() const { - QFileInfo info(d->storageRoot+d->name); - QDir dir = info.dir(); + QDir dir(d->storageRoot); dir.remove("data.mdb"); dir.remove("lock.mdb"); } -- cgit v1.2.3