hotfix: multithread loading

This commit is contained in:
semenov
2025-08-07 16:47:15 +03:00
parent 28ea4338e0
commit d58835d9d6
12 changed files with 338 additions and 312 deletions

View File

@@ -34,7 +34,7 @@ void RecognizeSystem::initialize(UpdateController *updateController,DataParser*
void RecognizeSystem::recognize()
{
mutex->lock();
QMutexLocker locker(mutex);
qDebug() << "Recognize thread ID " << QThread::currentThreadId();
QDataStream stream(socket);
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
@@ -61,7 +61,7 @@ void RecognizeSystem::recognize()
continue;
}
if(client->GETTYPE() == TypeClientAutorization::TYPE_UNITY_CLIENT)
if(client->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT)
{
char *read = new char[4];
stream.readRawData(read,4);
@@ -110,7 +110,7 @@ void RecognizeSystem::recognize()
if (packetType == PacketType::TYPE_XMLANSWER)
{
if(clientHandler->getClient()->GETTYPE() == TypeClientAutorization::TYPE_UNITY_CLIENT)
if(clientHandler->getClient()->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT)
{
data = socket->readAll();
}
@@ -130,7 +130,7 @@ void RecognizeSystem::recognize()
if(packetType == PacketType::TYPE_BIGXML)
{
if (clientHandler->getClient()->GETTYPE() == TypeClientAutorization::TYPE_UNITY_CLIENT)
if (clientHandler->getClient()->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT)
{
char *readBuffer = new char[4];
socket->read(readBuffer,4);
@@ -183,7 +183,7 @@ void RecognizeSystem::recognize()
if(packetType == PacketType::TYPE_FOLDER) //создание папок
{
if(client->GETTYPE() == TypeClientAutorization::TYPE_UNITY_CLIENT)
if(client->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT)
{
filePath = socket->readAll();
filePath = Tools::createSharedPath(filePath);
@@ -215,7 +215,7 @@ void RecognizeSystem::recognize()
if (packetType == PacketType::TYPE_FILE) //выгрузка одного файла
{
if(client->GETTYPE() == TypeClientAutorization::TYPE_UNITY_CLIENT)
if(client->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT)
{
DataInfo *currentFileData = updateController->getCurrentDataInfo();
filePath = currentFileData->path;
@@ -311,7 +311,7 @@ void RecognizeSystem::recognize()
if(socket->state() == QAbstractSocket::UnconnectedState){
qDebug() << "UNCONNECT";
mutex->unlock();
//mutex->unlock();
file.close();
return;
}
@@ -435,7 +435,7 @@ void RecognizeSystem::recognize()
packetType = PacketType::TYPE_NONE;
}
mutex->unlock();
//mutex->unlock();
}
void RecognizeSystem::packetTypeInit(PacketType packet,Client *client)
@@ -444,7 +444,7 @@ void RecognizeSystem::packetTypeInit(PacketType packet,Client *client)
{
client->setUnity(TypeClientAutorization::TYPE_QT_CLIENT);
qDebug() << "ConnectionType isUnity: " << client->GETTYPE();
qDebug() << "ConnectionType isUnity: " << client->getClientType();
}
else if (packet == PacketType::TYPE_UNITY)
{