Merge feature/lts-viewer-validation-testing-phase into feature/qt6-migration-basis-modules-merge
Resolves 1 conflict (new_docker_build.sh, union of viewer-only + codification options); folds in fixes for pre-existing defects surfaced by the validation runs (KDReports-qt6 wiring, LtsSession RTI linking, LtsFileDialog/WLS/BSM Qt6/RTI API migration, GROUP4 target list, new --cmake_build_flags option); validated with BUILD_RTI=ON BUILD_GRANTLEE=ON in 3 Docker runs (run 3: build green, 6 base-state first-run CTest failures documented).
This commit is contained in:
30 files changed
+376
-247
No files matched your search
+47
-44
@@ -12,6 +12,8 @@
|
||||
|
||||
#include <FileManagement/flm_translation.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
//#include <QtCore/QDebug>
|
||||
|
||||
namespace LtsWidgets
|
||||
@@ -68,16 +70,16 @@ QVariant DialogModelFolder::data(const QModelIndex &index, int role) const
|
||||
case NAME:
|
||||
return getFolderName(folderData);
|
||||
case ID:
|
||||
return folderData.id();
|
||||
return folderData.id;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
case Qt::UserRole:
|
||||
return folderData.id();
|
||||
return folderData.id;
|
||||
case Qt::DecorationRole:
|
||||
{
|
||||
if (folderData.isHidden())
|
||||
if (folderData.isHidden)
|
||||
return item->icon();
|
||||
break;
|
||||
}
|
||||
@@ -97,22 +99,22 @@ FileManagement::Folder DialogModelFolder::getFolder(const QModelIndex &idx) cons
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
QString DialogModelFolder::getFolderName(const FileManagement::Folder &folderData) const
|
||||
{
|
||||
QString folderName = QString::fromStdString(folderData.name());
|
||||
QString folderName = QString::fromStdString(folderData.name);
|
||||
if (folderName.startsWith(QStringLiteral("$")))
|
||||
{
|
||||
folderName.remove(0,1);
|
||||
if (folderName.startsWith(QStringLiteral("EX_")))
|
||||
{
|
||||
int exId = folderName.remove(0,3).toInt();
|
||||
return QString::fromStdString(m_exmDtc->exercise(exId).name());
|
||||
return QString::fromStdString(m_exmDtc->exercise(exId).name);
|
||||
}
|
||||
if (folderName.startsWith(QStringLiteral("PH_")))
|
||||
{
|
||||
int phId = folderName.remove(0,3).toInt();
|
||||
return QString::fromStdString(m_exmDtc->exercisePhase(phId).name());
|
||||
return QString::fromStdString(m_exmDtc->exercisePhase(phId).name);
|
||||
}
|
||||
}
|
||||
return FileManagement::trFolderName(folderName);
|
||||
return FileManagement::trFolderName(folderName.toStdString());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
@@ -121,7 +123,7 @@ bool DialogModelFolder::isRowRemovable(NGLTreeItem *parentItem) const
|
||||
if (!parentItem)
|
||||
return false;
|
||||
FileManagement::Folder folderData = parentItem->data().value<FileManagement::Folder>();
|
||||
return folderData.isEditable();
|
||||
return folderData.isEditable;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
@@ -133,34 +135,32 @@ bool DialogModelFolder::initModel(int exerciseId, const QVector<FileManagement::
|
||||
QHash<int, QModelIndex> parentItemIndexCache;
|
||||
QVector<int> idsToExclude;
|
||||
|
||||
auto cbFolders = [this, exerciseId, &tmap, &idsToExclude, &mainFolders, &parentItemIndexCache] (const std::vector<FileManagement::Folder> &folders, const std::vector<int32_t> &ids, FileManagement::Interface::DataModification mod)
|
||||
// Dtc per-item callback: return true to stop iteration (iterateUntil), so collect with false.
|
||||
// Explicit std::function type disambiguates the void/bool overloads.
|
||||
std::function<bool(const FileManagement::Folder &)> cbFolders = [this, exerciseId, &tmap, &idsToExclude, &mainFolders] (const FileManagement::Folder &data)
|
||||
{
|
||||
Q_UNUSED(ids);
|
||||
Q_UNUSED(mod);
|
||||
for (const auto &data : folders)
|
||||
if (data.isDeleted)
|
||||
return false;
|
||||
if (exerciseId > 0)
|
||||
{
|
||||
if (data.isDeleted())
|
||||
continue;
|
||||
if (exerciseId > 0)
|
||||
QString folderName = QString::fromStdString(data.name);
|
||||
if (folderName.startsWith(QStringLiteral("$EX_")))
|
||||
{
|
||||
QString folderName = QString::fromStdString(data.name());
|
||||
if (folderName.startsWith(QStringLiteral("$EX_")))
|
||||
{
|
||||
int exId = folderName.remove(0, 4).toInt();
|
||||
if (exId != exerciseId)
|
||||
idsToExclude.append(data.id());
|
||||
}
|
||||
int exId = folderName.remove(0, 4).toInt();
|
||||
if (exId != exerciseId)
|
||||
idsToExclude.append(data.id);
|
||||
}
|
||||
FileManagement::MainFolder mainFolder = static_cast<FileManagement::MainFolder>(data.path()[0]);
|
||||
//qCritical() << "Folder = " << data.name() << ", mainFolder = " << mainFolder.underlying();
|
||||
}
|
||||
FileManagement::MainFolder mainFolder = static_cast<FileManagement::MainFolder>(data.path[0]);
|
||||
//qCritical() << "Folder = " << data.name << ", mainFolder = " << static_cast<int>(mainFolder);
|
||||
if (!mainFolders.contains(mainFolder))
|
||||
{
|
||||
// qCritical() << "Excluded id = " << data.id();
|
||||
idsToExclude.append(data.id());
|
||||
// qCritical() << "Excluded id = " << data.id;
|
||||
idsToExclude.append(data.id);
|
||||
}
|
||||
|
||||
tmap.insert(data.id(), data);
|
||||
}
|
||||
tmap.insert(data.id, data);
|
||||
return false;
|
||||
};
|
||||
m_flmDtc->folders(cbFolders);
|
||||
|
||||
@@ -173,16 +173,16 @@ bool DialogModelFolder::initModel(int exerciseId, const QVector<FileManagement::
|
||||
int parentId = 0;
|
||||
FileManagement::Folder fld = iter.value();
|
||||
|
||||
if (fld.path().size() > 1)
|
||||
if (fld.path.size() > 1)
|
||||
{
|
||||
parentId = fld.path().at(fld.path().size() - 2);
|
||||
int idPos2 = fld.path().at(1);
|
||||
parentId = fld.path.at(fld.path.size() - 2);
|
||||
int idPos2 = fld.path.at(1);
|
||||
if (idsToExclude.contains(idPos2))
|
||||
continue;
|
||||
}
|
||||
else // main Folders
|
||||
{
|
||||
if (idsToExclude.contains(fld.id()))
|
||||
if (idsToExclude.contains(fld.id))
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ bool DialogModelFolder::onInsertRow(int &row, const QModelIndex &parent, const F
|
||||
QVariant data;
|
||||
data.setValue(folderData);
|
||||
QIcon icon;
|
||||
if (folderData.isHidden())
|
||||
if (folderData.isHidden)
|
||||
icon = QIcon(QLatin1String(":/style/lock.svg"));
|
||||
NGLTreeItem *item = new NGLTreeItem(data, icon);
|
||||
item->setModified(true);
|
||||
@@ -227,7 +227,7 @@ bool DialogModelFolder::onUpdateRow(const QModelIndex &index, const FileManageme
|
||||
data.setValue(folderData);
|
||||
|
||||
QIcon icon;
|
||||
if (folderData.isHidden())
|
||||
if (folderData.isHidden)
|
||||
icon = QIcon(QLatin1String(":/style/lock.svg"));
|
||||
return setItemData(index, data, icon);
|
||||
}
|
||||
@@ -243,7 +243,7 @@ bool DialogModelFolder::onDeleteRow(const QModelIndex &idx, bool isFirstItem)
|
||||
{
|
||||
NGLTreeItem *item = privateData(idx);
|
||||
FileManagement::Folder data = item->data().value<FileManagement::Folder>();
|
||||
data.setDeleted(true);
|
||||
data.isDeleted = true;
|
||||
}
|
||||
removeRow(idx.row(), idx.parent());
|
||||
|
||||
@@ -282,19 +282,22 @@ bool DialogModelProxyFolder::lessThan(const QModelIndex &source_left, const QMod
|
||||
const FileManagement::Folder folderLeft = itemLeft->data().value<FileManagement::Folder>();
|
||||
const FileManagement::Folder folderRight = itemRight->data().value<FileManagement::Folder>();
|
||||
|
||||
if (folderLeft.mainFolder() == FileManagement::MainFolder::GlobalDocuments || folderRight.mainFolder() == FileManagement::MainFolder::GlobalDocuments ||
|
||||
folderLeft.mainFolder() == FileManagement::MainFolder::UserDocuments || folderRight.mainFolder() == FileManagement::MainFolder::UserDocuments ||
|
||||
folderLeft.mainFolder() == FileManagement::MainFolder::ExerciseDocuments || folderRight.mainFolder() == FileManagement::MainFolder::ExerciseDocuments)
|
||||
// mainFolder() was part of the legacy Folder API; the generated Folder carries it in path[0]
|
||||
const int leftMain = folderLeft.path.empty() ? 0 : static_cast<int>(folderLeft.path[0]);
|
||||
const int rightMain = folderRight.path.empty() ? 0 : static_cast<int>(folderRight.path[0]);
|
||||
if (leftMain == static_cast<int>(FileManagement::MainFolder::GlobalDocuments) || rightMain == static_cast<int>(FileManagement::MainFolder::GlobalDocuments) ||
|
||||
leftMain == static_cast<int>(FileManagement::MainFolder::UserDocuments) || rightMain == static_cast<int>(FileManagement::MainFolder::UserDocuments) ||
|
||||
leftMain == static_cast<int>(FileManagement::MainFolder::ExerciseDocuments) || rightMain == static_cast<int>(FileManagement::MainFolder::ExerciseDocuments))
|
||||
{
|
||||
return FileManagement::toInt(folderLeft.mainFolder()) < FileManagement::toInt(folderRight.mainFolder());
|
||||
return leftMain < rightMain;
|
||||
}
|
||||
|
||||
if (folderLeft.name() != folderRight.name())
|
||||
if (folderLeft.name != folderRight.name)
|
||||
{
|
||||
return (folderLeft.name() < folderRight.name());
|
||||
return (folderLeft.name < folderRight.name);
|
||||
}
|
||||
|
||||
return folderLeft.id() < folderRight.id();
|
||||
return folderLeft.id < folderRight.id;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -324,10 +327,10 @@ bool DialogModelProxyFolder::filterAcceptsRow(int source_row, const QModelIndex
|
||||
return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
|
||||
|
||||
const FileManagement::Folder data = child->data().value<FileManagement::Folder>();
|
||||
if (data.operatorId() != m_operatorId)
|
||||
if (data.operatorId != m_operatorId)
|
||||
{
|
||||
// it's user folder -> check if it's in user documents and hide if it's not for the current operator
|
||||
for (int p : data.path())
|
||||
for (int p : data.path)
|
||||
{
|
||||
if (static_cast<FileManagement::MainFolder>(p) == FileManagement::MainFolder::UserDocuments)
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user