mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
bugfix/feat: main loading bar, add bar for sender
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user