bugfix/feat: main loading bar, add bar for sender

This commit is contained in:
semenov
2024-09-24 13:23:29 +03:00
parent 95c281dba1
commit ad7fe8ccb6
24 changed files with 1016 additions and 143 deletions

View File

@@ -65,7 +65,8 @@ void SendSystem::sendFileBlock(QString path)
stream << PacketType::TYPE_FILE; //Отправляем тип блока
stream << path << fileSize;
socket->waitForBytesWritten();
socket->waitForReadyRead(20);
//socket->waitForBytesWritten();
if(file.open(QFile::ReadOnly)){
while(!file.atEnd()){
@@ -80,10 +81,11 @@ void SendSystem::sendFileBlock(QString path)
file.close();
emit sigSend();
//qDebug() << "Transaction after send file: " << socket->isTransactionStarted();
countSend = 0;
socket->waitForBytesWritten();
socket->waitForReadyRead(100);
//socket->waitForBytesWritten();
socket->waitForReadyRead(20);
}
void SendSystem::sendFolderBlock(QString path)
@@ -93,6 +95,7 @@ void SendSystem::sendFolderBlock(QString path)
stream << PacketType::TYPE_FOLDER;
stream << path;
emit sigSend();
socket->waitForReadyRead(100);
}
@@ -113,16 +116,16 @@ void SendSystem::sendXMLAnswer(QByteArray array)
stream << array;
socket->waitForBytesWritten();
socket->waitForReadyRead(100);
}
void SendSystem::sendFinish()
{
socket->waitForReadyRead();
socket->waitForReadyRead(100);
QDataStream stream(socket);
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
stream << PacketType::TYPE_FINISH;
socket->waitForReadyRead(100);
}