Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -15,20 +15,19 @@
namespace OcBaseDownload
{
PdfDownloadSocket::PdfDownloadSocket(const QString &hostName, QObject *parent)
: QObject(parent)
PdfDownloadSocket::PdfDownloadSocket(const QString &hostName, QObject *parent) : QObject(parent)
, m_socket(new QTcpSocket(this))
, m_readTimeout(new QTimer(this))
, m_sizeToDownload(0)
{
DEBUG_LOG() << "PdfDownloadSocket::PdfDownloadSocket";
, m_sizeToDownload(0),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
DEBUG_LOG(m_logger) << "PdfDownloadSocket::PdfDownloadSocket";
connect(m_socket, &QTcpSocket::connected, this, &PdfDownloadSocket::connected);
connect(m_socket, &QTcpSocket::readyRead, this, &PdfDownloadSocket::readyRead);
unsigned short port = NGL::Connections::port(NGL::Connections::eConnection::FLM_PDF_SERVER);
m_socket->connectToHost(hostName, port);
m_socket->waitForConnected();
DEBUG_LOG() << "hostname " << hostName << " port " << port;
DEBUG_LOG(m_logger) << "hostname " << hostName << " port " << port;
m_readTimeout->setInterval(10000);
m_readTimeout->setSingleShot(false);
@@ -37,23 +36,23 @@ PdfDownloadSocket::PdfDownloadSocket(const QString &hostName, QObject *parent)
PdfDownloadSocket::~PdfDownloadSocket()
{
DEBUG_LOG() << "~PdfDownloadSocket";
DEBUG_LOG(m_logger) << "~PdfDownloadSocket";
m_socket->close();
}
void PdfDownloadSocket::readyRead()
{
DEBUG_LOG() << "reading...";
DEBUG_LOG(m_logger) << "reading...";
m_readTimeout->stop();
m_downloadedData.append(m_socket->readAll());
DEBUG_LOG() << m_downloadedData.size() << " of " << m_sizeToDownload << " bytes downloaded";
DEBUG_LOG(m_logger) << m_downloadedData.size() << " of " << m_sizeToDownload << " bytes downloaded";
if (m_downloadedData.size() >= m_sizeToDownload)
{
m_sizeToDownload = 0;
DEBUG_LOG() << "Download finished";
DEBUG_LOG(m_logger) << "Download finished";
emit downloadFinished(m_downloadedData);
}
else
@@ -62,17 +61,17 @@ void PdfDownloadSocket::readyRead()
void PdfDownloadSocket::connected()
{
DEBUG_LOG() << "connected...";
DEBUG_LOG(m_logger) << "connected...";
}
void PdfDownloadSocket::onReadTimeout()
{
//check for filesize
m_readTimeout->stop();
DEBUG_LOG() << "TimerEnd" << m_downloadedData.size() << " expected " << m_sizeToDownload;
DEBUG_LOG(m_logger) << "TimerEnd" << m_downloadedData.size() << " expected " << m_sizeToDownload;
if (m_downloadedData.size() < m_sizeToDownload)
WARNING_LOG() << "not enough data: got " << m_downloadedData.size() << " expected " << m_sizeToDownload;
WARNING_LOG(m_logger) << "not enough data: got " << m_downloadedData.size() << " expected " << m_sizeToDownload;
emit downloadFinished(m_downloadedData);
}
@@ -89,7 +88,7 @@ void PdfDownloadSocket::downloadFromHost(const int fileId, const qint64 fileSize
m_socket->readAll();
int writeHeaderSize = m_socket->write(cmd);
DEBUG_LOG() << "writeHeaderSize = " << writeHeaderSize;
DEBUG_LOG(m_logger) << "writeHeaderSize = " << writeHeaderSize;
m_readTimeout->start();
}