refactor(ipc): add missing use of at for lists
This commit is contained in:
parent
d1074f64ae
commit
e293d4eb8c
3 changed files with 5 additions and 5 deletions
|
|
@ -59,7 +59,7 @@ void DaemonIpcServer::processLogLevel(QLocalSocket *&clientSocket, const QString
|
|||
return;
|
||||
}
|
||||
|
||||
const auto &logLevel = messageParts[1];
|
||||
const auto &logLevel = messageParts.at(1);
|
||||
if (logLevel.isEmpty()) {
|
||||
LOG_ERR("daemon ipc server got empty log level");
|
||||
writeToClientSocket(clientSocket, kErrorMessage);
|
||||
|
|
@ -79,7 +79,7 @@ void DaemonIpcServer::processElevate(QLocalSocket *&clientSocket, const QStringL
|
|||
return;
|
||||
}
|
||||
|
||||
const auto &elevate = messageParts[1];
|
||||
const auto &elevate = messageParts.at(1);
|
||||
if (elevate != QStringLiteral("yes") && elevate != QStringLiteral("no")) {
|
||||
LOG_ERR("daemon ipc server got invalid elevate value: %s", elevate.toUtf8().constData());
|
||||
writeToClientSocket(clientSocket, kErrorMessage);
|
||||
|
|
@ -99,7 +99,7 @@ void DaemonIpcServer::processCommandMessage(QLocalSocket *&clientSocket, const Q
|
|||
return;
|
||||
}
|
||||
|
||||
const auto &command = messageParts[1];
|
||||
const auto &command = messageParts.at(1);
|
||||
if (command.isEmpty()) {
|
||||
LOG_ERR("daemon ipc server got empty command");
|
||||
writeToClientSocket(clientSocket, kErrorMessage);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ CoreIpcClient::CoreIpcClient(QObject *parent) : IpcClient(parent, kCoreIpcName,
|
|||
|
||||
void CoreIpcClient::processCommand(const QString &command, const QStringList &parts)
|
||||
{
|
||||
const auto args = parts.size() >= 2 ? parts[1] : QString();
|
||||
const auto args = parts.size() >= 2 ? parts.at(1) : QString();
|
||||
Q_EMIT commandReceived(command, args);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ void DaemonIpcClient::requestLogPath()
|
|||
void DaemonIpcClient::processCommand(const QString &command, const QStringList &parts)
|
||||
{
|
||||
if (command == QStringLiteral("logPath") && parts.size() == 2) {
|
||||
Q_EMIT logPathReceived(parts[1]);
|
||||
Q_EMIT logPathReceived(parts.at(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue