mirror of
https://github.com/YACReader/yacreader
synced 2025-11-12 13:02:51 -05:00
Use nullptr instead of 0
This commit is contained in:
@ -9,12 +9,12 @@
|
||||
HttpConnectionHandler::HttpConnectionHandler(QSettings* settings, HttpRequestHandler* requestHandler, QSslConfiguration* sslConfiguration)
|
||||
: QThread()
|
||||
{
|
||||
Q_ASSERT(settings!=0);
|
||||
Q_ASSERT(requestHandler!=0);
|
||||
Q_ASSERT(settings!=nullptr);
|
||||
Q_ASSERT(requestHandler!=nullptr);
|
||||
this->settings=settings;
|
||||
this->requestHandler=requestHandler;
|
||||
this->sslConfiguration=sslConfiguration;
|
||||
currentRequest=0;
|
||||
currentRequest=nullptr;
|
||||
busy=false;
|
||||
|
||||
// Create TCP or SSL socket
|
||||
@ -111,7 +111,7 @@ void HttpConnectionHandler::handleConnection(tSocketDescriptor socketDescriptor)
|
||||
readTimer.start(readTimeout);
|
||||
// delete previous request
|
||||
delete currentRequest;
|
||||
currentRequest=0;
|
||||
currentRequest=nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ void HttpConnectionHandler::readTimeout()
|
||||
socket->flush();
|
||||
socket->disconnectFromHost();
|
||||
delete currentRequest;
|
||||
currentRequest=0;
|
||||
currentRequest=nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -183,7 +183,7 @@ void HttpConnectionHandler::read()
|
||||
socket->flush();
|
||||
socket->disconnectFromHost();
|
||||
delete currentRequest;
|
||||
currentRequest=0;
|
||||
currentRequest=nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -269,7 +269,7 @@ void HttpConnectionHandler::read()
|
||||
readTimer.start(readTimeout);
|
||||
}
|
||||
delete currentRequest;
|
||||
currentRequest=0;
|
||||
currentRequest=nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ public:
|
||||
@param requestHandler Handler that will process each incoming HTTP request
|
||||
@param sslConfiguration SSL (HTTPS) will be used if not NULL
|
||||
*/
|
||||
HttpConnectionHandler(QSettings* settings, HttpRequestHandler* requestHandler, QSslConfiguration* sslConfiguration=NULL);
|
||||
HttpConnectionHandler(QSettings* settings, HttpRequestHandler* requestHandler, QSslConfiguration* sslConfiguration=nullptr);
|
||||
|
||||
/** Destructor */
|
||||
virtual ~HttpConnectionHandler();
|
||||
|
||||
@ -10,10 +10,10 @@
|
||||
HttpConnectionHandlerPool::HttpConnectionHandlerPool(QSettings* settings, HttpRequestHandler* requestHandler)
|
||||
: QObject()
|
||||
{
|
||||
Q_ASSERT(settings!=0);
|
||||
Q_ASSERT(settings!=nullptr);
|
||||
this->settings=settings;
|
||||
this->requestHandler=requestHandler;
|
||||
this->sslConfiguration=NULL;
|
||||
this->sslConfiguration=nullptr;
|
||||
loadSslConfig();
|
||||
cleanupTimer.start(settings->value("cleanupInterval",1000).toInt());
|
||||
connect(&cleanupTimer, SIGNAL(timeout()), SLOT(cleanup()));
|
||||
@ -34,7 +34,7 @@ HttpConnectionHandlerPool::~HttpConnectionHandlerPool()
|
||||
|
||||
HttpConnectionHandler* HttpConnectionHandlerPool::getConnectionHandler()
|
||||
{
|
||||
HttpConnectionHandler* freeHandler=0;
|
||||
HttpConnectionHandler* freeHandler=nullptr;
|
||||
mutex.lock();
|
||||
// find a free handler in pool
|
||||
foreach(HttpConnectionHandler* handler, pool)
|
||||
|
||||
@ -11,9 +11,9 @@
|
||||
HttpListener::HttpListener(QSettings* settings, HttpRequestHandler* requestHandler, QObject *parent)
|
||||
: QTcpServer(parent)
|
||||
{
|
||||
Q_ASSERT(settings!=0);
|
||||
Q_ASSERT(requestHandler!=0);
|
||||
pool=NULL;
|
||||
Q_ASSERT(settings!=nullptr);
|
||||
Q_ASSERT(requestHandler!=nullptr);
|
||||
pool=nullptr;
|
||||
this->settings=settings;
|
||||
this->requestHandler=requestHandler;
|
||||
// Reqister type of socketDescriptor for signal/slot handling
|
||||
@ -64,7 +64,7 @@ void HttpListener::close() {
|
||||
qDebug("HttpListener: closed");
|
||||
if (pool) {
|
||||
delete pool;
|
||||
pool=NULL;
|
||||
pool=nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ void HttpListener::incomingConnection(tSocketDescriptor socketDescriptor) {
|
||||
qDebug("HttpListener: New connection");
|
||||
#endif
|
||||
|
||||
HttpConnectionHandler* freeHandler=NULL;
|
||||
HttpConnectionHandler* freeHandler=nullptr;
|
||||
if (pool)
|
||||
{
|
||||
freeHandler=pool->getConnectionHandler();
|
||||
|
||||
@ -52,7 +52,7 @@ public:
|
||||
@param parent Parent object.
|
||||
@warning Ensure to close or delete the listener before deleting the request handler.
|
||||
*/
|
||||
HttpListener(QSettings* settings, HttpRequestHandler* requestHandler, QObject* parent = NULL);
|
||||
HttpListener(QSettings* settings, HttpRequestHandler* requestHandler, QObject* parent = nullptr);
|
||||
|
||||
/** Destructor */
|
||||
virtual ~HttpListener();
|
||||
|
||||
@ -441,7 +441,7 @@ void HttpRequest::parseMultiPartFile()
|
||||
#ifdef SUPERVERBOSE
|
||||
qDebug("HttpRequest: reading multpart data");
|
||||
#endif
|
||||
QTemporaryFile* uploadedFile=0;
|
||||
QTemporaryFile* uploadedFile=nullptr;
|
||||
QByteArray fieldValue;
|
||||
while (!tempFile.atEnd() && !finished && !tempFile.error())
|
||||
{
|
||||
|
||||
@ -31,7 +31,7 @@ public:
|
||||
* Constructor.
|
||||
* @param parent Parent object.
|
||||
*/
|
||||
HttpRequestHandler(QObject* parent=NULL);
|
||||
HttpRequestHandler(QObject* parent=nullptr);
|
||||
|
||||
/** Destructor */
|
||||
virtual ~HttpRequestHandler();
|
||||
|
||||
@ -22,7 +22,7 @@ HttpSession::HttpSession(bool canStore)
|
||||
}
|
||||
else
|
||||
{
|
||||
dataPtr=0;
|
||||
dataPtr=nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ QByteArray HttpSession::getId() const
|
||||
}
|
||||
|
||||
bool HttpSession::isNull() const {
|
||||
return dataPtr==0;
|
||||
return dataPtr==nullptr;
|
||||
}
|
||||
|
||||
void HttpSession::set(const QByteArray& key, const QVariant& value)
|
||||
|
||||
@ -36,7 +36,7 @@ class DECLSPEC HttpSessionStore : public QObject {
|
||||
public:
|
||||
|
||||
/** Constructor. */
|
||||
HttpSessionStore(QSettings* settings, QObject* parent=NULL);
|
||||
HttpSessionStore(QSettings* settings, QObject* parent=nullptr);
|
||||
|
||||
/** Destructor */
|
||||
virtual ~HttpSessionStore();
|
||||
|
||||
@ -46,7 +46,7 @@ class DECLSPEC StaticFileController : public HttpRequestHandler {
|
||||
public:
|
||||
|
||||
/** Constructor */
|
||||
StaticFileController(QSettings* settings, QObject* parent = NULL);
|
||||
StaticFileController(QSettings* settings, QObject* parent = nullptr);
|
||||
|
||||
/** Generates the response */
|
||||
void service(HttpRequest& request, HttpResponse& response);
|
||||
|
||||
Reference in New Issue
Block a user