Use Q_GLOBAL_STATIC for Qt only builds

This commit is contained in:
craig.p.drummond
2014-03-17 19:52:47 +00:00
committed by craig.p.drummond
parent 3d94b88df3
commit 7bcb40d159
27 changed files with 133 additions and 434 deletions

View File

@@ -28,16 +28,13 @@
#endif
#include "settings.h"
#include "thread.h"
#include "globalstatic.h"
#include <QFile>
#include <QUrl>
#include <QTimer>
#if QT_VERSION >= 0x050000
#include <QUrlQuery>
#endif
#ifdef ENABLE_KDE_SUPPORT
#include <KDE/KGlobal>
K_GLOBAL_STATIC(HttpServer, instance)
#endif
#include <QDebug>
static bool debugIsEnabled=false;
@@ -60,18 +57,7 @@ bool HttpServer::debugEnabled()
return debugIsEnabled;
}
HttpServer * HttpServer::self()
{
#ifdef ENABLE_KDE_SUPPORT
return instance;
#else
static HttpServer *instance=0;
if(!instance) {
instance=new HttpServer;
}
return instance;
#endif
}
GLOBAL_STATIC(HttpServer, instance)
#ifdef ENABLE_HTTP_SERVER
HttpServer::HttpServer()