d16f0fd6db61 — Chris Cannam 10 years ago
Rename DEBUG to DQ_DEBUG (as DEBUG is often used as a flag). Also fix some warnings.
M src/Debug.h +2 -2
@@ 40,7 40,7 @@ 
 
 #include <QDebug>
 
-#define DEBUG QDebug(QtDebugMsg) << "[dataquay] "
+#define DQ_DEBUG QDebug(QtDebugMsg) << "[dataquay] "
 
 namespace Dataquay {
 

          
@@ 73,7 73,7 @@ public:
 
 }
 
-#define DEBUG ::Dataquay::NoDebug()
+#define DQ_DEBUG ::Dataquay::NoDebug()
 
 #endif /* !NDEBUG */
 

          
M src/Node.cpp +2 -1
@@ 261,7 261,7 @@ Node::getVariantTypeName(Uri datatype)
 Node
 Node::fromVariant(const QVariant &v)
 {
-    DEBUG << "Node::fromVariant: QVariant type is " << v.userType()
+    DQ_DEBUG << "Node::fromVariant: QVariant type is " << v.userType()
           << " (" << int(v.userType()) << "), variant is " << v << endl;
 
     if (Uri::hasUriType(v)) {

          
@@ 470,6 470,7 @@ qHash(const Dataquay::Node &n)
         return qHash(n.value + n.datatype.toString());
     case Dataquay::Node::Blank:
         return qHash(n.value);
+    case Dataquay::Node::Nothing:
     default:
         return qHash("");
     }

          
M src/RDFException.cpp +1 -1
@@ 105,7 105,7 @@ RDFException::setMessage(QString m)
 {
     if (m_message) free(m_message);
     m_message = strdup(m.toLocal8Bit().data());
-    DEBUG << "RDFException: " << m_message << endl;
+    DQ_DEBUG << "RDFException: " << m_message << endl;
 }
 
 }

          
M src/TransactionalStore.cpp +13 -13
@@ 79,7 79,7 @@ public:
 
     Transaction *startTransaction() {
         QMutexLocker locker(&m_mutex);
-        DEBUG << "TransactionalStore::startTransaction" << endl;
+        DQ_DEBUG << "TransactionalStore::startTransaction" << endl;
         if (m_currentTx != NoTransaction) {
             throw RDFTransactionError("ERROR: Attempt to start transaction when another transaction from the same thread is already in train");
         }

          
@@ 92,7 92,7 @@ public:
         ChangeSet cs;
         {
             QMutexLocker locker(&m_mutex);
-            DEBUG << "TransactionalStore::commitTransaction" << endl;
+            DQ_DEBUG << "TransactionalStore::commitTransaction" << endl;
             if (tx != m_currentTx) {
                 throw RDFInternalError("Transaction integrity error");
             }

          
@@ 106,15 106,15 @@ public:
             m_currentTx = NoTransaction;
             m_context = NonTxContext;
         }
-        DEBUG << "TransactionalStore::commitTransaction: committed " << cs.size() << " change(s)" << endl;
+        DQ_DEBUG << "TransactionalStore::commitTransaction: committed " << cs.size() << " change(s)" << endl;
         m_ts->transactionCommitted(cs);
         m_ts->transactionCommitted();
-        DEBUG << "TransactionalStore::commitTransaction complete" << endl;
+        DQ_DEBUG << "TransactionalStore::commitTransaction complete" << endl;
     }
 
     void rollbackTransaction(Transaction *tx) {
         QMutexLocker locker(&m_mutex);
-        DEBUG << "TransactionalStore::rollbackTransaction" << endl;
+        DQ_DEBUG << "TransactionalStore::rollbackTransaction" << endl;
         if (tx != m_currentTx) {
             throw RDFInternalError("Transaction integrity error");
         }

          
@@ 122,7 122,7 @@ public:
         // The store is now in non-transaction context, which means
         // the transaction's changes are uncommitted
         m_currentTx = NoTransaction;
-        DEBUG << "TransactionalStore::rollbackTransaction complete" << endl;
+        DQ_DEBUG << "TransactionalStore::rollbackTransaction complete" << endl;
     }
 
     class Operation

          
@@ 233,8 233,8 @@ public:
         // Hence, it needs to take a lock and hold it until
         // endNonTransactionalAccess is called
         m_mutex.lock();
-        DEBUG << "TransactionalStore::startNonTransactionalAccess" << endl;
-        if (m_context == NonTxContext) DEBUG << "(note: already in non-tx context)" << endl;
+        DQ_DEBUG << "TransactionalStore::startNonTransactionalAccess" << endl;
+        if (m_context == NonTxContext) DQ_DEBUG << "(note: already in non-tx context)" << endl;
         leaveTransactionContext();
         // return with mutex held
     }

          
@@ 244,7 244,7 @@ public:
         // access checks this via enterTransactionContext before doing
         // any work; this way is quicker if we may have multiple
         // non-transactional reads happening together.
-        DEBUG << "TransactionalStore::endNonTransactionalAccess" << endl;
+        DQ_DEBUG << "TransactionalStore::endNonTransactionalAccess" << endl;
         m_mutex.unlock();
     }
 

          
