Use auto to avoid duplicating the type name

This commit is contained in:
Luis Ángel San Martín
2019-05-31 20:58:06 +02:00
parent 923ad40057
commit bb334cfd50
55 changed files with 286 additions and 286 deletions

View File

@ -92,7 +92,7 @@ void HttpListener::incomingConnection(tSocketDescriptor socketDescriptor) {
{
// Reject the connection
qDebug("HttpListener: Too many incoming connections");
QTcpSocket* socket=new QTcpSocket(this);
auto* socket=new QTcpSocket(this);
socket->setSocketDescriptor(socketDescriptor);
connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater()));
socket->write("HTTP/1.1 503 too many connections\r\nConnection: close\r\n\r\nToo many connections\r\n");

View File

@ -59,7 +59,7 @@ void RequestMapper::loadSessionV1(HttpRequest &request, HttpResponse &response)
HttpSession session = Static::sessionStore->getSession(request, response);
if (session.contains("ySession")) //session is already alive check if it is needed to update comics
{
YACReaderHttpSession *ySession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(session.getId());
auto ySession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(session.getId());
QString postData = QString::fromUtf8(request.getBody());
@ -85,7 +85,7 @@ void RequestMapper::loadSessionV1(HttpRequest &request, HttpResponse &response)
}
}
} else {
YACReaderHttpSession *ySession = new YACReaderHttpSession(this);
auto ySession = new YACReaderHttpSession(this);
Static::yacreaderSessionStore->addYACReaderHttpSession(session.getId(), ySession);
@ -121,11 +121,11 @@ void RequestMapper::loadSessionV2(HttpRequest &request, HttpResponse & /* respon
return;
}
YACReaderHttpSession *yRecoveredSession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(token);
auto yRecoveredSession = Static::yacreaderSessionStore->getYACReaderSessionHttpSession(token);
if (yRecoveredSession == nullptr) //session is already alive check if it is needed to update comics
{
YACReaderHttpSession *ySession = new YACReaderHttpSession(this);
auto ySession = new YACReaderHttpSession(this);
Static::yacreaderSessionStore->addYACReaderHttpSession(token, ySession);
}

View File

@ -53,7 +53,7 @@ void Startup::start()
logger->installMsgHandler();*/
// Configure template loader and cache
QSettings *templateSettings = new QSettings(configFileName, QSettings::IniFormat, app);
auto *templateSettings = new QSettings(configFileName, QSettings::IniFormat, app);
templateSettings->beginGroup("templates");
if (templateSettings->value("cacheSize").isNull())
@ -74,7 +74,7 @@ void Startup::start()
Static::templateLoader = new TemplateCache(templateSettings, app);
// Configure session store
QSettings *sessionSettings = new QSettings(configFileName, QSettings::IniFormat, app);
auto *sessionSettings = new QSettings(configFileName, QSettings::IniFormat, app);
sessionSettings->beginGroup("sessions");
if (sessionSettings->value("expirationTime").isNull())
@ -85,7 +85,7 @@ void Startup::start()
Static::yacreaderSessionStore = new YACReaderHttpSessionStore(Static::sessionStore, app);
// Configure static file controller
QSettings *fileSettings = new QSettings(configFileName, QSettings::IniFormat, app);
auto *fileSettings = new QSettings(configFileName, QSettings::IniFormat, app);
fileSettings->beginGroup("docroot");
QString basedocroot = "./server/docroot";
@ -106,7 +106,7 @@ void Startup::start()
// Configure and start the TCP listener
qDebug("ServiceHelper: Starting service");
QSettings *listenerSettings = new QSettings(configFileName, QSettings::IniFormat, app);
auto *listenerSettings = new QSettings(configFileName, QSettings::IniFormat, app);
listenerSettings->beginGroup("listener");
if (listenerSettings->value("maxRequestSize").isNull())