Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung - 44 Export-Header Include-Pfade korrigiert (_export.h) - 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h) - INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros - Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits) - FATAL_LOG Makro hinzugefügt - InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h) - FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h) - AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp) - SymbolAppearance Klasse vollständig definiert mit content() Methode - BuildingComponentFilter Klasse definiert mit Copy-Konstruktor - Ftc Factory: nullptr Return (abstract class) - AesFilter Klasse in aes.hpp hinzugefügt - Dtc Klasse in ppm.hpp mit participantChanged Signal - AesType Enum: alle 15 At* Werte definiert - AesEffectState_def: EsReceived hinzugefügt - DataModification Enum: eAdded/eModified/eRemoved - function_reply_object.h → core_types.h Include-Pfad (72 Dateien) - Enum-Class-Streaming Template-Operator in INGLLogger.h - ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen - ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge - QRegExp → QRegularExpression in tpm_js_parser.cpp - .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert - Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2785 files changed
+18754
-18316
No files matched your search
+2
-3
@@ -22,7 +22,6 @@ namespace TakeHomePackageManager
|
||||
ExportedScriptsModel::ExportedScriptsModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<ExportedScriptInformation>(
|
||||
{ tr("id"), tr("Exercise"), tr("Name"), tr("Local version"), tr("Server version"), tr("Location"), tr("Upload status")}, parent)
|
||||
, m_logger(getLogger("ExportedScriptsModel"))
|
||||
{}
|
||||
|
||||
|
||||
@@ -209,11 +208,11 @@ void ExportedScriptsModel::setServerContent(const QString &jsonObject)
|
||||
}
|
||||
catch(const std::runtime_error &err)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "something went wrong: " << err.what();
|
||||
ERROR_LOG() << "something went wrong: " << err.what();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "something went wrong";
|
||||
ERROR_LOG() << "something went wrong";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -5,7 +5,7 @@
|
||||
#include <logger.h>
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <Common2/thp2common_export.h>
|
||||
#include "thp2common_export.h"
|
||||
#include <Common2Core/tpm_js_parser.h>
|
||||
|
||||
#include <QDateTime>
|
||||
@@ -53,6 +53,5 @@ private:
|
||||
bool m_isOC { false };
|
||||
QString m_rootDirectoryToScan;
|
||||
QFileSystemWatcher *m_watcher { nullptr };
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Common2/thp2common_export.h>
|
||||
#include "thp2common_export.h"
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
|
||||
#include <Common2/thp2common_export.h>
|
||||
#include "thp2common_export.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
-1
@@ -15,7 +15,6 @@ namespace TakeHomePackageManager
|
||||
TopicsModel::TopicsModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<Topic>(
|
||||
{ tr("id"), tr("Channel"), tr("Filter"), tr("Description"), tr("Type"), tr("Start [mm:ss]"), tr("Duration [mm:ss]")}, parent)
|
||||
, m_logger(getLogger("TopicsModel"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -3,7 +3,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <logger.h>
|
||||
#include <Common2/thp2common_export.h>
|
||||
#include "thp2common_export.h"
|
||||
#include <Common2Core/tpm_js_parser.h>
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
@@ -32,6 +32,5 @@ public:
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
+7
-4
@@ -9,6 +9,8 @@
|
||||
#include <LtsUtilsCore/json.h>
|
||||
|
||||
#include <QMapIterator>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatch>
|
||||
|
||||
#include <utility>
|
||||
|
||||
@@ -139,18 +141,19 @@ template<typename LtsJsonType, typename QJsonType>
|
||||
const QString opener((isObject) ? L("{") : L("["));
|
||||
const QString closer((isObject) ? L("}") : L("]"));
|
||||
|
||||
const QRegExp regexp(L(R"RRR(\%1[\S\s]*\%2)RRR").arg(opener, closer));
|
||||
const QRegularExpression regexp(L(R"RRR(\%1[\S\s]*\%2)RRR").arg(opener, closer));
|
||||
const QString topicsJsText(QString::fromUtf8(data));
|
||||
|
||||
|
||||
if (regexp.indexIn(topicsJsText) < 0)
|
||||
const QRegularExpressionMatch match = regexp.match(topicsJsText);
|
||||
if (!match.hasMatch())
|
||||
{
|
||||
|
||||
throw runtime_error(L("no %1 in js-file found").arg(isObject ? L("object") : L("array")).toStdString());
|
||||
}
|
||||
|
||||
|
||||
const QString jsonString(regexp.cap());
|
||||
const QString jsonString(match.captured());
|
||||
|
||||
|
||||
qWarning() << "jsonString" << jsonString;
|
||||
@@ -238,7 +241,7 @@ void ScriptsJsParser::save() noexcept(false)
|
||||
QMapIterator<QString, ExportedScriptInformation> it(m_esis);
|
||||
while (it.hasNext())
|
||||
{
|
||||
auto &esi = it.next().value();
|
||||
const ExportedScriptInformation esi = it.next().value();
|
||||
obj.insert(esi.id(), esi.toJson());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
|
||||
#include <Common2Core/thp2commoncore_export.h>
|
||||
#include "thp2commoncore_export.h"
|
||||
|
||||
|
||||
#include <LtsUtilsCore/json.h>
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
|
||||
#include <Common2Core/thp2commoncore_export.h>
|
||||
#include "thp2commoncore_export.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
+15
-17
@@ -41,7 +41,7 @@
|
||||
|
||||
|
||||
#ifndef ELOG
|
||||
#define ELOG ERROR_LOG(m_logger)
|
||||
#define ELOG ERROR_LOG()
|
||||
#endif
|
||||
|
||||
using err = std::runtime_error;
|
||||
@@ -125,14 +125,13 @@ void Compressor::go(ProcessOverlay *processOverlay, QIODevice &out, const QStrin
|
||||
|
||||
HttpProcess::HttpProcess(LtsWidgets::LtsDialog *dialog, const QString &statusMessage)
|
||||
: QObject()
|
||||
, m_logger(getLogger("ExportedScriptsDialog.HttpProcess"))
|
||||
, m_process(new ProcessOverlay)
|
||||
, m_nam(new QNetworkAccessManager)
|
||||
{
|
||||
connect(m_process, &ProcessOverlay::signalCancel,
|
||||
this, [this]()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "m_wasCanceled!!";
|
||||
DEBUG_LOG() << "m_wasCanceled!!";
|
||||
m_process->setCancelEnabled(false);
|
||||
emit signalCancel();
|
||||
});
|
||||
@@ -144,7 +143,7 @@ HttpProcess::HttpProcess(LtsWidgets::LtsDialog *dialog, const QString &statusMes
|
||||
|
||||
HttpProcess::~HttpProcess()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "~HttpProcess";
|
||||
DEBUG_LOG() << "~HttpProcess";
|
||||
m_process->deleteLater();
|
||||
m_nam->deleteLater();
|
||||
}
|
||||
@@ -362,7 +361,7 @@ void UploadProcess::go(const QString &rootFolder, const ExportedScriptInformatio
|
||||
connect(this, &HttpProcess::signalCancel, &compressor, &Compressor::abort);
|
||||
compressor.go(m_process, *tempFile.get(), srcDir, dstDir);
|
||||
|
||||
DEBUG_LOG(m_logger) << "posting file of size " << tempFile->size();
|
||||
DEBUG_LOG() << "posting file of size " << tempFile->size();
|
||||
tempFile->seek(0);
|
||||
|
||||
QNetworkReply *rep = post(L("/thp2"), tempFile.get(), {}, L("application/octet-stream"), { { L("x-thp-info"), QString::fromUtf8(QJsonDocument(esi.toJson().toObject()).toJson(QJsonDocument::JsonFormat::Compact)) } });
|
||||
@@ -529,7 +528,6 @@ ExportedScriptsDialog::ExportedScriptsDialog(LtsSession::LtsSession *session, QW
|
||||
, m_model(new ExportedScriptsModel(this))
|
||||
, m_ui(new Ui::ExportedScriptsDialog2)
|
||||
, m_session(session)
|
||||
, m_logger(getLogger("ExportedScriptsDialog2"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -588,7 +586,7 @@ ExportedScriptsDialog::ExportedScriptsDialog(LtsSession::LtsSession *session, QW
|
||||
connect(sock, &QWebSocket::disconnected,
|
||||
this, [this, sock, openFn]()
|
||||
{
|
||||
WARNING_LOG(m_logger) << "disconnected from ws... reconnecting in 3...";
|
||||
WARNING_LOG() << "disconnected from ws... reconnecting in 3...";
|
||||
setWsConnectionStatus(WsConnectionStatus::Disconnected);
|
||||
|
||||
QTimer *t = new QTimer(sock);
|
||||
@@ -609,7 +607,7 @@ ExportedScriptsDialog::ExportedScriptsDialog(LtsSession::LtsSession *session, QW
|
||||
connect(sock, &QWebSocket::textMessageReceived,
|
||||
this, [this](const QString &msg)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "new msg: '" << msg << "'";
|
||||
DEBUG_LOG() << "new msg: '" << msg << "'";
|
||||
m_lastServerContent = msg;
|
||||
m_model->setServerContent(msg);
|
||||
onSelectionChanged();
|
||||
@@ -759,7 +757,7 @@ void ExportedScriptsDialog::setWsConnectionStatusLabel()
|
||||
|
||||
void ExportedScriptsDialog::initModel() noexcept(false)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "(re)initModel !!";
|
||||
DEBUG_LOG() << "(re)initModel !!";
|
||||
|
||||
const QString rootDirectory(localThpDir());
|
||||
|
||||
@@ -770,7 +768,7 @@ void ExportedScriptsDialog::initModel() noexcept(false)
|
||||
catch(...)
|
||||
{
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Couldn't Load THP(s)"));
|
||||
WARNING_LOG(m_logger)<<" data corrupted path: "<< localThpDir();
|
||||
WARNING_LOG()<<" data corrupted path: "<< localThpDir();
|
||||
}
|
||||
|
||||
m_model->setOC(isOCApp());
|
||||
@@ -807,12 +805,12 @@ void ExportedScriptsDialog::uploadScript()
|
||||
}
|
||||
catch(const std::runtime_error &err)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Uploaded script FAILED: " << err.what();
|
||||
ERROR_LOG() << "Uploaded script FAILED: " << err.what();
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Uploading script failed: %1").arg(QString::fromUtf8(err.what())));
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Uploaded script successfully";
|
||||
DEBUG_LOG() << "Uploaded script successfully";
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Uploaded script successfully"));
|
||||
}
|
||||
|
||||
@@ -857,7 +855,7 @@ void ExportedScriptsDialog::downloadScript()
|
||||
}
|
||||
catch(const std::runtime_error &err)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Downloading script FAILED: " << err.what();
|
||||
ERROR_LOG() << "Downloading script FAILED: " << err.what();
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Downloading script failed: %1").arg(QString::fromUtf8(err.what())));
|
||||
return;
|
||||
}
|
||||
@@ -865,7 +863,7 @@ void ExportedScriptsDialog::downloadScript()
|
||||
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "Downloaded script successfully";
|
||||
DEBUG_LOG() << "Downloaded script successfully";
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Downloaded script successfully"));
|
||||
}
|
||||
|
||||
@@ -890,7 +888,7 @@ void ExportedScriptsDialog::removeScriptFromServer()
|
||||
}
|
||||
catch (const std::runtime_error &err)
|
||||
{
|
||||
ERROR_LOG(m_logger) << err.what();
|
||||
ERROR_LOG() << err.what();
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Failed to remove script from server!"));
|
||||
return;
|
||||
}
|
||||
@@ -943,7 +941,7 @@ void ExportedScriptsDialog::removeScriptLocal()
|
||||
}
|
||||
catch (const std::runtime_error &err)
|
||||
{
|
||||
ERROR_LOG(m_logger) << err.what();
|
||||
ERROR_LOG() << err.what();
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Failed to remove script locally!"));
|
||||
return;
|
||||
}
|
||||
@@ -967,7 +965,7 @@ void ExportedScriptsDialog::openScript()
|
||||
const auto path(QDir(scriptHtmlLocation(localThpDir(), esi.id())).path());
|
||||
const auto url(QUrl::fromLocalFile(path));
|
||||
const bool openUrlResult = QDesktopServices::openUrl(url);
|
||||
DEBUG_LOG(m_logger) << "path: " << path << " - url: " << url.toString() << " - success? " << openUrlResult;
|
||||
DEBUG_LOG() << "path: " << path << " - url: " << url.toString() << " - success? " << openUrlResult;
|
||||
}
|
||||
|
||||
}
|
||||
-3
@@ -78,8 +78,6 @@ protected:
|
||||
QNetworkReply *post(const QString &path, QIODevice *data, const QUrlQuery &q = QUrlQuery(), const QString &contentType = QStringLiteral("application/octet-stream"), const QMap<QString, QString> &additionalHeaders = {}) noexcept(false);
|
||||
QNetworkReply *get(const QString &path, const QUrlQuery &q = QUrlQuery()) noexcept(false);
|
||||
QNetworkReply *deleteResource(const QString &path, const QUrlQuery &q = QUrlQuery()) noexcept(false);
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
ProcessOverlay *m_process;
|
||||
|
||||
private:
|
||||
@@ -177,6 +175,5 @@ private:
|
||||
LtsSession::LtsSession *m_session;
|
||||
QString m_lastServerContent;
|
||||
WsConnectionStatus m_wsStatus { WsConnectionStatus::NotConnected };
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
+12
-16
@@ -63,7 +63,7 @@ WARNING_LOG(x)
|
||||
#endif
|
||||
|
||||
#ifndef ELOG
|
||||
#define ELOG ERROR_LOG(m_logger)
|
||||
#define ELOG ERROR_LOG()
|
||||
#endif
|
||||
|
||||
|
||||
@@ -80,15 +80,11 @@ USB2Dialog::USB2Dialog(LtsSession::LtsSession *session, QWidget *parent)
|
||||
, m_usbThpModel(new ExportedScriptsModel(this))
|
||||
, m_ui(new Ui::USB2Dialog)
|
||||
, m_session(session)
|
||||
|
||||
|
||||
|
||||
, m_logger(getLogger("USB2Dialog"))
|
||||
{
|
||||
|
||||
m_ui->setupUi(this);
|
||||
|
||||
WARNING_LOG(m_logger)<<" USB2Dialog::USB2Dialog() START ";
|
||||
WARNING_LOG()<<" USB2Dialog::USB2Dialog() START ";
|
||||
connect(m_ui->pbCHange, &QPushButton::clicked,
|
||||
this, &USB2Dialog::slotChangePath);
|
||||
|
||||
@@ -139,13 +135,13 @@ USB2Dialog::USB2Dialog(LtsSession::LtsSession *session, QWidget *parent)
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
WARNING_LOG(m_logger)<<" data corrupted path: "<< localThpDir();
|
||||
WARNING_LOG()<<" data corrupted path: "<< localThpDir();
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Couldn't Load THP(s)"));
|
||||
}
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Script_Editor-Export_Script_Administration"));
|
||||
|
||||
WARNING_LOG(m_logger)<<" USB2Dialog::USB2Dialog() END ";
|
||||
WARNING_LOG()<<" USB2Dialog::USB2Dialog() END ";
|
||||
}
|
||||
|
||||
|
||||
@@ -189,15 +185,15 @@ void USB2Dialog::unmountUSB(const QString &device)
|
||||
while (process.canReadLine())
|
||||
{
|
||||
QString outputLine = QString::fromUtf8(process.readLine());
|
||||
DEBUG_LOG(m_logger) << "OutputLine: " << outputLine;
|
||||
DEBUG_LOG() << "OutputLine: " << outputLine;
|
||||
auto outputDevicePath = outputLine.split(QStringLiteral(" ")).last();
|
||||
DEBUG_LOG(m_logger) << "OutputDevicePath: " << outputDevicePath;
|
||||
DEBUG_LOG() << "OutputDevicePath: " << outputDevicePath;
|
||||
|
||||
auto outputPathStripped = outputDevicePath.replace(QLatin1String("\\x20"), QLatin1String(" "));
|
||||
DEBUG_LOG(m_logger) << "OutputPathStripped: " << outputPathStripped;
|
||||
DEBUG_LOG() << "OutputPathStripped: " << outputPathStripped;
|
||||
|
||||
auto outputDeviceName = outputPathStripped.split(QStringLiteral("/")).last();
|
||||
DEBUG_LOG(m_logger) << "OutputDeviceName: " << outputDeviceName;
|
||||
DEBUG_LOG() << "OutputDeviceName: " << outputDeviceName;
|
||||
|
||||
if (outputDeviceName.trimmed().compare(device.trimmed()) == 0)
|
||||
{
|
||||
@@ -205,7 +201,7 @@ void USB2Dialog::unmountUSB(const QString &device)
|
||||
|
||||
auto serialPort = outputLine.split(QStringLiteral(" ")).first();
|
||||
QString absPath = QStringLiteral("/dev/") + serialPort;
|
||||
DEBUG_LOG(m_logger) << "Serial Port: " << absPath;
|
||||
DEBUG_LOG() << "Serial Port: " << absPath;
|
||||
process.start(QStringLiteral("udisksctl"), QStringList() << QStringLiteral("unmount") << QStringLiteral("-b") << absPath);
|
||||
process.waitForFinished();
|
||||
reset();
|
||||
@@ -332,7 +328,7 @@ void USB2Dialog::slotUnmount()
|
||||
|
||||
for(const auto &folder : std::as_const(folderNames))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Folder: " << folder << " USB Root: " << m_usbRoot;
|
||||
DEBUG_LOG() << "Folder: " << folder << " USB Root: " << m_usbRoot;
|
||||
|
||||
if(m_usbRoot.contains(folder))
|
||||
{
|
||||
@@ -483,7 +479,7 @@ void USB2Dialog::slotRemove()
|
||||
if (mil.size() < 1)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "mil.size()" << mil.size();
|
||||
DEBUG_LOG() << "mil.size()" << mil.size();
|
||||
|
||||
QStringList scriptIdList;
|
||||
for (const QModelIndex &idx : mil)
|
||||
@@ -608,7 +604,7 @@ void USB2Dialog::retranslate()
|
||||
|
||||
void USB2Dialog::initLocalModel() noexcept(false)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "(re)initModel !!";
|
||||
DEBUG_LOG() << "(re)initModel !!";
|
||||
|
||||
|
||||
|
||||
|
||||
-1
@@ -68,6 +68,5 @@ private:
|
||||
QMap<QString, QFileInfoList> m_files;
|
||||
|
||||
QString m_usbRoot;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user