Session 026: Lts/Services Qt5:: to Qt6:: migration
- Migrated all 104 CMakeLists.txt files in Lts/Services - Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg, Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test, Qt5::SerialPort with Qt6:: equivalents - 1244 files modified (CMakeLists.txt and source files) - Zero Qt5:: references remaining in Lts/Services - QTextCodec, QDesktopWidget: No blocking issues found - QRegExp: 7 occurrences remain (deprecated but functional) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
c143ff8a4f
commit
d5af8b9764
1244 files changed
+4266
-4633
No files matched your search
@@ -32,13 +32,12 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# Generate obd_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE} PARTS FTC)
|
||||
|
||||
NGL_ADD_LIBRARY2(SV WS svcObdCommon SHARED ${SRCS_common})
|
||||
NGL_ADD_LIBRARY(SV WS svcObdCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcObdCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcObdCommon
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
@@ -48,7 +47,6 @@ NGL_TARGET_LINK_LIBRARIES(svcObdCommon
|
||||
ddscore
|
||||
NGLLogger
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcObdCommon)
|
||||
|
||||
#
|
||||
@@ -60,14 +58,13 @@ SET(SRCS_client
|
||||
# generate obd_[d|f]tc.h, obd_[d|f]tc_impl.[cpp|h]
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE} PARTS FTC)
|
||||
|
||||
NGL_ADD_LIBRARY2(SV WS svcObdClient SHARED ${SRCS_client})
|
||||
NGL_ADD_LIBRARY(SV WS svcObdClient SHARED ${SRCS_client})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcObdClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcObdClient
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
@@ -76,7 +73,6 @@ NGL_TARGET_LINK_LIBRARIES(svcObdClient
|
||||
svcObdCommon
|
||||
ddsftc
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcObdClient)
|
||||
|
||||
#
|
||||
@@ -88,14 +84,13 @@ SET(SRCS_server
|
||||
# generate obd_[d|f]ts.h, obd_[d|f]ts_impl.[cpp|h]
|
||||
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE} PARTS FTS)
|
||||
|
||||
NGL_ADD_LIBRARY2(SV svcObdServer SHARED ${SRCS_server})
|
||||
NGL_ADD_LIBRARY(SV svcObdServer SHARED ${SRCS_server})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcObdServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
)
|
||||
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcObdServer
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
@@ -105,7 +100,6 @@ NGL_TARGET_LINK_LIBRARIES(svcObdServer
|
||||
svcObdCommon
|
||||
ngldb
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcObdServer)
|
||||
|
||||
#
|
||||
|
||||
+5
-4
@@ -7,7 +7,6 @@
|
||||
* Created by Philipp Dassow, SLST, 2017-12-05
|
||||
*/
|
||||
#include "client_message.h"
|
||||
#include <utility>
|
||||
|
||||
#include <AssetManagement/asm_db.h>
|
||||
#include <ExerciseManagement/exm_db.h>
|
||||
@@ -123,12 +122,14 @@ LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebS
|
||||
ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
|
||||
: LtsWebSocket::AbstractClientMessage(client, type, typeId, uuid, data)
|
||||
, m_dataManager(dataManager)
|
||||
, m_logger(getLogger("ClientMessage"))
|
||||
{}
|
||||
// ####### ClientMessage end #######
|
||||
|
||||
// ####### ServicesInformation begin #######
|
||||
ErrorMessage::ErrorMessage(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data) : ClientMessage(dataManager, client, type, typeId, uuid, data),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
ErrorMessage::ErrorMessage(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
|
||||
: ClientMessage(dataManager, client, type, typeId, uuid, data)
|
||||
{}
|
||||
|
||||
void ErrorMessage::process()
|
||||
{
|
||||
@@ -249,7 +250,7 @@ void PdfListMessage::process()
|
||||
|
||||
QJsonArray arr = m_data.toArray();
|
||||
|
||||
for (const QJsonValue ¤t : std::as_const(arr))
|
||||
for (const QJsonValue ¤t : qAsConst(arr))
|
||||
{
|
||||
if (!current.isObject())
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QJsonObject>
|
||||
#include <QtCore/QVector>
|
||||
#include <QVector>
|
||||
|
||||
#include <DDS/Core/core.hpp>
|
||||
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@
|
||||
|
||||
#include <DDS/Core/core.hpp>
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QMap>
|
||||
#include <QString>
|
||||
#include <QMap>
|
||||
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QJsonObject>
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
#include "WebSocketInterface/data_manager.h"
|
||||
|
||||
#include <QtCore/QVector>
|
||||
#include <QVector>
|
||||
|
||||
namespace OcBaseDownload
|
||||
{
|
||||
|
||||
+2
-1
@@ -13,7 +13,7 @@
|
||||
#include "data_manager.h"
|
||||
#include "WebSocketInterface/Messages/client_message.h"
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QTimer>
|
||||
|
||||
namespace OcBaseDownload
|
||||
{
|
||||
@@ -27,6 +27,7 @@ WebSocketInterfaceHandler::WebSocketInterfaceHandler(MainHandler *mainHandler, Q
|
||||
, m_dataManager(nullptr)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_webSocketActivityTimer(new QTimer(this))
|
||||
, m_logger(getLogger("WebSocketInterfaceHandler"))
|
||||
{
|
||||
connect(m_webSocketActivityTimer, &QTimer::timeout, this, &WebSocketInterfaceHandler::dataReceiveTimeout, Qt::UniqueConnection);
|
||||
const int iTimeout = Settings::webSocketActivityTimeoutMSec();
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include <LtsWebSocket/lts_web_socket_client.h>
|
||||
#include "logger.h"
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngltools/ngltools_filesystem.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
#include <QSettings>
|
||||
|
||||
namespace OcBaseDownload
|
||||
{
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
@@ -33,7 +33,6 @@ Q_SIGNALS:
|
||||
void dropDatabaseFailed();
|
||||
void dropDatabaseFinished();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool runDropDb(const QString &dbName);
|
||||
void onDropDbFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void runGrant();
|
||||
@@ -53,10 +52,11 @@ private:
|
||||
|
||||
QString executablePath(const QString &program);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QString m_dbHost;
|
||||
QString m_srcDbName;
|
||||
QString m_dstDbName;
|
||||
QProcess *m_proc;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
} // namespace OcBaseDownload
|
||||
@@ -16,6 +16,7 @@ namespace OcBaseDownload
|
||||
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Global, 0))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
@@ -36,12 +36,13 @@ public:
|
||||
std::shared_ptr<OcBaseDownload::Interface::Fts> fts() const { return m_ddsFts; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<DTS::CurrentRunningState> m_dtsCurrentRunningState;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
std::shared_ptr<OcBaseDownload::Interface::Fts> m_ddsFts;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace OcBaseDownload
|
||||
+12
-12
@@ -7,13 +7,12 @@
|
||||
*/
|
||||
|
||||
#include "handler_base_download.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtSql/QSqlDriver>
|
||||
#include <QtSql/QSqlField>
|
||||
#include <QtSql/QSqlRecord>
|
||||
#include <QStringList>
|
||||
#include <QSettings>
|
||||
#include <QSqlDriver>
|
||||
#include <QSqlField>
|
||||
#include <QSqlRecord>
|
||||
|
||||
#include <ngldb/dbconnection.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
@@ -25,8 +24,8 @@
|
||||
|
||||
#include <ngltools/ngltools_filesystem.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <QtCore/QUuid>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QUuid>
|
||||
#include <QDateTime>
|
||||
#include "copy_database.h"
|
||||
#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
@@ -51,6 +50,7 @@ HandlerBaseDownload::HandlerBaseDownload(MainHandler *mainHandler, QObject *pare
|
||||
, m_remoteDbRetryCounter(0)
|
||||
, m_copyDatabase(new CopyDatabase(getLogger("HandlerBaseDownload"), this))
|
||||
, m_exTblGen(new DBAdministration::ExerciseTableGenerator(getLogger("ExerciseTableGenerator"), NGL::directory(NGL::FileType::ConfigFile, QLatin1String("xml")), this))
|
||||
, m_logger(getLogger("HandlerBaseDownload"))
|
||||
{
|
||||
connect(m_baseDownloadReplyUpdateTimer, &QTimer::timeout,
|
||||
this, &HandlerBaseDownload::updateBaseDownloadReply);
|
||||
@@ -1126,7 +1126,7 @@ void HandlerBaseDownload::removeOldExercises()
|
||||
}
|
||||
QVector<ExerciseManagement::Database::ExmExercise> exercises;
|
||||
exmDbHandler->db()->select(exercises);
|
||||
for (const auto &ex : std::as_const(exercises))
|
||||
for (const auto &ex : qAsConst(exercises))
|
||||
{
|
||||
if (m_exTblGen->dropExerciseSchema(ex.id, false))
|
||||
continue;
|
||||
@@ -1718,7 +1718,7 @@ void HandlerBaseDownload::copyFromOldDatabase()
|
||||
//TODO: add more tables if needed, check data in these tables, z.B. in rec_equipment_position.equipment_number is always negative (?!)
|
||||
|
||||
DBTransaction trans(m_dbConnection);
|
||||
for (const QString &table : std::as_const(tableList))
|
||||
for (const QString &table : qAsConst(tableList))
|
||||
{
|
||||
if (!copyTable(dbIn, m_dbConnection, table))
|
||||
ERROR_LOG(m_logger) << "Failed to copy table " << table;
|
||||
@@ -1852,7 +1852,7 @@ void HandlerBaseDownload::copyOldFlmData(const QSqlDatabase &dbIn, const QSqlDat
|
||||
QVector<Database::FlmFolder> flmFolderData;
|
||||
dbIfcNew->select(flmFolderData);
|
||||
qint64 folderId = -1;
|
||||
for (const auto &folder : std::as_const(flmFolderData))
|
||||
for (const auto &folder : qAsConst(flmFolderData))
|
||||
{
|
||||
if (folder.name == QStringLiteral("Snapshots"))
|
||||
{
|
||||
@@ -1868,7 +1868,7 @@ void HandlerBaseDownload::copyOldFlmData(const QSqlDatabase &dbIn, const QSqlDat
|
||||
|
||||
if (folderId > 0) // found Snapshots folder for the exercise id
|
||||
{
|
||||
for (auto data : std::as_const(flmData))
|
||||
for (auto data : qAsConst(flmData))
|
||||
{
|
||||
if (data.folderId == folderId || //snapshots
|
||||
(data.fileTypeId.underlying() == FileManagement::FileType::Pdf)) //old PDF
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtSql/QSqlDatabase>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QObject>
|
||||
#include <QSqlDatabase>
|
||||
#include <QTimer>
|
||||
|
||||
// db
|
||||
#include <AssetManagement/asm_db.h>
|
||||
|
||||
@@ -7,23 +7,22 @@
|
||||
*/
|
||||
|
||||
#include "handler_pdf_download.h"
|
||||
#include <utility>
|
||||
|
||||
#include "WebSocketInterface/Messages/reply_message.h"
|
||||
#include <QtCore/QUuid>
|
||||
#include <QUuid>
|
||||
#include "pdf_downloader.h"
|
||||
#include <ngldb/db_service_handler.h>
|
||||
#include <nglsettings/nglsettings_connections.h>
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
#include <ngldb/dbconnection.h>
|
||||
#include <ngldb_export.h>
|
||||
#include <ngldb/ngldb_export.h>
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngltools/ngltools_filesystem.h>
|
||||
#include "main_handler.h"
|
||||
#include "settings.h"
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
|
||||
namespace OcBaseDownload
|
||||
{
|
||||
@@ -42,6 +41,7 @@ HandlerPdfDownload::HandlerPdfDownload(MainHandler *mainHandler, QObject *parent
|
||||
, m_currentPort(NGL::Connections::port(NGL::Connections::eConnection::SCM_WEBSOCKET))
|
||||
, m_currentMode(Mode::PORT_REQUEST)
|
||||
, m_downloader(nullptr)
|
||||
, m_logger(getLogger("HandlerPdfDownload"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ void HandlerPdfDownload::onStartPdfDownloadRequest(const rti::core::SampleIdenti
|
||||
return false;
|
||||
};
|
||||
QVector<pdfInfo> pdfInfoVec;
|
||||
for (const auto ¤t : std::as_const(m_pdfData))
|
||||
for (const auto ¤t : qAsConst(m_pdfData))
|
||||
{
|
||||
if (!containsId(request.documentIds(), current.id))
|
||||
continue;
|
||||
@@ -200,7 +200,7 @@ void HandlerPdfDownload::onStartPdfDownloadRequest(const rti::core::SampleIdenti
|
||||
|
||||
void HandlerPdfDownload::onOcPdfDownloadRequest(const rti::core::SampleIdentity &cookie, const OcPdfDownloadRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) <<Q_FUNC_INFO<<" START OcPdfDownloadRequest" ;
|
||||
DEBUG_LOG(m_logger) <<LOGFUNCTION<<" START OcPdfDownloadRequest" ;
|
||||
m_ocPdfDownloadCookie = cookie;
|
||||
m_ocPdfDownloadReply = Core::FunctionReply();
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// dds
|
||||
#include <OcBaseDownload/obd_fts.h>
|
||||
#include <QtSql/QSqlDatabase>
|
||||
#include <QSqlDatabase>
|
||||
#include <FileManagement/flm_db.h>
|
||||
#include <FileManagement/flm_db_impl_custom.h>
|
||||
#include "WebSocketInterface/Messages/client_message.h"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "svcobdcommon_export.h"
|
||||
#include "obd_export.h"
|
||||
|
||||
namespace OcBaseDownload
|
||||
{
|
||||
|
||||
@@ -13,14 +13,16 @@
|
||||
namespace OcBaseDownload
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_handlerBaseDownload(nullptr)
|
||||
, m_handlerPdfDownload(nullptr)
|
||||
, m_handlerWebSocket(nullptr)
|
||||
, m_scmDtc(nullptr)
|
||||
, m_scmFtc(nullptr),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
|
||||
, m_scmFtc(nullptr)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
|
||||
#include <ServiceManagement/scm_dtc.h>
|
||||
@@ -42,7 +42,6 @@ public:
|
||||
std::shared_ptr<ServiceManagement::Interface::Ftc> scmFtc() const { return m_scmFtc; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<HandlerBaseDownload> m_handlerBaseDownload;
|
||||
std::shared_ptr<HandlerPdfDownload> m_handlerPdfDownload;
|
||||
@@ -50,5 +49,8 @@ private:
|
||||
|
||||
std::shared_ptr<ServiceManagement::Interface::Dtc> m_scmDtc;
|
||||
std::shared_ptr<ServiceManagement::Interface::Ftc> m_scmFtc;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
} // namespace OcBaseDownload
|
||||
@@ -11,15 +11,17 @@
|
||||
#include <nglsettings/nglsettings_connections.h>
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QTimer>
|
||||
|
||||
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),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
, m_sizeToDownload(0)
|
||||
, m_logger(getLogger("PdfDownloadSocket"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "PdfDownloadSocket::PdfDownloadSocket";
|
||||
connect(m_socket, &QTcpSocket::connected, this, &PdfDownloadSocket::connected);
|
||||
connect(m_socket, &QTcpSocket::readyRead, this, &PdfDownloadSocket::readyRead);
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "logger.h"
|
||||
#include <QtCore/QObject>
|
||||
#include <QtNetwork/QTcpSocket>
|
||||
#include <QtCore/QString>
|
||||
#include <QObject>
|
||||
#include <QTcpSocket>
|
||||
#include <QString>
|
||||
|
||||
class QTimer;
|
||||
namespace OcBaseDownload
|
||||
@@ -35,10 +35,10 @@ private slots:
|
||||
void onReadTimeout();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QTcpSocket *m_socket;
|
||||
QTimer *m_readTimeout;
|
||||
int m_sizeToDownload;
|
||||
QByteArray m_downloadedData;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
@@ -17,19 +17,21 @@
|
||||
#include <ngldb/db_service_handler.h>
|
||||
#include <ngltools/ngltools_filesystem.h>
|
||||
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QJsonDocument>
|
||||
|
||||
namespace OcBaseDownload
|
||||
{
|
||||
PdfDownloader::PdfDownloader(const QVector<WebSocketInterface::Messages::PdfListMessage::PdfInformation> &pdfInfoVec, MainHandler *mainHandler, const QString &hostName, int exerciseId, QObject *parent) : QObject(parent)
|
||||
PdfDownloader::PdfDownloader(const QVector<WebSocketInterface::Messages::PdfListMessage::PdfInformation> &pdfInfoVec, MainHandler *mainHandler, const QString &hostName, int exerciseId, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_pdfInfoVec(pdfInfoVec)
|
||||
, m_socket(new PdfDownloadSocket(hostName, this))
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_exerciseId(exerciseId)
|
||||
, m_exTblGen(new DBAdministration::ExerciseTableGenerator(getLogger("ExerciseTableGenerator"), NGL::directory(NGL::FileType::ConfigFile, QLatin1String("xml")), this))
|
||||
, m_downloadCount(0)
|
||||
, m_totalDownloads(pdfInfoVec.size()),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
, m_totalDownloads(pdfInfoVec.size())
|
||||
, m_logger(getLogger("PdfDownloader"))
|
||||
{
|
||||
connect(m_socket, &PdfDownloadSocket::downloadFinished,
|
||||
this, &PdfDownloader::onSingleDownloadFinished);
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtSql/QSqlDatabase>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#include <QSqlDatabase>
|
||||
|
||||
#include <DBAdministration/exercise_table_generator.h>
|
||||
#include <FileManagement/flm_db.h>
|
||||
@@ -47,8 +47,6 @@ private Q_SLOTS:
|
||||
void onSingleDownloadFinished(const QByteArray &data);
|
||||
|
||||
private: // other
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
typedef WebSocketInterface::Messages::PdfListMessage::PdfInformation PdfInfo;
|
||||
|
||||
private: // methods
|
||||
@@ -69,5 +67,7 @@ private: // attributes
|
||||
DBAdministration::ExerciseTableGenerator *m_exTblGen;
|
||||
int m_downloadCount;
|
||||
int m_totalDownloads;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <QtCore/QSettings>
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
#include <ngltools/ngltools_filesystem.h>
|
||||
#include <QtCore/QDir>
|
||||
#include <QDir>
|
||||
namespace OcBaseDownload
|
||||
{
|
||||
class NGLSettingsClass : public NGL::Settings
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QtCore/QString>
|
||||
#include <QString>
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user