Apply clang-format to Lts/Common and DTC/enum headers

- Formatted all CodeGen module files (9 files)
- Formatted LtsAppDescriptor module files
- Formatted LtsAppManager/AppChooser files
- Applied clang-format to all DTC and enum headers across modules
- Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/)

Cosmetic changes only, no functional modifications.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-19 14:46:29 +02:00
1 parent 1881d68aef
commit d6b6ffce7c
848 files changed
+89305 -100020

No files matched your search

@@ -1,11 +1,9 @@
#include "AbstractTimelineModel.h"
#include <utility>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <utility>
namespace LtsTimelineClassic
{
@@ -17,267 +15,216 @@ AbstractTimelineModel::AbstractTimelineModel(QObject *parent) : QAbstractItemMod
, m_getEventListsRecursive(true)
, m_rootItem(new Item(QLatin1String("#mwille/r00t/")))
, m_markersItem(new Item(tr("Markers"), QStringLiteral("Markers"))),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
m_logger(NGL::NGLLoggerBootstrap::getLogger())
{
m_rootItem->addItem(m_markersItem);
m_rootItem->addItem(m_markersItem);
}
AbstractTimelineModel::~AbstractTimelineModel()
{
delete m_rootItem;
delete m_rootItem;
}
void AbstractTimelineModel::retranslate()
{
m_markersItem->setName(tr("Markers"));
m_markersItem->setName(tr("Markers"));
}
void AbstractTimelineModel::invalidateTimeline()
{
const LtsTimelineClassic::ItemList il = m_rootItem->getFullItemList(true);
for (auto i = il.constBegin(); i != il.constEnd(); ++i)
{
LtsTimelineClassic::Item *item = *i;
if (item != nullptr)
item->setEventListChanged();
}
}
Event *AbstractTimelineModel::getEvent(int uniqueId)
{
const LtsTimelineClassic::ItemList il = m_rootItem->getFullItemList(true);
for (auto i = il.constBegin(); i != il.constEnd(); ++i)
{
LtsTimelineClassic::Item *item = *i;
if (item != nullptr && item->getIdentifier() != QStringLiteral("Markers"))
const LtsTimelineClassic::ItemList il = m_rootItem->getFullItemList(true);
for (auto i = il.constBegin(); i != il.constEnd(); ++i)
{
const LtsTimelineClassic::EventList el = item->getFullEventList(true, true);
LtsTimelineClassic::Item* item = *i;
for (LtsTimelineClassic::Event *event : el)
{
if (event->uniqueId() == uniqueId)
return event;
}
if (item != nullptr)
item->setEventListChanged();
}
}
return nullptr;
}
void AbstractTimelineModel::addEvent(Event *event)
Event* AbstractTimelineModel::getEvent(int uniqueId)
{
QStringList actuatorPath = event->getActuator();
Item *currentItem = m_rootItem;
QModelIndex currentIndex = QModelIndex();
for (const QString &curPath : std::as_const(actuatorPath))
{
Item *oldItem = currentItem;
const ItemList *itemList = currentItem->getChildren();
if (itemList != nullptr)
const LtsTimelineClassic::ItemList il = m_rootItem->getFullItemList(true);
for (auto i = il.constBegin(); i != il.constEnd(); ++i)
{
for (int row = 0; row < itemList->count(); row++)
{
Item *childItem = itemList->at(row);
if (childItem->getName() == curPath)
LtsTimelineClassic::Item* item = *i;
if (item != nullptr && item->getIdentifier() != QStringLiteral("Markers"))
{
currentIndex = index(row, 0, currentIndex);
currentItem = childItem;
break;
const LtsTimelineClassic::EventList el = item->getFullEventList(true, true);
for (LtsTimelineClassic::Event* event : el)
{
if (event->uniqueId() == uniqueId)
return event;
}
}
}
}
if (oldItem == currentItem)
return nullptr;
}
void AbstractTimelineModel::addEvent(Event* event)
{
QStringList actuatorPath = event->getActuator();
Item* currentItem = m_rootItem;
QModelIndex currentIndex = QModelIndex();
for (const QString& curPath : std::as_const(actuatorPath))
{
beginInsertRows(currentIndex, currentItem->childCount(), currentItem->childCount());
Item *newItem = new Item(curPath);
currentItem->addItem(newItem);
endInsertRows();
Item* oldItem = currentItem;
const ItemList* itemList = currentItem->getChildren();
currentIndex = index(currentItem->childCount() - 1, 0, currentIndex);
currentItem = newItem;
if (itemList != nullptr)
{
for (int row = 0; row < itemList->count(); row++)
{
Item* childItem = itemList->at(row);
if (childItem->getName() == curPath)
{
currentIndex = index(row, 0, currentIndex);
currentItem = childItem;
break;
}
}
}
if (oldItem == currentItem)
{
beginInsertRows(currentIndex, currentItem->childCount(), currentItem->childCount());
Item* newItem = new Item(curPath);
currentItem->addItem(newItem);
endInsertRows();
currentIndex = index(currentItem->childCount() - 1, 0, currentIndex);
currentItem = newItem;
}
}
}
currentItem->addEvent(event);
currentItem->addEvent(event);
}
Item *AbstractTimelineModel::getRootItem()
Item* AbstractTimelineModel::getRootItem()
{
return m_rootItem;
}
Item *AbstractTimelineModel::itemFromIndex(const QModelIndex &idx) const
{
if (!idx.isValid())
return m_rootItem;
return static_cast<Item *>(idx.internalPointer());
}
QVariant AbstractTimelineModel::data(const QModelIndex &index, int role) const
Item* AbstractTimelineModel::itemFromIndex(const QModelIndex& idx) const
{
if (role != Qt::DisplayRole || !index.isValid())
return QVariant();
Item *item = itemFromIndex(index);
if (!item)
return QVariant();
if (index.column() == 1)
{
PassiveEventContainer *pevcon = item->getPevcon();
return QVariant::fromValue(pevcon);
}
QString name(item->getName());
if (name.isEmpty())
name = tr("[unknown]");
return QVariant(name);
if (!idx.isValid())
return m_rootItem;
return static_cast<Item*>(idx.internalPointer());
}
Qt::ItemFlags AbstractTimelineModel::flags(const QModelIndex &index) const
QVariant AbstractTimelineModel::data(const QModelIndex& index, int role) const
{
if (!index.isValid())
return {};
if (role != Qt::DisplayRole || !index.isValid())
return QVariant();
return QAbstractItemModel::flags(index) | Qt::ItemIsEditable;
Item* item = itemFromIndex(index);
if (!item)
return QVariant();
if (index.column() == 1)
{
PassiveEventContainer* pevcon = item->getPevcon();
return QVariant::fromValue(pevcon);
}
QString name(item->getName());
if (name.isEmpty())
name = tr("[unknown]");
return QVariant(name);
}
Qt::ItemFlags AbstractTimelineModel::flags(const QModelIndex& index) const
{
if (!index.isValid())
return {};
return QAbstractItemModel::flags(index) | Qt::ItemIsEditable;
}
QVariant AbstractTimelineModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
{
switch (section)
{
case 0: return QString(tr("Actuator") + QStringLiteral("\r\n"));
case 1: return QString(tr("Events") + QStringLiteral("\r\n"));
}
}
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
{
return QVariant();
switch (section)
{
case 0:
return QString(tr("Actuator") + QStringLiteral("\r\n"));
case 1:
return QString(tr("Events") + QStringLiteral("\r\n"));
}
}
return QVariant();
}
QModelIndex AbstractTimelineModel::index(int row, int column, const QModelIndex &parent) const
QModelIndex AbstractTimelineModel::index(int row, int column, const QModelIndex& parent) const
{
if (!hasIndex(row, column, parent))
if (!hasIndex(row, column, parent))
return QModelIndex();
Item* item = itemFromIndex(parent);
Item* child = item ? item->child(row) : nullptr;
if (child)
{
return createIndex(row, column, child);
}
return QModelIndex();
Item *item = itemFromIndex(parent);
Item *child = item ? item->child(row) : nullptr;
if (child)
{
return createIndex(row, column, child);
}
return QModelIndex();
}
QModelIndex AbstractTimelineModel::parent(const QModelIndex &index) const
QModelIndex AbstractTimelineModel::parent(const QModelIndex& index) const
{
if (!index.isValid())
return QModelIndex();
if (!index.isValid())
return QModelIndex();
Item *item = itemFromIndex(index);
Item *parent = item ? item->getParent() : nullptr;
Item* item = itemFromIndex(index);
Item* parent = item ? item->getParent() : nullptr;
if (parent == m_rootItem || parent == nullptr)
return QModelIndex();
if (parent == m_rootItem || parent == nullptr)
return QModelIndex();
int idx = parent->indexOfParent();
int idx = parent->indexOfParent();
if (idx == -1)
return QModelIndex();
if (idx == -1)
return QModelIndex();
return createIndex(idx, 0, parent);
return createIndex(idx, 0, parent);
}
int AbstractTimelineModel::rowCount(const QModelIndex &parent) const
int AbstractTimelineModel::rowCount(const QModelIndex& parent) const
{
if (!parent.isValid())
{
int r = m_rootItem->visibleChildCount();
return r;
}
if (!parent.isValid())
{
int r = m_rootItem->visibleChildCount();
Item *item = itemFromIndex(parent);
if (item)
{
int r = item->visibleChildCount();
return r;
}
return r;
}
return 0;
Item* item = itemFromIndex(parent);
if (item)
{
int r = item->visibleChildCount();
return r;
}
return 0;
}
int AbstractTimelineModel::columnCount(const QModelIndex &) const
int AbstractTimelineModel::columnCount(const QModelIndex&) const
{
return 2;
return 2;
}
}
} // namespace LtsTimelineClassic