@@ 294,7 294,7 @@ private:
         }
         ChangeSet cs = m_currentTx->getChanges();
         if (!cs.empty()) {
-            DEBUG << "TransactionalStore::enterTransactionContext: replaying" << endl;
+            DQ_DEBUG << "TransactionalStore::enterTransactionContext: replaying" << endl;
             try {
                 m_store->change(cs);
             } catch (RDFException &e) {

          
@@ 349,7 349,7 @@ public:
 
     void abandon() const {
         if (m_abandoned || m_committed) return;
-        DEBUG << "TransactionalStore::TSTransaction::abandon: Auto-rollback triggered by exception" << endl;
+        DQ_DEBUG << "TransactionalStore::TSTransaction::abandon: Auto-rollback triggered by exception" << endl;
         m_td->rollbackTransaction(m_tx);
         m_abandoned = true;
     }

          
@@ 577,14 577,14 @@ public:
 
     void commit() {
         check();
-        DEBUG << "TransactionalStore::TSTransaction::commit: Committing" << endl;
+        DQ_DEBUG << "TransactionalStore::TSTransaction::commit: Committing" << endl;
         m_td->commitTransaction(m_tx);
         m_committed = true;
     }
 
     void rollback() {
         check();
-        DEBUG << "TransactionalStore::TSTransaction::rollback: Abandoning" << endl;
+        DQ_DEBUG << "TransactionalStore::TSTransaction::rollback: Abandoning" << endl;
         m_td->rollbackTransaction(m_tx);
         m_abandoned = true;
     }

          
M src/Uri.cpp +2 -2
@@ 71,7 71,7 @@ private:
     int type;
 
     UriRegistrar() : name("Dataquay::Uri") {
-        DEBUG << "UriRegistrar: registering Dataquay::Uri" << endl;
+        DQ_DEBUG << "UriRegistrar: registering Dataquay::Uri" << endl;
         QByteArray bname = name.toLatin1();
         type = qRegisterMetaType<Uri>(bname.data());
         qRegisterMetaTypeStreamOperators<Uri>(bname.data());

          
@@ 89,7 89,7 @@ Uri::metaTypeId()
 {
     int t = UriRegistrar::instance()->getType();
     if (t <= 0) {
-	DEBUG << "Uri::metaTypeId: No meta type available -- did static registration fail?" << endl;
+	DQ_DEBUG << "Uri::metaTypeId: No meta type available -- did static registration fail?" << endl;
 	return 0;
     }
     return t;

          
M src/backend/BasicStoreRedland.cpp +29 -29
@@ 108,12 108,12 @@ public:
 
     void clear() {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::clear" << endl;
+        DQ_DEBUG << "BasicStore::clear" << endl;
         if (m_model) librdf_free_model(m_model);
         if (m_storage) librdf_free_storage(m_storage);
         m_storage = librdf_new_storage(m_w.getWorld(), "trees", 0, 0);
         if (!m_storage) {
-            DEBUG << "Failed to create RDF trees storage, falling back to default storage type" << endl;
+            DQ_DEBUG << "Failed to create RDF trees storage, falling back to default storage type" << endl;
             m_storage = librdf_new_storage(m_w.getWorld(), 0, 0, 0);
             if (!m_storage) throw RDFInternalError("Failed to create RDF data storage");
         }

          
@@ 128,22 128,22 @@ public:
 
     bool add(Triple t) {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::add: " << t << endl;
+        DQ_DEBUG << "BasicStore::add: " << t << endl;
         return doAdd(t);
     }
 
     bool remove(Triple t) {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::remove: " << t << endl;
+        DQ_DEBUG << "BasicStore::remove: " << t << endl;
         if (t.a.type == Node::Nothing || 
             t.b.type == Node::Nothing ||
             t.c.type == Node::Nothing) {
             Triples tt = doMatch(t);
             if (tt.empty()) return false;
-            DEBUG << "BasicStore::remove: Removing " << tt.size() << " triple(s)" << endl;
+            DQ_DEBUG << "BasicStore::remove: Removing " << tt.size() << " triple(s)" << endl;
             for (int i = 0; i < tt.size(); ++i) {
                 if (!doRemove(tt[i])) {
-                    DEBUG << "Failed to remove matched triple in remove() with wildcards; triple was: " << tt[i] << endl;
+                    DQ_DEBUG << "Failed to remove matched triple in remove() with wildcards; triple was: " << tt[i] << endl;
                     throw RDFInternalError("Failed to remove matched statement in remove() with wildcards");
                 }
             }

          
@@ 155,7 155,7 @@ public:
 
     void change(ChangeSet cs) {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::change: " << cs.size() << " changes" << endl;
+        DQ_DEBUG << "BasicStore::change: " << cs.size() << " changes" << endl;
         for (int i = 0; i < cs.size(); ++i) {
             ChangeType type = cs[i].first;
             Triple triple = cs[i].second;

          
@@ 176,7 176,7 @@ public:
 
     void revert(ChangeSet cs) {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::revert: " << cs.size() << " changes" << endl;
+        DQ_DEBUG << "BasicStore::revert: " << cs.size() << " changes" << endl;
         for (int i = cs.size()-1; i >= 0; --i) {
             ChangeType type = cs[i].first;
             Triple triple = cs[i].second;

          
@@ 197,7 197,7 @@ public:
 
     bool contains(Triple t) const {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::contains: " << t << endl;
+        DQ_DEBUG << "BasicStore::contains: " << t << endl;
         librdf_statement *statement = tripleToStatement(t);
         if (!checkComplete(statement)) {
             librdf_free_statement(statement);

          
@@ 214,12 214,12 @@ public:
     
     Triples match(Triple t) const {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::match: " << t << endl;
+        DQ_DEBUG << "BasicStore::match: " << t << endl;
         Triples result = doMatch(t);
 #ifndef NDEBUG
-        DEBUG << "BasicStore::match result (size " << result.size() << "):" << endl;
+        DQ_DEBUG << "BasicStore::match result (size " << result.size() << "):" << endl;
         for (int i = 0; i < result.size(); ++i) {
-            DEBUG << i << ". " << result[i] << endl;
+            DQ_DEBUG << i << ". " << result[i] << endl;
         }
 #endif
         return result;

          
@@ 234,7 234,7 @@ public:
             throw RDFException("Cannot complete triple unless it has only a single wildcard node", t);
         }
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::complete: " << t << endl;
+        DQ_DEBUG << "BasicStore::complete: " << t << endl;
         Triples result = doMatch(t, true);
         if (result.empty()) return Node();
         else switch (match) {

          
@@ 252,12 252,12 @@ public:
             else return Triple();
         }
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::matchOnce: " << t << endl;
+        DQ_DEBUG << "BasicStore::matchOnce: " << t << endl;
         Triples result = doMatch(t, true);
 #ifndef NDEBUG
-        DEBUG << "BasicStore::matchOnce result:" << endl;
+        DQ_DEBUG << "BasicStore::matchOnce result:" << endl;
         for (int i = 0; i < result.size(); ++i) {
-            DEBUG << i << ". " << result[i] << endl;
+            DQ_DEBUG << i << ". " << result[i] << endl;
         }
 #endif
         if (result.empty()) return Triple();

          
@@ 266,14 266,14 @@ public:
 
     ResultSet query(QString sparql) const {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::query: " << sparql << endl;
+        DQ_DEBUG << "BasicStore::query: " << sparql << endl;
         ResultSet rs = runQuery(sparql);
         return rs;
     }
 
     Node queryOnce(QString sparql, QString bindingName) const {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::queryOnce: " << bindingName << " from " << sparql << endl;
+        DQ_DEBUG << "BasicStore::queryOnce: " << bindingName << " from " << sparql << endl;
         ResultSet rs = runQuery(sparql);
         if (rs.empty()) return Node();
         for (ResultSet::const_iterator i = rs.begin(); i != rs.end(); ++i) {

          
@@ 287,7 287,7 @@ public:
 
     Uri getUniqueUri(QString prefix) const {
         QMutexLocker locker(&m_librdfLock);
-        DEBUG << "BasicStore::getUniqueUri: prefix " << prefix << endl;
+        DQ_DEBUG << "BasicStore::getUniqueUri: prefix " << prefix << endl;
         int base = (int)(long)this; // we don't care at all about overflow
         bool good = false;
         Uri uri;

          
@@ 356,7 356,7 @@ public:
         QMutexLocker wlocker(&m_librdfLock);
         QMutexLocker plocker(&m_prefixLock);
 
-        DEBUG << "BasicStore::save(" << filename << ")" << endl;
+        DQ_DEBUG << "BasicStore::save(" << filename << ")" << endl;
 
         librdf_uri *base_uri = uriToLrdfUri(m_baseUri);
         librdf_serializer *s = librdf_new_serializer(m_w.getWorld(), "turtle", 0, 0);

          
@@ 395,7 395,7 @@ public:
 
         if (!QFile::remove(filename)) {
             // Not necessarily fatal
-            DEBUG << "BasicStore::save: Failed to remove former save file "
+            DQ_DEBUG << "BasicStore::save: Failed to remove former save file "
                   << filename << endl;
         }
         if (!QFile::rename(tmpFilename, filename)) {

          
@@ 439,8 439,8 @@ public:
             if (librdf_parser_parse_into_model
                 (parser, luri, base_uri, m_model)) {
                 librdf_free_parser(parser);
-                DEBUG << "librdf_parser_parse_into_model failed" << endl;
-                DEBUG << "luri = " << (const char *)librdf_uri_as_string(luri) << ", base_uri = " << (const char *)librdf_uri_as_string(base_uri) << endl;
+                DQ_DEBUG << "librdf_parser_parse_into_model failed" << endl;
+                DQ_DEBUG << "luri = " << (const char *)librdf_uri_as_string(luri) << ", base_uri = " << (const char *)librdf_uri_as_string(base_uri) << endl;
                 throw RDFException("Failed to import model from URL",
                                    url.toString());
             }

          
@@ 473,8 473,8 @@ public:
                 //!!! This appears to be returning success even on a
                 //!!! syntax error -- can this be correct?
                 if (librdf_parser_parse_into_model(parser, luri, base_uri, im)) {
-                    DEBUG << "librdf_parser_parse_into_model failed" << endl;
-                    DEBUG << "luri = " << (const char *)librdf_uri_as_string(luri) << ", base_uri = " << (const char *)librdf_uri_as_string(base_uri) << endl;
+                    DQ_DEBUG << "librdf_parser_parse_into_model failed" << endl;
+                    DQ_DEBUG << "luri = " << (const char *)librdf_uri_as_string(luri) << ", base_uri = " << (const char *)librdf_uri_as_string(base_uri) << endl;
                     throw RDFException("Failed to import model from URL",
                                        url.toString());
                 }

          
@@ 530,7 530,7 @@ public:
         }
 
         int namespaces = librdf_parser_get_namespaces_seen_count(parser);
-        DEBUG << "Parser found " << namespaces << " namespaces" << endl;
+        DQ_DEBUG << "Parser found " << namespaces << " namespaces" << endl;
         for (int i = 0; i < namespaces; ++i) {
             const char *pfx = librdf_parser_get_namespaces_seen_prefix(parser, i);
             librdf_uri *uri = librdf_parser_get_namespaces_seen_uri(parser, i);

          
@@ 541,7 541,7 @@ public:
             } catch (RDFIncompleteURI &) {
                 continue;
             }
-            DEBUG << "namespace " << i << ": " << qpfx << " -> " << quri << endl;
+            DQ_DEBUG << "namespace " << i << ": " << qpfx << " -> " << quri << endl;
             // don't call addPrefix; it tries to lock the mutex,
             // and anyway we want to add the prefix only if it
             // isn't already there (to avoid surprisingly changing

          
@@ 569,7 569,7 @@ private:
         ~World() {
             QMutexLocker locker(&m_mutex);
             if (--m_refcount == 0) {
-                DEBUG << "Freeing world" << endl;
+                DQ_DEBUG << "Freeing world" << endl;
                 librdf_free_world(m_world);
                 m_world = 0;
             }

          
@@ 819,7 819,7 @@ private:
         librdf_free_query_results(results);
         librdf_free_query(query);
 
-//        DEBUG << "runQuery: returning " << returned.size() << " result(s)" << endl;
+//        DQ_DEBUG << "runQuery: returning " << returned.size() << " result(s)" << endl;
         
         return returned;
     }

          
M src/backend/BasicStoreSord.cpp +24 -24
@@ 108,7 108,7 @@ public:
 
     void clear() {
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::clear" << endl;
+        DQ_DEBUG << "BasicStore::clear" << endl;
         if (m_model) sord_free(m_model);
         // Sord can only perform wildcard matches if at least one of
         // the non-wildcard nodes in the matched triple is the primary

          
@@ 124,22 124,22 @@ public:
 
     bool add(Triple t) {
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::add: " << t << endl;
+        DQ_DEBUG << "BasicStore::add: " << t << endl;
         return doAdd(t);
     }
 
     bool remove(Triple t) {
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::remove: " << t << endl;
+        DQ_DEBUG << "BasicStore::remove: " << t << endl;
         if (t.a.type == Node::Nothing || 
             t.b.type == Node::Nothing ||
             t.c.type == Node::Nothing) {
             Triples tt = doMatch(t);
             if (tt.empty()) return false;
-            DEBUG << "BasicStore::remove: Removing " << tt.size() << " triple(s)" << endl;
+            DQ_DEBUG << "BasicStore::remove: Removing " << tt.size() << " triple(s)" << endl;
             for (int i = 0; i < tt.size(); ++i) {
                 if (!doRemove(tt[i])) {
-                    DEBUG << "Failed to remove matched triple in remove() with wildcards; triple was: " << tt[i] << endl;
+                    DQ_DEBUG << "Failed to remove matched triple in remove() with wildcards; triple was: " << tt[i] << endl;
                     throw RDFInternalError("Failed to remove matched statement in remove() with wildcards");
                 }
             }

          
@@ 151,7 151,7 @@ public:
 
     void change(ChangeSet cs) {
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::change: " << cs.size() << " changes" << endl;
+        DQ_DEBUG << "BasicStore::change: " << cs.size() << " changes" << endl;
         for (int i = 0; i < cs.size(); ++i) {
             ChangeType type = cs[i].first;
             Triple triple = cs[i].second;

          
@@ 172,7 172,7 @@ public:
 
     void revert(ChangeSet cs) {
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::revert: " << cs.size() << " changes" << endl;
+        DQ_DEBUG << "BasicStore::revert: " << cs.size() << " changes" << endl;
         for (int i = cs.size()-1; i >= 0; --i) {
             ChangeType type = cs[i].first;
             Triple triple = cs[i].second;

          
@@ 193,7 193,7 @@ public:
 
     bool contains(Triple t) const {
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::contains: " << t << endl;
+        DQ_DEBUG << "BasicStore::contains: " << t << endl;
         SordQuad statement;
         tripleToStatement(t, statement);
         if (!checkComplete(statement)) {

          
@@ 208,12 208,12 @@ public:
     
     Triples match(Triple t) const {
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::match: " << t << endl;
+        DQ_DEBUG << "BasicStore::match: " << t << endl;
         Triples result = doMatch(t);
 #ifndef NDEBUG
-        DEBUG << "BasicStore::match result (size " << result.size() << "):" << endl;
+        DQ_DEBUG << "BasicStore::match result (size " << result.size() << "):" << endl;
         for (int i = 0; i < result.size(); ++i) {
-            DEBUG << i << ". " << result[i] << endl;
+            DQ_DEBUG << i << ". " << result[i] << endl;
         }
 #endif
         return result;

          
@@ 228,7 228,7 @@ public:
             throw RDFException("Cannot complete triple unless it has only a single wildcard node", t);
         }
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::complete: " << t << endl;
+        DQ_DEBUG << "BasicStore::complete: " << t << endl;
         Triples result = doMatch(t, true);
         if (result.empty()) return Node();
         else switch (match) {

          
@@ 246,12 246,12 @@ public:
             else return Triple();
         }
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::matchOnce: " << t << endl;
+        DQ_DEBUG << "BasicStore::matchOnce: " << t << endl;
         Triples result = doMatch(t, true);
 #ifndef NDEBUG
-        DEBUG << "BasicStore::matchOnce result:" << endl;
+        DQ_DEBUG << "BasicStore::matchOnce result:" << endl;
         for (int i = 0; i < result.size(); ++i) {
-            DEBUG << i << ". " << result[i] << endl;
+            DQ_DEBUG << i << ". " << result[i] << endl;
         }
 #endif
         if (result.empty()) return Triple();

          
@@ 264,7 264,7 @@ public:
              sparql);
     }
 
-    Node queryOnce(QString sparql, QString bindingName) const {
+    Node queryOnce(QString sparql, QString /* bindingName */) const {
         throw RDFUnsupportedError
             ("SPARQL queries are not supported with Sord backend",
              sparql);

          
@@ 272,7 272,7 @@ public:
 
     Uri getUniqueUri(QString prefix) const {
         QMutexLocker locker(&m_backendLock);
-        DEBUG << "BasicStore::getUniqueUri: prefix " << prefix << endl;
+        DQ_DEBUG << "BasicStore::getUniqueUri: prefix " << prefix << endl;
         bool good = false;
         Uri uri;
         while (!good) {

          
@@ 349,7 349,7 @@ public:
         QMutexLocker wlocker(&m_backendLock);
         QMutexLocker plocker(&m_prefixLock);
 
-        DEBUG << "BasicStore::save(" << filename << ")" << endl;
+        DQ_DEBUG << "BasicStore::save(" << filename << ")" << endl;
 
         QByteArray bb = m_baseUri.toString().toUtf8();
         SerdURI bu;

          
@@ 409,7 409,7 @@ public:
 
         if (!QFile::remove(filename)) {
             // Not necessarily fatal
-            DEBUG << "BasicStore::save: Failed to remove former save file "
+            DQ_DEBUG << "BasicStore::save: Failed to remove former save file "
                   << filename << endl;
         }
         if (!QFile::rename(tmpFilename, filename)) {

          
@@ 420,7 420,7 @@ public:
 
     void addPrefixOnImport(QString pfx, Uri uri) {
 
-        DEBUG << "namespace: " << pfx << " -> " << uri << endl;
+        DQ_DEBUG << "namespace: " << pfx << " -> " << uri << endl;
 
         // don't call addPrefix; it tries to lock the mutex,
         // and anyway we want to add the prefix only if it

          
@@ 450,9 450,9 @@ public:
         return SERD_SUCCESS;
     }
 
-    void import(QUrl url, ImportDuplicatesMode idm, QString format) {
+    void import(QUrl url, ImportDuplicatesMode idm, QString /* format */) {
 
-        DEBUG << "BasicStoreSord::import: " << url << endl;
+        DQ_DEBUG << "BasicStoreSord::import: " << url << endl;
 
         QMutexLocker wlocker(&m_backendLock);
         QMutexLocker plocker(&m_prefixLock);

          
@@ 601,9 601,9 @@ private:
         }
         ~World() {
             QMutexLocker locker(&m_mutex);
-            DEBUG << "~World: About to lower refcount from " << m_refcount << endl;
+            DQ_DEBUG << "~World: About to lower refcount from " << m_refcount << endl;
             if (--m_refcount == 0) {
-                DEBUG << "Freeing world" << endl;
+                DQ_DEBUG << "Freeing world" << endl;
                 sord_world_free(m_world);
                 m_world = 0;
             }

          
M src/objectmapper/ObjectLoader.cpp +48 -48
@@ 192,7 192,7 @@ public:
     
     void reload(Nodes nodes, NodeObjectMap &map) {
 
-        DEBUG << "reload: " << nodes << endl;
+        DQ_DEBUG << "reload: " << nodes << endl;
         
         LoadState state;
         state.requested = nodes;

          
@@ 331,7 331,7 @@ private:
                 // the start of the candidates list
 
                 if (!nodeHasTypeInStore(node)) {
-                    DEBUG << "Node " << node
+                    DQ_DEBUG << "Node " << node
                           << " has no type in store, deleting and resetting"
                           << endl;
                     delete state.map.value(node);

          
@@ 365,26 365,26 @@ private:
             }
         }
 
-        DEBUG << "ObjectLoader: collect: "
+        DQ_DEBUG << "ObjectLoader: collect: "
               << "requested = " << state.requested.size()
               << ", toAllocate = " << state.toAllocate.size()
               << ", toInitialise = " << state.toInitialise.size()
               << ", toPopulate = " << state.toPopulate.size()
               << endl;
 
-        DEBUG << "Requested:";
-        foreach (Node n, state.requested) DEBUG << n;
+        DQ_DEBUG << "Requested:";
+        foreach (Node n, state.requested) DQ_DEBUG << n;
 
-        DEBUG << "toAllocate:";
-        foreach (Node n, state.toAllocate) DEBUG << n;
+        DQ_DEBUG << "toAllocate:";
+        foreach (Node n, state.toAllocate) DQ_DEBUG << n;
 
-        DEBUG << "toInitialise:";
-        foreach (Node n, state.toInitialise) DEBUG << n;
+        DQ_DEBUG << "toInitialise:";
+        foreach (Node n, state.toInitialise) DQ_DEBUG << n;
 
-        DEBUG << "toPopulate:";
-        foreach (Node n, state.toPopulate) DEBUG << n;
+        DQ_DEBUG << "toPopulate:";
+        foreach (Node n, state.toPopulate) DQ_DEBUG << n;
 
-        DEBUG << endl;
+        DQ_DEBUG << endl;
     }
 
     bool nodeHasTypeInStore(Node node) {

          
@@ 442,7 442,7 @@ private:
         Nodes ordered = orderedSiblingsOf(children[0]);
         remaining.subtract(NodeSet::fromList(ordered));
         foreach (Node n, remaining) ordered.push_back(n);
-        DEBUG << "orderedChildrenOf: Node " << node << " has " << ordered.size()
+        DQ_DEBUG << "orderedChildrenOf: Node " << node << " has " << ordered.size()
               << " children: " << ordered << endl;
         return ordered;
     }

          
@@ 487,7 487,7 @@ private:
         }
 
         if (!nn.empty()) {
-            DEBUG << "sequenceStartingAt " << node << " has " << nn.size() << " item(s)" << endl;
+            DQ_DEBUG << "sequenceStartingAt " << node << " has " << nn.size() << " item(s)" << endl;
         }
 
         return nn;

          
@@ 495,12 495,12 @@ private:
 
     void load(LoadState &state) {
         foreach (Node node, state.toAllocate) {
-            DEBUG << "load: calling allocate(" << node << ")" << endl;
+            DQ_DEBUG << "load: calling allocate(" << node << ")" << endl;
             try {
                 allocate(state, node);
             } catch (UnknownTypeException &e) {
                 if (state.loadFlags & LoadState::IgnoreUnknownTypes) {
-                    DEBUG << "load: IgnoreUnknownTypes is set, removing object of unknown type and continuing" << endl;
+                    DQ_DEBUG << "load: IgnoreUnknownTypes is set, removing object of unknown type and continuing" << endl;
                     delete state.map.value(node);
                     state.map.insert(node, 0);
                     state.toInitialise.remove(node);

          
@@ 515,7 515,7 @@ private:
         // initialise to happen before children are added to a node --
         // this is just belt and braces
         foreach (Node node, state.toInitialise) {
-            DEBUG << "load: calling initialise(" << node << ")" << endl;
+            DQ_DEBUG << "load: calling initialise(" << node << ")" << endl;
             initialise(state, node);
         }
 

          
@@ 524,11 524,11 @@ private:
         NodeSet tp = state.toPopulate;
 
         foreach (Node node, tp) {
-            DEBUG << "load: calling populate(" << node << ")" << endl;
+            DQ_DEBUG << "load: calling populate(" << node << ")" << endl;
             populate(state, node);
         }
         foreach (Node node, tp) {
-            DEBUG << "load: calling callLoadCallbacks(" << node << ")" << endl;
+            DQ_DEBUG << "load: calling callLoadCallbacks(" << node << ")" << endl;
             callLoadCallbacks(state, node, m_finalCallbacks);
         }
     }

          
@@ 572,7 572,7 @@ private:
         QObject *o = allocateSingle(state, node, parentObject);
 
         if (state.toInitialise.contains(node)) {
-            DEBUG << "load: calling initialise(" << node << ") from allocate" << endl;
+            DQ_DEBUG << "load: calling initialise(" << node << ") from allocate" << endl;
             initialise(state, node);
         }
 

          
@@ 591,21 591,21 @@ private:
 
     QObject *allocateSingle(LoadState &state, Node node, QObject *parentObject) {
 
-        DEBUG << "allocateSingle: " << node << " (parent = " << parentObject << ")" << endl;
+        DQ_DEBUG << "allocateSingle: " << node << " (parent = " << parentObject << ")" << endl;
 
         //!!! too many of these tests, some must be redundant
         if (!state.toAllocate.contains(node)) {
-            DEBUG << "already loaded: returning existing value (" << state.map.value(node) << ")" << endl;
+            DQ_DEBUG << "already loaded: returning existing value (" << state.map.value(node) << ")" << endl;
             return state.map.value(node);
         }
 
         QObject *o = allocateObject(node, parentObject);
 
-        DEBUG << "Setting object " << o << " to map for node " << node << endl;
+        DQ_DEBUG << "Setting object " << o << " to map for node " << node << endl;
 
         QObject *old = state.map.value(node);
         if (o != old) {
-            DEBUG << "Deleting old object " << old << endl;
+            DQ_DEBUG << "Deleting old object " << old << endl;
             delete old;
         }
 

          
@@ 613,7 613,7 @@ private:
         state.toAllocate.remove(node);
 
         QObject *x = state.map.value(node);
-        DEBUG << "New value is " << x << endl;
+        DQ_DEBUG << "New value is " << x << endl;
 
         return o;
     }

          
@@ 623,7 623,7 @@ private:
 
         QObject *o = state.map.value(node);
 
-        DEBUG << "callLoadCallbacks: " << node << " -> " << o << endl;
+        DQ_DEBUG << "callLoadCallbacks: " << node << " -> " << o << endl;
 
         if (!o) return;
 

          
@@ 720,7 720,7 @@ ObjectLoader::D::loadProperties(LoadStat
             if (!literal && (loadType == LoadLiteralProperties)) continue;
         }
         
-        DEBUG << "For property " << pname << " of " << node << " have "
+        DQ_DEBUG << "For property " << pname << " of " << node << " have "
               << pnodes.size() << " node(s)" << endl;
 
         if (!haveProperty && m_ap == IgnoreAbsentProperties) continue;

          
@@ 733,7 733,7 @@ ObjectLoader::D::loadProperties(LoadStat
                 if (m_ob->knows(cname)) {
                     defaultsObject = m_ob->build(cname, 0);
                 } else {
-                    DEBUG << "Can't reset absent property " << pname
+                    DQ_DEBUG << "Can't reset absent property " << pname
                           << " of object " << node << ": object builder "
                           << "doesn't know type " << cname << " so cannot "
                           << "build defaults object" << endl;

          
@@ 741,32 741,32 @@ ObjectLoader::D::loadProperties(LoadStat
             }
 
             if (defaultsObject) {
-                DEBUG << "Resetting property " << pname << " to default" << endl;
+                DQ_DEBUG << "Resetting property " << pname << " to default" << endl;
                 value = defaultsObject->property(pnba.data());
             }
 
         } else {
             QString typeName = property.typeName();
-            DEBUG << "Setting property " << pname << " of type " << typeName << endl;
+            DQ_DEBUG << "Setting property " << pname << " of type " << typeName << endl;
             value = propertyNodeListToVariant(state, typeName, pnodes);
         }
 
         if (!value.isValid()) {
-            DEBUG << "Ignoring invalid variant for value of property "
+            DQ_DEBUG << "Ignoring invalid variant for value of property "
                   << pname << ", type " << property.typeName()
                   << " of object " << node << endl;
             continue;
         }
 
         if (!o->setProperty(pnba.data(), value)) {
-            DEBUG << "loadProperties: Property set failed "
+            DQ_DEBUG << "loadProperties: Property set failed "
                   << "for property " << pname << " of type "
                   << property.typeName() << " (" << property.userType()
                   << ") to value of type " << value.type() 
                   << " and value " << value
                   << " from (first) node " << pnodes[0].value
                   << endl;
-            DEBUG << "loadProperties: If the RDF datatype is correct, check "
+            DQ_DEBUG << "loadProperties: If the RDF datatype is correct, check "
                   << "[1] that the datatype is known to Dataquay::Node for "
                   << "node-variant conversion"
                   << "(datatype is one of the standard set, "

          
@@ 791,7 791,7 @@ ObjectLoader::D::propertyNodeListToVaria
 
     Node firstNode = pnodes[0];
 
-    DEBUG << "propertyNodeListToVariant: typeName = " << typeName << endl;
+    DQ_DEBUG << "propertyNodeListToVariant: typeName = " << typeName << endl;
 
     if (typeName == "") {
         return firstNode.toVariant();

          
@@ 827,7 827,7 @@ ObjectLoader::D::propertyNodeListToVaria
         if (obj) {
             v = m_ob->inject(typeName, obj);
             if (v == QVariant()) {
-                DEBUG << "propertyNodeListToVariant: "
+                DQ_DEBUG << "propertyNodeListToVariant: "
                       << "Type of node " << firstNode
                       << " is incompatible with expected "
                       << typeName << endl;

          
@@ 852,7 852,7 @@ ObjectLoader::D::propertyNodeListToVaria
 }
 
 QVariant
-ObjectLoader::D::propertyNodeToVariant(LoadState &state,
+ObjectLoader::D::propertyNodeToVariant(LoadState & /* state */,
                                        QString typeName, Node pnode)
 {
     // Usually we can take the default conversion from node to

          
@@ 874,7 874,7 @@ ObjectLoader::D::propertyNodeToVariant(L
     // We have to fail that one, because we're not in any position to
     // do general type conversion here.
 
-    DEBUG << "propertyNodeToVariant: typeName = " << typeName << endl;
+    DQ_DEBUG << "propertyNodeToVariant: typeName = " << typeName << endl;
 
     if (typeName == "") {
         return pnode.toVariant();

          
@@ 884,7 884,7 @@ ObjectLoader::D::propertyNodeToVariant(L
 
     if (pnode.type == Node::URI && typeName != Uri::metaTypeName()) {
 
-        DEBUG << "ObjectLoader::propertyNodeListToVariant: "
+        DQ_DEBUG << "ObjectLoader::propertyNodeListToVariant: "
               << "Non-URI property is target for RDF URI, converting" << endl;
         
         acceptDefault = false;

          
@@ 893,7 893,7 @@ ObjectLoader::D::propertyNodeToVariant(L
                pnode.datatype == Uri() && // no datatype
                typeName != QMetaType::typeName(QMetaType::QString)) {
 
-        DEBUG << "ObjectLoader::propertyNodeListToVariant: "
+        DQ_DEBUG << "ObjectLoader::propertyNodeListToVariant: "
               << "No datatype for RDF literal, deducing from typename \""
               << typeName << "\"" << endl;
 

          
@@ 918,7 918,7 @@ ObjectLoader::D::propertyNodeToObject(Lo
     if (pnode.type == Node::URI || pnode.type == Node::Blank) {
         o = allocateSingle(state, pnode);
     } else {
-        DEBUG << "Not an object node, ignoring" << endl;
+        DQ_DEBUG << "Not an object node, ignoring" << endl;
     }
 
     return o;

          
@@ 939,14 939,14 @@ ObjectLoader::D::propertyNodeToList(Load
         QVariant value = propertyNodeListToVariant(state, typeName, vnodes);
 
         if (value.isValid()) {
-            DEBUG << "Found value: " << value << endl;
+            DQ_DEBUG << "Found value: " << value << endl;
             list.push_back(value);
         } else {
-            DEBUG << "propertyNodeToList: Invalid value in list, skipping" << endl;
+            DQ_DEBUG << "propertyNodeToList: Invalid value in list, skipping" << endl;
         }
     }
 
-    DEBUG << "propertyNodeToList: list has " << list.size() << " item(s)" << endl;
+    DQ_DEBUG << "propertyNodeToList: list has " << list.size() << " item(s)" << endl;
     return list;
 }
 

          
@@ 962,16 962,16 @@ ObjectLoader::D::getClassNameForNode(Nod
         try {
             className = m_tm.synthesiseClassForTypeUri(typeUri);
         } catch (UnknownTypeException) {
-            DEBUG << "getClassNameForNode: Unknown type URI " << typeUri << endl;
+            DQ_DEBUG << "getClassNameForNode: Unknown type URI " << typeUri << endl;
             throw;
         }
     } else {
-        DEBUG << "getClassNameForNode: No type URI for " << node << endl;
+        DQ_DEBUG << "getClassNameForNode: No type URI for " << node << endl;
         throw UnknownTypeException("");
     }
         
     if (!m_ob->knows(className)) {
-        DEBUG << "ObjectLoader::getClassNameForNode: Unknown object class "
+        DQ_DEBUG << "ObjectLoader::getClassNameForNode: Unknown object class "
               << className << endl;
         throw UnknownTypeException(className);
     }

          
@@ 992,7 992,7 @@ ObjectLoader::D::allocateObject(Node nod
 
     QString className = getClassNameForNode(node);
     
-    DEBUG << "Making object " << node.value << " of type "
+    DQ_DEBUG << "Making object " << node.value << " of type "
           << className << " with parent " << parent << endl;
 
     QObject *o = m_ob->build(className, parent);

          
@@ 1002,7 1002,7 @@ ObjectLoader::D::allocateObject(Node nod
         o->setProperty("uri", QVariant::fromValue(m_s->expand(node.value)));
     }
 
-    DEBUG << "Made object: " << o << endl;
+    DQ_DEBUG << "Made object: " << o << endl;
 
     return o;
 }

          
M src/objectmapper/ObjectMapper.cpp +38 -38
@@ 89,12 89,12 @@ ObjectMapper::D : public QObject
         LoadStoreCallback(ObjectMapper::D *d) : m_d(d) { }
         void loaded(ObjectLoader *, ObjectLoader::NodeObjectMap &,
                     Node, QObject *o) {
-            DEBUG << "LoadStoreCallback::loaded: Object " << o << endl;
+            DQ_DEBUG << "LoadStoreCallback::loaded: Object " << o << endl;
             m_d->manage(o);
         }
         void stored(ObjectStorer *, ObjectStorer::ObjectNodeMap &,
                     QObject *o, Node) {
-            DEBUG << "LoadStoreCallback::stored: Object " << o << endl;
+            DQ_DEBUG << "LoadStoreCallback::stored: Object " << o << endl;
             m_d->manage(o);
         }
     private:

          
@@ 183,7 183,7 @@ public:
             // which will happen on the next commit because we are
             // adding it to the changed object map
         }
-        DEBUG << "ObjectMapper::add: Adding " << o << " to changed list" << endl;
+        DQ_DEBUG << "ObjectMapper::add: Adding " << o << " to changed list" << endl;
         m_changedObjects.insert(o);
     }
 

          
@@ 197,7 197,7 @@ public:
                 // doesn't matter (as above)
             }
         }
-        DEBUG << "ObjectMapper::add: Adding " << ol.size() << " object(s) to changed list" << endl;
+        DQ_DEBUG << "ObjectMapper::add: Adding " << ol.size() << " object(s) to changed list" << endl;
         foreach (QObject *o, ol) {
             m_changedObjects.insert(o);
         }

          
@@ 229,12 229,12 @@ public:
         
         if (m_n.objectNodeMap.contains(o) &&
             m_n.nodeObjectMap.contains(Node(uri))) {
-            DEBUG << "ObjectMapper::manage: Object " << o
+            DQ_DEBUG << "ObjectMapper::manage: Object " << o
                   << " " << uri << " is already managed" << endl;
             return;
         }
 
-        DEBUG << "ObjectMapper::manage: Managing " << o
+        DQ_DEBUG << "ObjectMapper::manage: Managing " << o
               << " " << uri << endl;
 
         // The forwarder avoids us trying to connect potentially many,

          
@@ 250,16 250,16 @@ public:
 
     void addListNodesFor(QObject *o) {
 
-        DEBUG << "addListNodesFor(" << o << ")" << endl;
+        DQ_DEBUG << "addListNodesFor(" << o << ")" << endl;
 
         if (!m_n.objectNodeMap.contains(o)) {
-            DEBUG << "addListNodesFor(" << o << "): Object is unknown to us" << endl;
+            DQ_DEBUG << "addListNodesFor(" << o << "): Object is unknown to us" << endl;
             return;
         }
             
         Node n = m_n.objectNodeMap.value(o);
 
-        DEBUG << "addListNodesFor: Node is " << n << endl;
+        DQ_DEBUG << "addListNodesFor: Node is " << n << endl;
 
         ContainerBuilder *cb = ContainerBuilder::getInstance();
         

          
@@ 274,7 274,7 @@ public:
             
             if (cb->getContainerKind(property.typeName()) ==
                 ContainerBuilder::SequenceKind) {
-                DEBUG << "addListNodesFor: Property " << property.name() << " is a sequence kind" << endl;
+                DQ_DEBUG << "addListNodesFor: Property " << property.name() << " is a sequence kind" << endl;
                 addListNodesForProperty(o, n, property);
             }
         }

          
@@ 282,7 282,7 @@ public:
 
     void removeListNodesFor(QObject *o) {
 
-        DEBUG << "removeListNodesFor(" << o << ")" << endl;
+        DQ_DEBUG << "removeListNodesFor(" << o << ")" << endl;
         
         //!!! ouch
 

          
@@ 323,13 323,13 @@ public:
             Node next = m_s->matchOnce
                 (Triple(itr, m_s->expand("rdf:rest"), Node())).c;
             if (next == Node()) { // This is not a list node at all!
-                DEBUG << "addListNodesForProperty: Strange, node " << itr
+                DQ_DEBUG << "addListNodesForProperty: Strange, node " << itr
                       << " (from property URI " << puri << " of object node "
                       << n << ", object " << o << ") is not a list node" << endl;
                 break;
             }
             m_n.listNodeObjectMap[itr] = o;
-            DEBUG << "addListNodesForProperty: Added node " << itr
+            DQ_DEBUG << "addListNodesForProperty: Added node " << itr
                   << " for object " << o << endl;
             if (next == nil) { // we've finished
                 break;

          
@@ 353,24 353,24 @@ public:
     }
 
     void objectModified(QObject *o) {
-        DEBUG << "ObjectMapper:: objectModified(" << o << ")" << endl;
+        DQ_DEBUG << "ObjectMapper:: objectModified(" << o << ")" << endl;
         QMutexLocker locker(&m_mutex);
         if (m_inReload) {
             // This signal must have been emitted by a modification
             // caused by our own transactionCommitted method (see
             // similar comment about m_inCommit in that method).
-            DEBUG << "(by us, ignoring it)" << endl;
+            DQ_DEBUG << "(by us, ignoring it)" << endl;
             return;
         }
 
         //!!! what if the thing that changed about the object was its URL???!!!
 
         m_changedObjects.insert(o);
-        DEBUG << "ObjectMapper::objectModified done" << endl;
+        DQ_DEBUG << "ObjectMapper::objectModified done" << endl;
     }
 
     void objectDestroyed(QObject *o) {
-        DEBUG << "ObjectMapper::objectDestroyed(" << o << ")" << endl;
+        DQ_DEBUG << "ObjectMapper::objectDestroyed(" << o << ")" << endl;
         QMutexLocker locker(&m_mutex);
         m_changedObjects.remove(o);
         if (m_forwarders.contains(o)) {

          
@@ 379,7 379,7 @@ public:
         }
         Node node = m_n.objectNodeMap.value(o);
         if (node == Node()) {
-            DEBUG << "(have no node for this)" << endl;
+            DQ_DEBUG << "(have no node for this)" << endl;
             return;
         }
         m_n.objectNodeMap.remove(o);

          
@@ 398,17 398,17 @@ public:
             // to ignore events for objects we know we are
             // synchronising already.
             if (m_reloading.contains(node)) {
-                DEBUG << "(by us, ignoring it)" << endl;
+                DQ_DEBUG << "(by us, ignoring it)" << endl;
                 return;
             }
             // ^^^ write a unit test for this!
         }
         m_deletedObjectNodes.insert(node);
-        DEBUG << "ObjectMapper::objectDestroyed done" << endl;
+        DQ_DEBUG << "ObjectMapper::objectDestroyed done" << endl;
     }
 
     void transactionCommitted(const ChangeSet &cs) {
-        DEBUG << "ObjectMapper::transactionCommitted" << endl;
+        DQ_DEBUG << "ObjectMapper::transactionCommitted" << endl;
         QMutexLocker locker(&m_mutex);
         if (m_inCommit) {
             // This signal must have been emitted by a commit invoked

          
@@ 419,40 419,40 @@ public:
             // mutex, otherwise we would have deadlocked).  And we
             // don't want to update on the basis of our own commits,
             // only on the basis of commits happening elsewhere.
-            DEBUG << "(by us, ignoring it)" << endl;
+            DQ_DEBUG << "(by us, ignoring it)" << endl;
             return;
         }
         //!!! but now what?
         m_inReload = true;
-        DEBUG << "ObjectMapper::transactionCommitted: Synchronising from " << cs.size()
+        DQ_DEBUG << "ObjectMapper::transactionCommitted: Synchronising from " << cs.size()
               << " change(s) in transaction" << endl;
 
 #ifndef NDEBUG
-        DEBUG << "ObjectMapper: before sync, node-object map contains:" << endl;
+        DQ_DEBUG << "ObjectMapper: before sync, node-object map contains:" << endl;
         for (ObjectLoader::NodeObjectMap::iterator i = m_n.nodeObjectMap.begin();
              i != m_n.nodeObjectMap.end(); ++i) {
             QString n;
             QObject *o = i.value();
             if (o) n = o->objectName();
-            DEBUG << i.key() << " -> " << i.value() << " [" << n << "]" << endl;
+            DQ_DEBUG << i.key() << " -> " << i.value() << " [" << n << "]" << endl;
         }
 
-        DEBUG << "ObjectMapper: before sync, object-node map contains:" << endl;
+        DQ_DEBUG << "ObjectMapper: before sync, object-node map contains:" << endl;
         for (ObjectStorer::ObjectNodeMap::iterator i = m_n.objectNodeMap.begin();
              i != m_n.objectNodeMap.end(); ++i) {
             QString n;
             QObject *o = i.key();
             if (o) n = o->objectName();
-            DEBUG << i.key() << " [" << n << "] -> " << i.value() << endl;
+            DQ_DEBUG << i.key() << " [" << n << "] -> " << i.value() << endl;
         }
 
-        DEBUG << "ObjectMapper: before sync, list-node-object map contains:" << endl;
+        DQ_DEBUG << "ObjectMapper: before sync, list-node-object map contains:" << endl;
         for (ObjectLoader::NodeObjectMap::iterator i = m_n.listNodeObjectMap.begin();
              i != m_n.listNodeObjectMap.end(); ++i) {
             QString n;
             QObject *o = i.value();
             if (o) n = o->objectName();
-            DEBUG << i.key() << " -> " << i.value() << " [" << n << "]" << endl;
+            DQ_DEBUG << i.key() << " -> " << i.value() << " [" << n << "]" << endl;
         }
 #endif
         //!!! if an object has been effectively deleted from the

          
@@ 476,7 476,7 @@ public:
             // property of an object, reload that object.
             if (m_n.listNodeObjectMap.contains(subject)) {
                 QObject *o = m_n.listNodeObjectMap.value(subject);
-                DEBUG << "transactionCommitted: Node " << subject
+                DQ_DEBUG << "transactionCommitted: Node " << subject
                       << " is a list node for object " << o << endl;
                 if (m_n.objectNodeMap.contains(o)) {
                     m_reloading.insert(m_n.objectNodeMap.value(o));

          
@@ 489,7 489,7 @@ public:
             nodes.push_back(n);
         }
 
-        DEBUG << "transactionCommitted: Have " << nodes.size() << " node(s) to reload" << endl;
+        DQ_DEBUG << "transactionCommitted: Have " << nodes.size() << " node(s) to reload" << endl;
 
         m_loader->reload(nodes, m_n.nodeObjectMap);
         m_reloading.clear();

          
@@ 499,23 499,23 @@ public:
         // from it
         syncMap(m_n.objectNodeMap, m_n.nodeObjectMap);
 
-        DEBUG << "ObjectMapper: after sync, object-node map contains:" << endl;
+        DQ_DEBUG << "ObjectMapper: after sync, object-node map contains:" << endl;
         for (ObjectStorer::ObjectNodeMap::iterator i = m_n.objectNodeMap.begin();
              i != m_n.objectNodeMap.end(); ++i) {
             QString n;
             QObject *o = i.key();
             if (o) n = o->objectName();
-            DEBUG << i.key() << " [" << n << "] -> " << i.value() << endl;
+            DQ_DEBUG << i.key() << " [" << n << "] -> " << i.value() << endl;
         }
 
         m_inReload = false;
-        DEBUG << "ObjectMapper::transactionCommitted done" << endl;
+        DQ_DEBUG << "ObjectMapper::transactionCommitted done" << endl;
     }
 
     void doCommit(ChangeSet *cs) { 
 
         QMutexLocker locker(&m_mutex);
-        DEBUG << "ObjectMapper::commit: Synchronising " << m_changedObjects.size()
+        DQ_DEBUG << "ObjectMapper::commit: Synchronising " << m_changedObjects.size()
               << " changed and " << m_deletedObjectNodes.size()
               << " deleted object(s)" << endl;
         //!!! if an object has been added as a new sibling of existing

          
@@ 563,7 563,7 @@ public:
 
         m_deletedObjectNodes.clear();
         m_changedObjects.clear();
-        DEBUG << "ObjectMapper::commit done" << endl;
+        DQ_DEBUG << "ObjectMapper::commit done" << endl;
     }
 
     void commit() {

          
@@ 633,7 633,7 @@ private:
             newMap.insert(n, i.key());
         }
 
-        DEBUG << "syncMap: Note: resized NodeObjectMap from " << target.size()
+        DQ_DEBUG << "syncMap: Note: resized NodeObjectMap from " << target.size()
               << " to " << newMap.size() << " element(s); " << inCommon
               << " unchanged or trivial" << endl;
 

          
@@ 663,7 663,7 @@ private:
             newMap.insert(o, i.key());
         }
 
-        DEBUG << "syncMap: Note: resized ObjectNodeMap from " << target.size()
+        DQ_DEBUG << "syncMap: Note: resized ObjectNodeMap from " << target.size()
               << " to " << newMap.size() << " element(s); " << inCommon
               << " unchanged or trivial" << endl;
 

          
M src/objectmapper/ObjectMapperForwarder.cpp +1 -1
@@ 56,7 56,7 @@ ObjectMapperForwarder::ObjectMapperForwa
         }
             
         if (!property.hasNotifySignal()) {
-            DEBUG << "ObjectMapperForwarder: No notify signal for property " << property.name() << endl;
+            DQ_DEBUG << "ObjectMapperForwarder: No notify signal for property " << property.name() << endl;
             continue;
         }
         

          
M src/objectmapper/ObjectStorer.cpp +48 -48
@@ 151,7 151,7 @@ public:
 
         if (node.type != Node::URI) {
             // This shouldn't happen (see above)
-            DEBUG << "ObjectStorer::store: Stored object node "
+            DQ_DEBUG << "ObjectStorer::store: Stored object node "
                   << node << " is not a URI node" << endl;
             std::cerr << "WARNING: ObjectStorer::store: No URI for stored object!" << std::endl;
             return Uri();

          
@@ 242,7 242,7 @@ private:
 
                 if (!visited.contains(r)) {
 
-                    DEBUG << "ObjectStorer::collect: relative " << r 
+                    DQ_DEBUG << "ObjectStorer::collect: relative " << r 
                           << " is new, listing it as candidate" << endl;
                     candidates << r;
 

          
@@ 259,7 259,7 @@ private:
                     // We've seen this one before.  If we see any
                     // object more than once by different routes, that
                     // implies that we can't use a blank node for it
-                    DEBUG << "ObjectStorer::collect: relative " << r 
+                    DQ_DEBUG << "ObjectStorer::collect: relative " << r 
                           << " has been seen more than once,"
                           << " ensuring it doesn't get a blank node" << endl;
                     state.noBlanks << r;

          
@@ 274,13 274,13 @@ private:
 
                     if (!visited.contains(p)) {
 
-                        DEBUG << "ObjectStorer::collect: property " << p 
+                        DQ_DEBUG << "ObjectStorer::collect: property " << p 
                               << " is new, listing it as candidate" << endl;
                         candidates << p;
                         
                     } else {
                         // We've seen this one before (as above)
-                        DEBUG << "ObjectStorer::collect: property " << p 
+                        DQ_DEBUG << "ObjectStorer::collect: property " << p 
                               << " has been seen more than once,"
                               << " ensuring it doesn't get a blank node" << endl;
                         state.noBlanks << p;

          
@@ 289,22 289,22 @@ private:
             }
         }
         
-        DEBUG << "ObjectStorer::collect: "
+        DQ_DEBUG << "ObjectStorer::collect: "
               << "requested = " << state.requested.size()
               << ", toAllocate = " << state.toAllocate.size()
               << ", toStore = " << state.toStore.size()
               << endl;
 
-        DEBUG << "Requested:";
-        foreach (QObject *obj, state.requested) DEBUG << obj;
+        DQ_DEBUG << "Requested:";
+        foreach (QObject *obj, state.requested) DQ_DEBUG << obj;
 
-        DEBUG << "toAllocate:";
-        foreach (QObject *obj, state.toAllocate) DEBUG << obj;
+        DQ_DEBUG << "toAllocate:";
+        foreach (QObject *obj, state.toAllocate) DQ_DEBUG << obj;
 
-        DEBUG << "toStore:";
-        foreach (QObject *obj, state.toStore) DEBUG << obj;
+        DQ_DEBUG << "toStore:";
+        foreach (QObject *obj, state.toStore) DQ_DEBUG << obj;
 
-        DEBUG << endl;
+        DQ_DEBUG << endl;
     }
 
     QObjectList objectsOf(QVariant v) {

          
@@ 361,7 361,7 @@ private:
     void store(StoreState &state) {
 
         foreach (QObject *obj, state.toAllocate) {
-            DEBUG << "store: calling allocate(" << obj << ")" << endl;
+            DQ_DEBUG << "store: calling allocate(" << obj << ")" << endl;
             allocate(state, obj);//!!! can this fail, as it can in loader?
         }
 

          
@@ 370,12 370,12 @@ private:
         ObjectSet ts = state.toStore;
 
         foreach (QObject *obj, ts) {
-            DEBUG << "store: calling store(" << obj << ")" << endl;
+            DQ_DEBUG << "store: calling store(" << obj << ")" << endl;
             store(state, obj);
         }
 
         foreach (QObject *obj, ts) {
-            DEBUG << "store: calling callStoreCallbacks(" << obj << ")" << endl;
+            DQ_DEBUG << "store: calling callStoreCallbacks(" << obj << ")" << endl;
             callStoreCallbacks(state, obj);
         }
     }

          
@@ 443,7 443,7 @@ ObjectStorer::D::variantsEqual(const QVa
 
     Node n1 = Node::fromVariant(v1);
     Node n2 = Node::fromVariant(v2);
-    DEBUG << "variantsEqual: comparing " << n1 << " and " << n2 << endl;
+    DQ_DEBUG << "variantsEqual: comparing " << n1 << " and " << n2 << endl;
     return (n1 == n2);
 }
 

          
@@ 495,12 495,12 @@ ObjectStorer::D::storeProperties(StoreSt
                 if (variantsEqual(value, deftValue)) {
                     store = false;
                 } else {
-                    DEBUG << "Property " << pname << " of object "
+                    DQ_DEBUG << "Property " << pname << " of object "
                           << node << " is changed from default value "
                           << c->property(pnba.data()) << ", writing" << endl;
                 }
             } else {
-                DEBUG << "Can't check property " << pname << " of object "
+                DQ_DEBUG << "Can't check property " << pname << " of object "
                       << node << " for change from default value: "
                       << "object builder doesn't know type " << cname
                       << " so cannot build default object" << endl;

          
@@ 508,7 508,7 @@ ObjectStorer::D::storeProperties(StoreSt
         }
 
         if (store) {
-            DEBUG << "For object " << node << " (" << o << ") writing property " << pname << " of type " << property.userType() << endl;
+            DQ_DEBUG << "For object " << node << " (" << o << ") writing property " << pname << " of type " << property.userType() << endl;
         }
 
         Uri puri;

          
@@ 533,15 533,15 @@ ObjectStorer::D::removePropertyNodes(Nod
 {
     Triple t(node, propertyUri, Node());
     Triples m(m_s->match(t));
-    DEBUG << "removePropertyNodes: Node " << node << " and property "
+    DQ_DEBUG << "removePropertyNodes: Node " << node << " and property "
           << propertyUri << " yields " << m.size() << " matching triples"
           << endl;
     foreach (t, m) {
         if (retain && retain->contains(t.c)) {
-            DEBUG << "...retaining " << t.c << endl;
+            DQ_DEBUG << "...retaining " << t.c << endl;
             retain->remove(t.c);
         } else {
-            DEBUG << "...removing " << t.c << endl;
+            DQ_DEBUG << "...removing " << t.c << endl;
             m_s->remove(t);
             if (t.c == node) continue;
             // If this is a blank node, or if it is a node only used

          
@@ 565,7 565,7 @@ ObjectStorer::D::isListNode(Node n) cons
 
     bool isList = false;
 
-    DEBUG << "isListNode: Testing node " << n << endl;
+    DQ_DEBUG << "isListNode: Testing node " << n << endl;
 
     // A list head should have only rdf:first and rdf:rest properties
     if (ts.size() == 2) {

          
@@ 577,7 577,7 @@ ObjectStorer::D::isListNode(Node n) cons
         }
     }
 
-    DEBUG << "isListNode: isList = " << isList << endl;
+    DQ_DEBUG << "isListNode: isList = " << isList << endl;
 
     return isList;
 }

          
@@ 617,12 617,12 @@ ObjectStorer::D::removeUnusedNode(Node n
 
     if (m_s->matchOnce(Triple(Node(), Node(), node)) != Triple()) {
         // The node is still a target of some predicate, leave it alone
-        DEBUG << "removeUnusedNode: Blank or list node " << node
+        DQ_DEBUG << "removeUnusedNode: Blank or list node " << node
               << " is still a target for another predicate, leaving" << endl;
         return;
     }
 
-    DEBUG << "removeUnusedNode: Blank or list node " << node
+    DQ_DEBUG << "removeUnusedNode: Blank or list node " << node
           << " is not target for any other predicate" << endl;
 
     // check for a list tail (query first, but then delete our own

          
@@ 630,11 630,11 @@ ObjectStorer::D::removeUnusedNode(Node n
     // relationship isn't seen as a reason not to delete the tail)
     Triples tails(m_s->match(Triple(node, m_s->expand("rdf:rest"), Node())));
 
-    DEBUG << "... removing everything with it as subject" << endl;
+    DQ_DEBUG << "... removing everything with it as subject" << endl;
     m_s->remove(Triple(node, Node(), Node()));
 
     foreach (Triple t, tails) {
-        DEBUG << "... recursing to list tail" << endl;
+        DQ_DEBUG << "... recursing to list tail" << endl;
         removeUnusedNode(t.c);
     }
 }

          
@@ 650,7 650,7 @@ ObjectStorer::D::variantToPropertyNodeLi
         return nodes;
     }
 
-    DEBUG << "variantToPropertyNodeList: typeName = " << typeName << endl;
+    DQ_DEBUG << "variantToPropertyNodeList: typeName = " << typeName << endl;
         
     if (m_cb->canExtractContainer(typeName)) {
 

          
@@ 674,13 674,13 @@ ObjectStorer::D::variantToPropertyNodeLi
             Node n = objectToPropertyNode(state, obj);
             if (n != Node()) nodes << n;
         } else {
-            DEBUG << "variantToPropertyNodeList: Note: obtained NULL object from variant" << endl;
+            DQ_DEBUG << "variantToPropertyNodeList: Note: obtained NULL object from variant" << endl;
         }
             
     } else if (isStarType(typeName)) {
 
         // do not attempt to write binary pointers!
-        DEBUG << "variantToPropertyNodeList: Note: Ignoring pointer type "
+        DQ_DEBUG << "variantToPropertyNodeList: Note: Ignoring pointer type "
               << typeName
               << " that is unknown to container and object builders" << endl;
         return Nodes();

          
@@ 698,7 698,7 @@ ObjectStorer::D::objectToPropertyNode(St
 {
     Node pnode;
 
-    DEBUG << "objectToPropertyNode: " << o << endl;
+    DQ_DEBUG << "objectToPropertyNode: " << o << endl;
 
     if (state.map.contains(o) && state.map.value(o) != Node()) {
         pnode = state.map.value(o);

          
@@ 719,7 719,7 @@ ObjectStorer::D::objectToPropertyNode(St
 Node
 ObjectStorer::D::listToPropertyNode(StoreState &state, QVariantList list)
 {
-    DEBUG << "listToPropertyNode: have " << list.size() << " items" << endl;
+    DQ_DEBUG << "listToPropertyNode: have " << list.size() << " items" << endl;
 
     Node node, first, previous;
 

          
@@ 772,20 772,20 @@ ObjectStorer::D::listToPropertyNode(Stor
 void
 ObjectStorer::D::store(StoreState &state, QObject *o)
 {
-    DEBUG << "ObjectStorer::store: Examining " << o << endl;
+    DQ_DEBUG << "ObjectStorer::store: Examining " << o << endl;
 
     if (!state.toStore.contains(o)) return;
 
     Node node = state.map.value(o);
     if (node == Node()) {
         // We don't allocate any nodes here -- that happened already
-        DEBUG << "ObjectStorer::store: Strange -- object " << o << " has no node, why wasn't it allocated?" << endl;
+        DQ_DEBUG << "ObjectStorer::store: Strange -- object " << o << " has no node, why wasn't it allocated?" << endl;
         return;
     }
 
     storeSingle(state, o, node);
 
-    DEBUG << "ObjectStorer::store: Object " << o << " has node " << node << endl;
+    DQ_DEBUG << "ObjectStorer::store: Object " << o << " has node " << node << endl;
 
     // If we have a parent with a node, write a parent property; if we
     // are following siblings, we need to write a follow property to

          
@@ 801,7 801,7 @@ ObjectStorer::D::store(StoreState &state
             replacePropertyNodes(node, m_parentProp, pn);
         }
     } else {
-        DEBUG << "ObjectStorer::store: Node " << node
+        DQ_DEBUG << "ObjectStorer::store: Node " << node
               << " has no parent" << endl;
         m_s->remove(Triple(node, m_parentProp, Node()));
     }

          
@@ 826,14 826,14 @@ ObjectStorer::D::store(StoreState &state
         
         if (previous) {
 
-            DEBUG << "ObjectStorer::store: Node " << node
+            DQ_DEBUG << "ObjectStorer::store: Node " << node
                   << " follows sibling object " << previous << endl;
 
             Node sn = state.map.value(previous);
 
             if (sn != Node()) {
 
-                DEBUG << "ObjectStorer::store: Node " << node
+                DQ_DEBUG << "ObjectStorer::store: Node " << node
                       << " follows sibling " << sn << endl;
                 replacePropertyNodes(node, m_followProp, sn);
                 followsWritten = true;

          
@@ 844,7 844,7 @@ ObjectStorer::D::store(StoreState &state
             }
         } else {
             // no previous sibling
-            DEBUG << "ObjectStorer::store: Node " << node
+            DQ_DEBUG << "ObjectStorer::store: Node " << node
                   << " is first child, follows nothing" << endl;
         }
     }

          
@@ 853,18 853,18 @@ ObjectStorer::D::store(StoreState &state
         m_s->remove(Triple(node, m_followProp, Node()));
     }
 
-    DEBUG << "store: Finished with " << o << endl;
+    DQ_DEBUG << "store: Finished with " << o << endl;
 }
 
 void
 ObjectStorer::D::allocate(StoreState &state, QObject *o)
 {
-    DEBUG << "allocate " << o << endl;
+    DQ_DEBUG << "allocate " << o << endl;
 
     //!!! too many of these tests, some must be redundant
     Node node = state.map.value(o);
     if (node != Node()) {
-        DEBUG << "allocate: object " << o << " already has node " << node << endl;
+        DQ_DEBUG << "allocate: object " << o << " already has node " << node << endl;
         return;
     }
 

          
@@ 873,7 873,7 @@ ObjectStorer::D::allocate(StoreState &st
         node = Node(uri);
         state.map.insert(o, node);
         state.toAllocate.remove(o);
-        DEBUG << "allocate: object " << o << " has known uri " << uri << endl;
+        DQ_DEBUG << "allocate: object " << o << " has known uri " << uri << endl;
         return;
     }
 

          
@@ 881,11 881,11 @@ ObjectStorer::D::allocate(StoreState &st
 
         node = m_s->addBlankNode();
 
-        DEBUG << "allocate: object " << o << " being given new blank node " << node << endl;
+        DQ_DEBUG << "allocate: object " << o << " being given new blank node " << node << endl;
 
     } else {
         QString className = o->metaObject()->className();
-        DEBUG << "className = " << className << endl;
+        DQ_DEBUG << "className = " << className << endl;
         Uri prefix;
         if (!m_tm.getUriPrefixForClass(className, prefix)) {
             //!!! put this in TypeMapping?

          
@@ 897,7 897,7 @@ ObjectStorer::D::allocate(StoreState &st
         o->setProperty("uri", QVariant::fromValue(uri));
         node = uri;
 
-        DEBUG << "allocate: object " << o << " being given new URI " << uri << endl;
+        DQ_DEBUG << "allocate: object " << o << " being given new URI " << uri << endl;
     }
 
     state.map.insert(o, node);