refactoring: naming notify

This commit is contained in:
semenov
2024-08-28 10:44:35 +03:00
parent 1e4e16971b
commit 52ec9f273f
14 changed files with 66 additions and 57 deletions

View File

@@ -50,25 +50,6 @@ void RecognizeSystem::Recognize(QTcpSocket *socket)
//qDebug() << Tools::GetTime() << "CLIENT: type: " << packetType;
}
if(packetType == PacketType::TYPE_MSG){ //поведение на тип пакета с сообщением
stream.startTransaction();
stream >> message;
if(!stream.commitTransaction()){
emit onSendDebugLog(Tools::GetTime() + "CLIENT: Message - FAIL commitTransaction");
if(socket->waitForReadyRead(TCP_READ_TIMEOUT)){
emit onSendDebugLog(Tools::GetTime() + "ERROR: MESSAGE READ TIMEOUT");
return;
}
continue;
}
emit onSendDebugLog(Tools::GetTime() + " CLIENT: Message from server " + message); //результат обрабатывать тут?
packetType = PacketType::TYPE_NONE;
continue;
}
if(packetType == PacketType::TYPE_FOLDER){ //создание папок
stream.startTransaction();
stream >> filePath;
@@ -227,14 +208,16 @@ void RecognizeSystem::Recognize(QTcpSocket *socket)
if(packetType == PacketType::TYPE_NEEDUPDATE){ //нужно обновление
bool flag;
quint64 size;
bool flag = false;
quint64 size = 0;
quint64 fileCount = 0;
stream.startTransaction();
stream >> flag;
stream >> size;
stream >> fileCount;
emit onNeedUpdate(flag,size);
emit onNeedUpdate(flag,size,fileCount);
packetType = PacketType::TYPE_NONE;
}