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

@@ -16,22 +16,21 @@
namespace FileManagement
{
CBI_PdfDownload::CBI_PdfDownload(unsigned short port)
: CommandInterface(port, "PDF_DOWNLOAD")
{}
CBI_PdfDownload::CBI_PdfDownload(unsigned short port) : CommandInterface(port, "PDF_DOWNLOAD"),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
void CBI_PdfDownload::handleCommandInternal(const QVector<QByteArray> &args)
{
setAutoWriteEOL(false);
DEBUG_LOG() << "Got command for PDF download";
DEBUG_LOG(m_logger) << "Got command for PDF download";
if (args.count() != 1)
{
ERROR_LOG() << "Invalid arg count";
ERROR_LOG(m_logger) << "Invalid arg count";
return;
}
DEBUG_LOG() << "Argument count ok";
DEBUG_LOG(m_logger) << "Argument count ok";
bool bOk;
int documentId = args.at(0).toInt(&bOk);
@@ -40,10 +39,10 @@ void CBI_PdfDownload::handleCommandInternal(const QVector<QByteArray> &args)
{
const QString err(QStringLiteral("Invalid file id: '%1'").arg(QString::fromUtf8(args.at(0))));
writeError(err);
ERROR_LOG() << err;
ERROR_LOG(m_logger) << err;
return;
}
DEBUG_LOG() << "Argument ok";
DEBUG_LOG(m_logger) << "Argument ok";
MainHandler *mainHandler = static_cast<MainHandler *>(TcpServer::instance(port())->userData());
@@ -54,22 +53,22 @@ void CBI_PdfDownload::handleCommandInternal(const QVector<QByteArray> &args)
{
const QString err(QStringLiteral("File with ID '%1' does not exist").arg(QString::fromUtf8(args.at(0))));
writeError(err);
ERROR_LOG() << err;
ERROR_LOG(m_logger) << err;
return;
}
DEBUG_LOG() << "File ID valid";
DEBUG_LOG(m_logger) << "File ID valid";
if (fileContent.fileTypeId != FileManagement::FileType::Pdf)
{
const QString err(QStringLiteral("File with ID '%1' is not of type Pdf").arg(QString::fromUtf8(args.at(0))));
writeError(err);
ERROR_LOG() << err;
ERROR_LOG(m_logger) << err;
return;
}
DEBUG_LOG() << "FileType valid";
DEBUG_LOG(m_logger) << "FileType valid";
// success
DEBUG_LOG() << "File ok, sending file \"" << fileContent.name << "\" with ID " << fileContent.id;
DEBUG_LOG(m_logger) << "File ok, sending file \"" << fileContent.name << "\" with ID " << fileContent.id;
writeData(fileContent.content);
}