Enable API WebServices when GC is running

.. but disable logging if not running as a server
.. let user define if API services start in preferences
This commit is contained in:
Mark Liversedge
2015-09-17 14:21:21 +01:00
parent e1312caa33
commit 422d5ad5fc
13 changed files with 151 additions and 80 deletions

View File

@@ -15,7 +15,7 @@ HttpSession::HttpSession(bool canStore) {
dataPtr->lastAccess=QDateTime::currentMSecsSinceEpoch();
dataPtr->id=QUuid::createUuid().toString().toLocal8Bit();
#ifdef SUPERVERBOSE
qDebug("HttpSession: created new session data with id %s",dataPtr->id.data());
wDebug("HttpSession: created new session data with id %s",dataPtr->id.data());
#endif
}
else {
@@ -29,7 +29,7 @@ HttpSession::HttpSession(const HttpSession& other) {
dataPtr->lock.lockForWrite();
dataPtr->refCount++;
#ifdef SUPERVERBOSE
qDebug("HttpSession: refCount of %s is %i",dataPtr->id.data(),dataPtr->refCount);
wDebug("HttpSession: refCount of %s is %i",dataPtr->id.data(),dataPtr->refCount);
#endif
dataPtr->lock.unlock();
}
@@ -42,7 +42,7 @@ HttpSession& HttpSession::operator= (const HttpSession& other) {
dataPtr->lock.lockForWrite();
dataPtr->refCount++;
#ifdef SUPERVERBOSE
qDebug("HttpSession: refCount of %s is %i",dataPtr->id.data(),dataPtr->refCount);
wDebug("HttpSession: refCount of %s is %i",dataPtr->id.data(),dataPtr->refCount);
#endif
dataPtr->lastAccess=QDateTime::currentMSecsSinceEpoch();
dataPtr->lock.unlock();
@@ -52,7 +52,7 @@ HttpSession& HttpSession::operator= (const HttpSession& other) {
oldPtr->lock.lockForRead();
refCount=oldPtr->refCount--;
#ifdef SUPERVERBOSE
qDebug("HttpSession: refCount of %s is %i",oldPtr->id.data(),oldPtr->refCount);
wDebug("HttpSession: refCount of %s is %i",oldPtr->id.data(),oldPtr->refCount);
#endif
oldPtr->lock.unlock();
if (refCount==0) {
@@ -68,11 +68,11 @@ HttpSession::~HttpSession() {
dataPtr->lock.lockForRead();
refCount=--dataPtr->refCount;
#ifdef SUPERVERBOSE
qDebug("HttpSession: refCount of %s is %i",dataPtr->id.data(),dataPtr->refCount);
wDebug("HttpSession: refCount of %s is %i",dataPtr->id.data(),dataPtr->refCount);
#endif
dataPtr->lock.unlock();
if (refCount==0) {
qDebug("HttpSession: deleting data");
wDebug("HttpSession: deleting data");
delete dataPtr;
}
}