Replaced even more cpp14 auto usage with actual type for cpp11 compliance

This commit is contained in:
Daniel Brunner
2018-10-05 00:15:57 +02:00
parent 744f6ac1fb
commit 18e3f03b69
2 changed files with 8 additions and 8 deletions

View File

@@ -85,7 +85,7 @@ void WifiLampApplication::handleRequest(HttpClientConnection *connection, const
{
auto iter = std::find_if(m_clients.constBegin(), m_clients.constEnd(),
[&parts](WifiLampClient* client){ return clientId(client) == parts.at(2); });
[&parts](WifiLampClient *client){ return clientId(client) == parts.at(2); });
if(iter == m_clients.constEnd())
throw HttpNotFoundException(request);
@@ -94,12 +94,12 @@ void WifiLampApplication::handleRequest(HttpClientConnection *connection, const
}
static const QHash<QString, std::function<void(WifiLampClient*)> > actions {
{ QStringLiteral("toggle"), [](WifiLampClient* client){ client->toggle(); } },
{ QStringLiteral("on"), [](WifiLampClient* client){ client->on(); } },
{ QStringLiteral("off"), [](WifiLampClient* client){ client->off(); } },
{ QStringLiteral("refresh"), [](WifiLampClient* client){ client->requestStatus(); } },
{ QStringLiteral("reboot"), [](WifiLampClient* client){ client->reboot(); } },
{ QStringLiteral("delete"), [](WifiLampClient* client){ client->deleteLater(); } }
{ QStringLiteral("toggle"), [](WifiLampClient *client){ client->toggle(); } },
{ QStringLiteral("on"), [](WifiLampClient *client){ client->on(); } },
{ QStringLiteral("off"), [](WifiLampClient *client){ client->off(); } },
{ QStringLiteral("refresh"), [](WifiLampClient *client){ client->requestStatus(); } },
{ QStringLiteral("reboot"), [](WifiLampClient *client){ client->reboot(); } },
{ QStringLiteral("delete"), [](WifiLampClient *client){ client->deleteLater(); } }
};
{

View File

@@ -91,7 +91,7 @@ void WifiLampClient::readyRead()
if(m_waitingForName)
{
const auto iter = std::find_if(m_application.clients().constBegin(), m_application.clients().constEnd(),
[&line](auto client) { return client->name() == line; });
[&line](WifiLampClient *client) { return client->name() == line; });
if(iter != m_application.clients().constEnd())
delete *iter;