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
+38
-39
@@ -21,7 +21,6 @@ namespace TakeHomePackageManager
|
||||
ExportedScriptsModel::ExportedScriptsModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<ExportedScriptInformation>(
|
||||
{ tr("id"), tr("Exercise"), tr("Name"), tr("Created"), tr("Last downloaded"), tr("Location"), tr("Last uploaded"), tr("Server")}, parent)
|
||||
, m_logger(getLogger("ExportedScriptsModel"))
|
||||
{}
|
||||
|
||||
bool ExportedScriptsModel::init(const QString &rootDirectoryToScan)
|
||||
@@ -32,7 +31,7 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan)
|
||||
m_vecData.clear();
|
||||
|
||||
QVector <int> localExercises;
|
||||
DEBUG_LOG(m_logger) << "ExportedScriptsModel::init rootDirectoryToScan=" << rootDirectoryToScan
|
||||
DEBUG_LOG() << "ExportedScriptsModel::init rootDirectoryToScan=" << rootDirectoryToScan
|
||||
;
|
||||
|
||||
|
||||
@@ -40,10 +39,10 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan)
|
||||
|
||||
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Get all local exercises rootDirectoryToScan=" << rootDirectoryToScan ;
|
||||
DEBUG_LOG() << "Get all local exercises rootDirectoryToScan=" << rootDirectoryToScan ;
|
||||
QFile file(rootDirectoryToScan + QDir::separator() + QStringLiteral("exercises.json"));
|
||||
if (!file.open(QFile::ReadOnly))
|
||||
WARNING_LOG(m_logger) << "Cannot open " << file.fileName() << " for read/write: " << file.errorString();
|
||||
WARNING_LOG() << "Cannot open " << file.fileName() << " for read/write: " << file.errorString();
|
||||
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(file.readAll()));
|
||||
const QJsonObject obj = doc.object();
|
||||
@@ -53,7 +52,7 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan)
|
||||
localExercises.append(ele.toInt());
|
||||
}
|
||||
|
||||
WARNING_LOG(m_logger) << "local exericses: " << localExercises.count();
|
||||
WARNING_LOG() << "local exericses: " << localExercises.count();
|
||||
|
||||
|
||||
for (const int exId : std::as_const(localExercises))
|
||||
@@ -63,7 +62,7 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan)
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Cannot open " << file.fileName() << " for reading: " << file.errorString() << " - not critical";
|
||||
WARNING_LOG() << "Cannot open " << file.fileName() << " for reading: " << file.errorString() << " - not critical";
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -72,14 +71,14 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan)
|
||||
const QJsonObject obj = doc.object();
|
||||
const QJsonArray presentations = obj[QStringLiteral("presentations")].toArray();
|
||||
|
||||
DEBUG_LOG(m_logger) << "exercise: " << exId << ", presentations: " << presentations.size();
|
||||
DEBUG_LOG() << "exercise: " << exId << ", presentations: " << presentations.size();
|
||||
|
||||
for (const QJsonValue &val : presentations)
|
||||
{
|
||||
ExportedScriptInformation esi = ExportedScriptInformation::fromJson(val);
|
||||
DEBUG_LOG(m_logger) << "obj=" << QJsonDocument(obj).toJson(QJsonDocument::Compact);
|
||||
DEBUG_LOG() << "obj=" << QJsonDocument(obj).toJson(QJsonDocument::Compact);
|
||||
const QJsonObject presentationObj = val.toObject();
|
||||
DEBUG_LOG(m_logger) << "presentationObj=" << QJsonDocument(presentationObj).toJson(QJsonDocument::Compact);
|
||||
DEBUG_LOG() << "presentationObj=" << QJsonDocument(presentationObj).toJson(QJsonDocument::Compact);
|
||||
if (obj.contains(QStringLiteral("exerciseId")))
|
||||
{
|
||||
esi.exerciseId = obj[QStringLiteral("exerciseId")].toInt();
|
||||
@@ -91,7 +90,7 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan)
|
||||
}
|
||||
|
||||
esi.local = true;
|
||||
DEBUG_LOG(m_logger) << "push_back "
|
||||
DEBUG_LOG() << "push_back "
|
||||
<< " exportTime=" << esi.exportTime
|
||||
<< " scriptId=" << esi.scriptId
|
||||
<< " scriptName=" << esi.scriptName
|
||||
@@ -121,14 +120,14 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray)
|
||||
QMap<int, QVector<int>> exerciseContentScriptIds;
|
||||
QMap<int, QVector<int>> exerciseScriptIds;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ExportedScriptsModel::setServerContent jsonArray =" << jsonArray;
|
||||
DEBUG_LOG() << "ExportedScriptsModel::setServerContent jsonArray =" << jsonArray;
|
||||
QJsonParseError err;
|
||||
const QJsonArray presentations = QJsonDocument::fromJson(jsonArray.toUtf8(), &err).array();
|
||||
DEBUG_LOG(m_logger) << "presentations.size() =" << presentations.size();
|
||||
DEBUG_LOG() << "presentations.size() =" << presentations.size();
|
||||
|
||||
if (err.error != QJsonParseError::NoError)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "json array invalid at offset " << err.offset << ": " << err.errorString();
|
||||
ERROR_LOG() << "json array invalid at offset " << err.offset << ": " << err.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,7 +135,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray)
|
||||
for (const auto &data : std::as_const(m_vecData))
|
||||
{
|
||||
exerciseScriptIds[data.exerciseId].append(data.scriptId);
|
||||
DEBUG_LOG(m_logger) << "exerciseId=" << data.exerciseId
|
||||
DEBUG_LOG() << "exerciseId=" << data.exerciseId
|
||||
<< " modelScriptIds.append: " << data.scriptId;
|
||||
}
|
||||
|
||||
@@ -153,7 +152,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray)
|
||||
{
|
||||
const auto &rowData = m_vecData[i];
|
||||
const QVector<int> contentScriptIds = exerciseContentScriptIds.value(rowData.exerciseId);
|
||||
DEBUG_LOG(m_logger) << "m_vecData.at(" << i << ").scriptId=" << rowData.scriptId
|
||||
DEBUG_LOG() << "m_vecData.at(" << i << ").scriptId=" << rowData.scriptId
|
||||
<< " exerciseId=" << rowData.exerciseId
|
||||
<< " contentScriptIds.contains=" << contentScriptIds.contains(rowData.scriptId)
|
||||
<< " rowData.local=" << rowData.local
|
||||
@@ -166,7 +165,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray)
|
||||
{
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "removeRow(" << i << ")"
|
||||
DEBUG_LOG() << "removeRow(" << i << ")"
|
||||
<< " ScriptId=" << rowData.scriptId
|
||||
<< " ExerciseId=" << rowData.exerciseId;
|
||||
removeRow(i);
|
||||
@@ -186,7 +185,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray)
|
||||
{
|
||||
ExportedScriptInformation esi = ExportedScriptInformation::fromJson(val, false, ThpAlreadyUploaded);
|
||||
QVector<int> modelScriptIds = exerciseScriptIds.value(esi.exerciseId);
|
||||
DEBUG_LOG(m_logger) << " exportTime=" << esi.exportTime
|
||||
DEBUG_LOG() << " exportTime=" << esi.exportTime
|
||||
<< " scriptId=" << esi.scriptId
|
||||
<< " exerciseId=" << esi.exerciseId
|
||||
<< " exerciseName=" << esi.exerciseName
|
||||
@@ -197,7 +196,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray)
|
||||
|
||||
if (!modelScriptIds.contains(esi.scriptId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "insertRow()";
|
||||
DEBUG_LOG() << "insertRow()";
|
||||
insertRow(esi);
|
||||
continue;
|
||||
}
|
||||
@@ -209,7 +208,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray)
|
||||
if (rowData.scriptId == esi.scriptId &&
|
||||
rowData.exerciseId == esi.exerciseId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "setUploadState i=" << i
|
||||
DEBUG_LOG() << "setUploadState i=" << i
|
||||
<< " esi.scriptId=" << esi.scriptId
|
||||
<< " esi.exerciseId=" << esi.exerciseId
|
||||
<< " esi.fileSize=" << esi.fileSize
|
||||
@@ -231,7 +230,7 @@ qint64 ExportedScriptsModel::downloadTime(const ExportedScriptInformation &val)
|
||||
return 0;
|
||||
|
||||
QString filename(QStringLiteral("%1/THP-Download/Exercise_%2/%3/index.html").arg(QDir::tempPath()).arg(val.exerciseId).arg(val.scriptId));
|
||||
DEBUG_LOG(m_logger) << "downloadTime: filename " << filename;
|
||||
DEBUG_LOG() << "downloadTime: filename " << filename;
|
||||
|
||||
QFileInfo fi(filename);
|
||||
if (!fi.exists())
|
||||
@@ -335,16 +334,16 @@ bool ExportedScriptsModel::createDataJson(const QString &rootDirectory,
|
||||
|
||||
if (!QDir().mkpath(baseDir))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to create path " << baseDir;
|
||||
ERROR_LOG() << "Failed to create path " << baseDir;
|
||||
return false;
|
||||
}
|
||||
|
||||
QFile file(baseDir + QStringLiteral("data.json"));
|
||||
DEBUG_LOG(m_logger) << "createDataJson=" << file.fileName();
|
||||
DEBUG_LOG() << "createDataJson=" << file.fileName();
|
||||
if (!file.open(QFile::ReadWrite))
|
||||
{
|
||||
QString msg(tr("Could not open data file in script directory: %1").arg(file.errorString()));
|
||||
ERROR_LOG(m_logger) << msg << " - " << file.fileName();
|
||||
ERROR_LOG() << msg << " - " << file.fileName();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -352,7 +351,7 @@ bool ExportedScriptsModel::createDataJson(const QString &rootDirectory,
|
||||
QJsonObject obj = doc.object();
|
||||
if (obj[QStringLiteral("exerciseId")].toInt() == exerciseId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << baseDir << " exists for exerciseId " << QString::number(exerciseId);
|
||||
DEBUG_LOG() << baseDir << " exists for exerciseId " << QString::number(exerciseId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -382,18 +381,18 @@ void ExportedScriptsModel::addDownloadData(const ExportedScriptInformation &esi)
|
||||
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "Add exercise to ExportRootPath";
|
||||
DEBUG_LOG() << "Add exercise to ExportRootPath";
|
||||
|
||||
if (!QDir(esi.rootDirectory).exists())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot modify exercises.json as the info's root directory '"<<esi.rootDirectory<<"' does not exist!";
|
||||
ERROR_LOG() << "Cannot modify exercises.json as the info's root directory '"<<esi.rootDirectory<<"' does not exist!";
|
||||
return;
|
||||
}
|
||||
|
||||
QFile file(esi.rootDirectory + QDir::separator() + QStringLiteral("exercises.json"));
|
||||
if (!file.open(QFile::ReadWrite))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Can not open " << file.fileName() << " for read/write: " << file.errorString();
|
||||
WARNING_LOG() << "Can not open " << file.fileName() << " for read/write: " << file.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -404,14 +403,14 @@ void ExportedScriptsModel::addDownloadData(const ExportedScriptInformation &esi)
|
||||
|
||||
if (!arr.contains(esi.exerciseId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "arr.append Exercise=" << esi.exerciseId;
|
||||
DEBUG_LOG() << "arr.append Exercise=" << esi.exerciseId;
|
||||
arr.append(esi.exerciseId);
|
||||
}
|
||||
|
||||
obj.insert(key, arr);
|
||||
file.resize(0);
|
||||
file.write(QJsonDocument(obj).toJson());
|
||||
INFO_LOG(m_logger) << " file.write " << QJsonDocument(obj).toJson();
|
||||
INFO_LOG() << " file.write " << QJsonDocument(obj).toJson();
|
||||
file.close();
|
||||
}
|
||||
|
||||
@@ -420,17 +419,17 @@ void ExportedScriptsModel::addDownloadData(const ExportedScriptInformation &esi)
|
||||
const QString baseDir = exercisePath(esi.rootDirectory, esi.exerciseId);
|
||||
if (!QDir().mkpath(baseDir))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot create destination path " << baseDir;
|
||||
ERROR_LOG() << "Cannot create destination path " << baseDir;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QFile file(baseDir + QDir::separator() + QStringLiteral("data.json"));
|
||||
DEBUG_LOG(m_logger) << "File= " << file.fileName();
|
||||
DEBUG_LOG() << "File= " << file.fileName();
|
||||
if (!file.open(QFile::ReadWrite))
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Can not open " << file.fileName() << " for read/write: " << file.errorString();
|
||||
WARNING_LOG() << "Can not open " << file.fileName() << " for read/write: " << file.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -439,7 +438,7 @@ void ExportedScriptsModel::addDownloadData(const ExportedScriptInformation &esi)
|
||||
QJsonObject obj = doc.object();
|
||||
QJsonArray arr = obj.value(keyArray).toArray();
|
||||
bool exported = false;
|
||||
DEBUG_LOG(m_logger) << "arr.size=" << arr.size();
|
||||
DEBUG_LOG() << "arr.size=" << arr.size();
|
||||
|
||||
for (int i = 0; i < arr.size(); ++i)
|
||||
{
|
||||
@@ -455,7 +454,7 @@ void ExportedScriptsModel::addDownloadData(const ExportedScriptInformation &esi)
|
||||
|
||||
if (!exported)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "info scriptId=" << esi.scriptId
|
||||
DEBUG_LOG() << "info scriptId=" << esi.scriptId
|
||||
<< " Name=" << esi.scriptName
|
||||
<< " Exercise=" << esi.exerciseName;
|
||||
arr.append(esi.toJson());
|
||||
@@ -464,7 +463,7 @@ void ExportedScriptsModel::addDownloadData(const ExportedScriptInformation &esi)
|
||||
obj.insert(keyArray, arr);
|
||||
auto content = QJsonDocument(obj).toJson();
|
||||
|
||||
DEBUG_LOG(m_logger) << "content =" << content;
|
||||
DEBUG_LOG() << "content =" << content;
|
||||
|
||||
file.resize(0);
|
||||
file.write(content);
|
||||
@@ -479,7 +478,7 @@ bool ExportedScriptsModel::setLocalState(const int row, const bool localHost)
|
||||
data.local = localHost;
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "setLocalState row=" << row
|
||||
DEBUG_LOG() << "setLocalState row=" << row
|
||||
<< " scriptId=" << data.scriptId
|
||||
<< " data.scriptName=" << data.scriptName
|
||||
<< " Exercise=" << data.exerciseName;
|
||||
@@ -516,12 +515,12 @@ bool ExportedScriptsModel::removeRow(int row)
|
||||
|
||||
QString baseDir = exercisePath(data.rootDirectory, data.exerciseId);
|
||||
QString filename = baseDir + QStringLiteral("data.json");
|
||||
DEBUG_LOG(m_logger) << "filename= '" << filename << "'";
|
||||
DEBUG_LOG() << "filename= '" << filename << "'";
|
||||
QFile file(baseDir + QStringLiteral("data.json"));
|
||||
|
||||
if (!file.open(QIODevice::ReadWrite))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "!file.open '" << filename << "'"
|
||||
DEBUG_LOG() << "!file.open '" << filename << "'"
|
||||
<< " no local scripts";
|
||||
return true;
|
||||
}
|
||||
@@ -540,7 +539,7 @@ bool ExportedScriptsModel::removeRow(int row)
|
||||
obj[QStringLiteral("presentations")] = arr;
|
||||
file.resize(0);
|
||||
auto content = QJsonDocument(obj).toJson();
|
||||
DEBUG_LOG(m_logger) << "content =" << content;
|
||||
DEBUG_LOG() << "content =" << content;
|
||||
|
||||
return file.write(QJsonDocument(obj).toJson());
|
||||
}
|
||||
|
||||
+1
-3
@@ -7,7 +7,7 @@
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <Plugins/ExerciseManagement/exm_data_plugin_interface.h>
|
||||
#include <Plugins/AssetManagement/asm_data_plugin_interface.h>
|
||||
#include <Common/thpcommon_export.h>
|
||||
#include "thpcommon_export.h"
|
||||
|
||||
|
||||
namespace TakeHomePackageManager
|
||||
@@ -87,7 +87,5 @@ private:
|
||||
private:
|
||||
bool m_isOC { false };
|
||||
QString m_rootDirectoryToScan;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <Common/thpcommon_export.h>
|
||||
#include "thpcommon_export.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
Reference in new issue
Block a user