diff options
author | Jamey Hicks <jamey.hicks@nokia.com> | 2012-06-07 13:14:28 -0400 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-07 22:07:32 +0200 |
commit | eb129a8c2cc211767adaffbe0f0c9d7158119c85 (patch) | |
tree | 8aadd6640af32659eb4c6405de5daac335d6985d /src | |
parent | 7dc8267d3e21d4489deb2fe2006ddaa691f1d753 (diff) |
Added JsonDbSettings::debugIndexes()
Change-Id: Ic6a7293a8b0b87577e55923dcf586dd989edec32
Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/partition/jsondbindex.cpp | 8 | ||||
-rw-r--r-- | src/partition/jsondbsettings.cpp | 1 | ||||
-rw-r--r-- | src/partition/jsondbsettings.h | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/partition/jsondbindex.cpp b/src/partition/jsondbindex.cpp index 8a5e343..e98cd14 100644 --- a/src/partition/jsondbindex.cpp +++ b/src/partition/jsondbindex.cpp @@ -411,8 +411,8 @@ bool JsonDbIndex::indexObject(JsonDbObject &object, quint32 objectStateNumber) QByteArray forwardKey = JsonDbIndexPrivate::makeForwardKey(fieldValue, objectKey); QByteArray forwardValue = JsonDbIndexPrivate::makeForwardValue(objectKey); - if (jsondbSettings->debug()) - qDebug() << "indexing" << objectKey << d->mSpec.propertyName << fieldValue + if (jsondbSettings->debugIndexes()) + qDebug() << "indexing" << objectKey.toString() << d->mSpec.propertyName << fieldValue << "forwardIndex" << "key" << forwardKey.toHex() << "forwardIndex" << "value" << forwardValue.toHex() << object; @@ -453,8 +453,8 @@ bool JsonDbIndex::deindexObject(JsonDbObject &object, quint32 objectStateNumber) if (fieldValue.isUndefined()) continue; d->truncateFieldValue(&fieldValue, d->mSpec.propertyType); - if (jsondbSettings->debug()) - qDebug() << "deindexing" << objectKey << d->mSpec.propertyName << fieldValue; + if (jsondbSettings->debugIndexes()) + qDebug() << "deindexing" << objectKey.toString() << d->mSpec.propertyName << fieldValue; QByteArray forwardKey = JsonDbIndexPrivate::makeForwardKey(fieldValue, objectKey); if (!txn->remove(forwardKey)) { qCritical() << d->mSpec.name << "deindexing failed" << d->mBdb.errorMessage(); diff --git a/src/partition/jsondbsettings.cpp b/src/partition/jsondbsettings.cpp index 0d89112..38b969b 100644 --- a/src/partition/jsondbsettings.cpp +++ b/src/partition/jsondbsettings.cpp @@ -54,6 +54,7 @@ Q_GLOBAL_STATIC(JsonDbSettings, staticInstance) JsonDbSettings::JsonDbSettings() : mRejectStaleUpdates(false) , mDebug(false) + , mDebugIndexes(false) , mVerbose(false) , mVerboseErrors(false) , mPerformanceLog(false) diff --git a/src/partition/jsondbsettings.h b/src/partition/jsondbsettings.h index dd3660f..22ccef9 100644 --- a/src/partition/jsondbsettings.h +++ b/src/partition/jsondbsettings.h @@ -58,6 +58,7 @@ class Q_JSONDB_PARTITION_EXPORT JsonDbSettings : public QObject Q_OBJECT Q_PROPERTY(bool rejectStaleUpdates READ rejectStaleUpdates WRITE setRejectStaleUpdates) Q_PROPERTY(bool debug READ debug WRITE setDebug) + Q_PROPERTY(bool debugIndexes READ debugIndexes WRITE setDebugIndexes) Q_PROPERTY(bool verbose READ verbose WRITE setVerbose) Q_PROPERTY(bool verboseErrors READ verboseErrors WRITE setVerboseErrors) Q_PROPERTY(bool performanceLog READ performanceLog WRITE setPerformanceLog) @@ -88,6 +89,9 @@ public: inline bool debug() const { return mDebug; } inline void setDebug(bool debug) { mDebug = debug; } + inline bool debugIndexes() const { return mDebugIndexes; } + inline void setDebugIndexes(bool debugIndexes) { mDebugIndexes = debugIndexes; } + inline bool verbose() const { return mVerbose; } inline void setVerbose(bool verbose) { mVerbose = verbose; } @@ -150,6 +154,7 @@ private: bool mRejectStaleUpdates; bool mDebug; + bool mDebugIndexes; bool mVerbose; bool mVerboseErrors; bool mPerformanceLog; |