Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+24
-31
@@ -1,63 +1,56 @@
|
||||
|
||||
|
||||
|
||||
#include "client_message.h"
|
||||
|
||||
#include "json_keys.h"
|
||||
#include "message_handler.h"
|
||||
|
||||
namespace LtsProjectionWorkstation
|
||||
{
|
||||
|
||||
|
||||
|
||||
LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebSocket::ReplyHandler *client, const QString &message)
|
||||
LtsWebSocket::AbstractClientMessage* ClientMessageFactory::createMessage(LtsWebSocket::ReplyHandler* client,
|
||||
const QString& message)
|
||||
{
|
||||
LtsWebSocket::AbstractClientMessage *result = checkAttributes(client, message);
|
||||
LtsWebSocket::AbstractClientMessage* result = checkAttributes(client, message);
|
||||
|
||||
if (result)
|
||||
return result;
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
if (m_type == JsonKeys::LOGIN_REQUEST())
|
||||
result = new LoginRequest(m_messageHandler, client, m_type, m_uuid, m_data);
|
||||
if (m_type == JsonKeys::LOGIN_REQUEST())
|
||||
result = new LoginRequest(m_messageHandler, client, m_type, m_uuid, m_data);
|
||||
|
||||
if (m_type == JsonKeys::LOGOUT_REQUEST())
|
||||
result = new LoginRequest(m_messageHandler, client, m_type, m_uuid, m_data);
|
||||
if (m_type == JsonKeys::LOGOUT_REQUEST())
|
||||
result = new LoginRequest(m_messageHandler, client, m_type, m_uuid, m_data);
|
||||
|
||||
return checkResult(client, message, result);
|
||||
return checkResult(client, message, result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LoginRequest::process()
|
||||
{
|
||||
if (hasValidData())
|
||||
{
|
||||
int userId = m_data.toObject().value(JsonKeys::USER_ID()).toInt(-1),
|
||||
userPriority = m_data.toObject().value(JsonKeys::USER_PRIORITY()).toInt(-1),
|
||||
exerciseId = m_data.toObject().value(JsonKeys::EXERCISE_ID()).toInt(-1);
|
||||
m_client->addReply(m_messageHandler->handleLoginRequest(userId, userPriority, exerciseId));
|
||||
}
|
||||
if (hasValidData())
|
||||
{
|
||||
int userId = m_data.toObject().value(JsonKeys::USER_ID()).toInt(-1),
|
||||
userPriority = m_data.toObject().value(JsonKeys::USER_PRIORITY()).toInt(-1),
|
||||
exerciseId = m_data.toObject().value(JsonKeys::EXERCISE_ID()).toInt(-1);
|
||||
m_client->addReply(m_messageHandler->handleLoginRequest(userId, userPriority, exerciseId));
|
||||
}
|
||||
}
|
||||
|
||||
bool LoginRequest::hasValidData() const
|
||||
{
|
||||
return m_data.isObject()
|
||||
&& m_data.toObject().value(JsonKeys::USER_ID()).toInt(-1) > -1
|
||||
&& m_data.toObject().value(JsonKeys::USER_PRIORITY()).toInt(-1) > -1
|
||||
&& m_data.toObject().value(JsonKeys::EXERCISE_ID()).toInt(-1) > -1;
|
||||
return m_data.isObject() && m_data.toObject().value(JsonKeys::USER_ID()).toInt(-1) > -1 &&
|
||||
m_data.toObject().value(JsonKeys::USER_PRIORITY()).toInt(-1) > -1 &&
|
||||
m_data.toObject().value(JsonKeys::EXERCISE_ID()).toInt(-1) > -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LogoutRequest::process()
|
||||
{
|
||||
m_client->addReply(m_messageHandler->handleLogoutRequest());
|
||||
m_client->addReply(m_messageHandler->handleLogoutRequest());
|
||||
}
|
||||
|
||||
bool LogoutRequest::hasValidData() const
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} // namespace LtsProjectionWorkstation
|
||||
Reference in new issue
Block a user