From 925d3bd3159820c0eae356fe4d3af54cb16ae1e3 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 14 Dec 2014 12:03:59 +0100 Subject: put unqlite db's in their own subdir to avoid name collisions --- common/storage_unqlite.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/storage_unqlite.cpp b/common/storage_unqlite.cpp index 5c5ef09..f94643f 100644 --- a/common/storage_unqlite.cpp +++ b/common/storage_unqlite.cpp @@ -11,6 +11,8 @@ #include "unqlite/unqlite.h" +static const char *s_unqliteDir = "/unqlite/"; + class Storage::Private { public: @@ -36,9 +38,9 @@ Storage::Private::Private(const QString &s, const QString &n, AccessMode m) db(0), inTransaction(false) { - const QString fullPath(storageRoot + '/' + name); + const QString fullPath(storageRoot + s_unqliteDir + name); QDir dir; - dir.mkdir(storageRoot); + dir.mkdir(storageRoot + s_unqliteDir); //create file int openFlags = UNQLITE_OPEN_CREATE; @@ -276,12 +278,12 @@ void Storage::scan(const char *keyData, uint keySize, qint64 Storage::diskUsage() const { - QFileInfo info(d->storageRoot + '/' + d->name); + QFileInfo info(d->storageRoot + s_unqliteDir + d->name); return info.size(); } void Storage::removeFromDisk() const { - QFile::remove(d->storageRoot + '/' + d->name); + QFile::remove(d->storageRoot + s_unqliteDir + d->name); } -- cgit v1.2.3