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

+18 -46
View File
@@ -1,92 +1,64 @@
#include "lts_notification.h"
#include "lts_notification_ctl.h"
#include <QIcon>
namespace LtsNotification
{
LtsNotification::LtsNotification(LtsNotificationController *ctl)
: QObject()
, m_controller(ctl)
LtsNotification::LtsNotification(LtsNotificationController* ctl) : QObject(), m_controller(ctl)
{
connect(ctl, &LtsNotificationController::destroyed,
this, &LtsNotification::slotCtlDestroyed);
connect(ctl, &LtsNotificationController::destroyed, this, &LtsNotification::slotCtlDestroyed);
}
LtsNotification::~LtsNotification()
{
delete m_controller;
delete m_controller;
}
void LtsNotification::setIcon(const QIcon& icon)
{
m_controller->setIcon(icon);
m_controller->setIcon(icon);
}
void LtsNotification::setAction(const std::function<void(void)> &action)
void LtsNotification::setAction(const std::function<void(void)>& action)
{
m_controller->setAction(action);
m_controller->setAction(action);
}
void LtsNotification::setToolTip(const QString &toolTip)
void LtsNotification::setToolTip(const QString& toolTip)
{
m_controller->setToolTip(toolTip);
m_controller->setToolTip(toolTip);
}
const QString &LtsNotification::tooltip() const
const QString& LtsNotification::tooltip() const
{
return m_controller->tooltip();
return m_controller->tooltip();
}
void LtsNotification::setCount(const int count)
{
m_controller->setCount(count);
m_controller->setCount(count);
}
void LtsNotification::setEnabled(bool enable)
{
m_controller->setEnabled(enable);
m_controller->setEnabled(enable);
}
void LtsNotification::setBackground(const int r, const int g, const int b)
{
m_controller->setBackground(r, g, b);
m_controller->setBackground(r, g, b);
}
void LtsNotification::slotCtlDestroyed(QObject *obj)
void LtsNotification::slotCtlDestroyed(QObject* obj)
{
(void)obj;
(void)obj;
m_controller = nullptr;
m_controller = nullptr;
}
}
} // namespace LtsNotification
+17 -29
View File
@@ -6,52 +6,40 @@
#include <QList>
#include <QObject>
#include <memory>
#include <functional>
#include <memory>
namespace LtsSession
{
class LtsSession;
}
namespace LtsNotification
{
class LtsNotificationController;
class LTSNOTIFICATION_EXPORT LtsNotification : public QObject
{
Q_OBJECT
Q_OBJECT
public:
explicit LtsNotification(LtsNotificationController *ctl);
~LtsNotification();
public:
explicit LtsNotification(LtsNotificationController* ctl);
~LtsNotification();
void setIcon(const QIcon &icon);
void setAction(const std::function<void(void)> &action);
void setToolTip(const QString &toolTip);
void setCount(const int count);
void setEnabled(bool enable);
void setBackground(const int r, const int g, const int b);
void setIcon(const QIcon& icon);
void setAction(const std::function<void(void)>& action);
void setToolTip(const QString& toolTip);
void setCount(const int count);
void setEnabled(bool enable);
void setBackground(const int r, const int g, const int b);
const QString &tooltip() const;
const QString& tooltip() const;
private:
LtsNotificationController *m_controller;
private slots:
void slotCtlDestroyed(QObject *obj);
private:
LtsNotificationController* m_controller;
private slots:
void slotCtlDestroyed(QObject* obj);
};
}
} // namespace LtsNotification
+82 -100
View File
@@ -1,173 +1,155 @@
#include "lts_notification_ctl.h"
#include <utility>
#include <QToolButton>
#include <QImage>
#include <QPainter>
#include <QIcon>
#include <QColor>
#include <QDebug>
#include <QIcon>
#include <QImage>
#include <QPainter>
#include <QToolButton>
#include <utility>
namespace LtsNotification
{
LtsNotificationController::LtsNotificationController(const QString &identifier)
: QObject()
, m_count(0)
, m_identifier(QStringLiteral("LtsNotification%1").arg(identifier))
{}
LtsNotificationController::LtsNotificationController(const QString& identifier)
: QObject(), m_count(0), m_identifier(QStringLiteral("LtsNotification%1").arg(identifier))
{
}
LtsNotificationController::~LtsNotificationController()
{
qDeleteAll(m_notiList);
qDeleteAll(m_notiList);
}
void LtsNotificationController::setIcon(const QIcon& icon)
{
m_icon = icon;
m_icon = icon;
setAllIcons();
setAllIcons();
}
void LtsNotificationController::setCount(const int count)
{
m_count = count;
m_count = count;
setAllIcons();
setAllIcons();
}
void LtsNotificationController::setBackground(const int r, const int g, const int b)
{
for (QToolButton *tb : std::as_const(m_notiList))
{
for (QToolButton* tb : std::as_const(m_notiList))
{
QString stylesheet;
QString stylesheet;
if(r == -1 && g == -1 && b == -1)
stylesheet = QStringLiteral("");
else
stylesheet = QStringLiteral("QToolButton {background-color: rgb(") +
QString::number(r) + QStringLiteral(",") +
QString::number(g) + QStringLiteral(",") +
QString::number(b) + QStringLiteral(");}");
if (r == -1 && g == -1 && b == -1)
stylesheet = QStringLiteral("");
else
stylesheet = QStringLiteral("QToolButton {background-color: rgb(") + QString::number(r) +
QStringLiteral(",") + QString::number(g) + QStringLiteral(",") + QString::number(b) +
QStringLiteral(");}");
tb->setStyleSheet(stylesheet);
}
tb->setStyleSheet(stylesheet);
}
}
void LtsNotificationController::setEnabled(bool enable)
{
m_enable = enable;
m_enable = enable;
setAllIcons();
setAllIcons();
}
void LtsNotificationController::setAction(const std::function<void(void)> &action)
void LtsNotificationController::setAction(const std::function<void(void)>& action)
{
m_action = action;
m_action = action;
}
void LtsNotificationController::setToolTip(const QString &toolTip)
void LtsNotificationController::setToolTip(const QString& toolTip)
{
m_toolTip = toolTip;
m_toolTip = toolTip;
for (QToolButton *tb : std::as_const(m_notiList))
{
tb->setToolTip(toolTip);
tb->setIconSize(QSize(30,30));
}
for (QToolButton* tb : std::as_const(m_notiList))
{
tb->setToolTip(toolTip);
tb->setIconSize(QSize(30, 30));
}
}
void LtsNotificationController::setAllIcons()
{
if (m_icon.isNull())
return;
if (m_icon.isNull())
return;
QIcon icon = modifyIcon(m_icon);
QIcon icon = modifyIcon(m_icon);
for (QToolButton *tb : std::as_const(m_notiList))
{
tb->setIcon(icon);
tb->setIconSize(QSize(30,30));
tb->setEnabled(m_enable);
}
for (QToolButton* tb : std::as_const(m_notiList))
{
tb->setIcon(icon);
tb->setIconSize(QSize(30, 30));
tb->setEnabled(m_enable);
}
}
#define SIZE 40
QIcon LtsNotificationController::modifyIcon(const QIcon &icon)
QIcon LtsNotificationController::modifyIcon(const QIcon& icon)
{
if (m_count < 1)
return icon;
if (m_count < 1)
return icon;
QPixmap iconImage(icon.pixmap(SIZE * 8 / 10, SIZE * 8 / 10));
QPainter painter(&iconImage);
QPixmap iconImage(icon.pixmap(SIZE * 8 / 10, SIZE * 8 / 10));
QPainter painter(&iconImage);
painter.save();
painter.setRenderHints(QPainter::TextAntialiasing | QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
painter.save();
painter.setRenderHints(QPainter::TextAntialiasing | QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
QFont f;
f.setFamily(QStringLiteral("Monospace"));
f.setPointSize(16);
f.setBold(true);
painter.setFont(f);
QFont f;
f.setFamily(QStringLiteral("Monospace"));
f.setPointSize(16);
f.setBold(true);
painter.setFont(f);
QColor color(Qt::red);
painter.setBrush(color);
painter.setPen(QPen(color, 3.1));
painter.drawText(QRect(0, 0, 30, 30), QString::number(m_count));
painter.restore();
QColor color(Qt::red);
painter.setBrush(color);
painter.setPen(QPen(color, 3.1));
painter.drawText(QRect(0, 0, 30, 30), QString::number(m_count));
painter.restore();
return iconImage;
return iconImage;
}
QToolButton *LtsNotificationController::createWidget()
QToolButton* LtsNotificationController::createWidget()
{
QToolButton *b = new QToolButton();
b->setToolButtonStyle(Qt::ToolButtonIconOnly);
b->setObjectName(m_identifier);
QToolButton* b = new QToolButton();
b->setToolButtonStyle(Qt::ToolButtonIconOnly);
b->setObjectName(m_identifier);
b->setMinimumSize(SIZE, SIZE);
b->setMaximumSize(SIZE, SIZE);
b->setMinimumSize(SIZE, SIZE);
b->setMaximumSize(SIZE, SIZE);
connect(b, &QToolButton::destroyed,
this, &LtsNotificationController::slotNotiWidgetDestroyed);
connect(b, &QToolButton::clicked,
this, [this](){ if (m_action) m_action(); });
connect(b, &QToolButton::destroyed, this, &LtsNotificationController::slotNotiWidgetDestroyed);
connect(b, &QToolButton::clicked, this, [this]() {
if (m_action)
m_action();
});
if (!m_icon.isNull())
b->setIcon(modifyIcon(m_icon));
if (!m_icon.isNull())
b->setIcon(modifyIcon(m_icon));
b->setToolTip(m_toolTip);
b->setToolTip(m_toolTip);
m_notiList.append(b);
return b;
m_notiList.append(b);
return b;
}
void LtsNotificationController::slotNotiWidgetDestroyed(QObject *obj)
void LtsNotificationController::slotNotiWidgetDestroyed(QObject* obj)
{
m_notiList.removeAll(static_cast<QToolButton*>(obj));
m_notiList.removeAll(static_cast<QToolButton*>(obj));
}
}
} // namespace LtsNotification
+35 -33
View File
@@ -4,12 +4,11 @@
#include "ltsnotification_export.h"
#include <QIcon>
#include <QList>
#include <QObject>
#include <QIcon>
#include <memory>
#include <functional>
#include <memory>
class QToolButton;
@@ -18,50 +17,53 @@ namespace LtsSession
class LtsSession;
}
namespace LtsNotification
{
class LtsNotificationWidget;
class LTSNOTIFICATION_EXPORT LtsNotificationController : public QObject
{
Q_OBJECT
Q_OBJECT
public:
explicit LtsNotificationController(const QString &identifier);
~LtsNotificationController();
public:
explicit LtsNotificationController(const QString& identifier);
~LtsNotificationController();
QToolButton *createWidget();
QToolButton* createWidget();
void setIcon(const QIcon& icon);
void setAction(const std::function<void(void)> &action);
void setToolTip(const QString &toolTip);
void setCount(const int count);
void setBackground(const int r, const int g, const int b);
const QString &identifier() const { return m_identifier; }
const QString &tooltip() const { return m_toolTip; }
void setIcon(const QIcon& icon);
void setAction(const std::function<void(void)>& action);
void setToolTip(const QString& toolTip);
void setCount(const int count);
void setBackground(const int r, const int g, const int b);
void setEnabled(bool enable);
const QString& identifier() const
{
return m_identifier;
}
private:
QList<QToolButton *> m_notiList;
const QString& tooltip() const
{
return m_toolTip;
}
QIcon m_icon;
std::function<void(void)> m_action;
QString m_toolTip;
int m_count;
bool m_enable{true};
QString m_identifier;
void setEnabled(bool enable);
void setAllIcons();
QIcon modifyIcon(const QIcon &icon);
private:
QList<QToolButton*> m_notiList;
private slots:
void slotNotiWidgetDestroyed(QObject *obj);
QIcon m_icon;
std::function<void(void)> m_action;
QString m_toolTip;
int m_count;
bool m_enable{true};
QString m_identifier;
void setAllIcons();
QIcon modifyIcon(const QIcon& icon);
private slots:
void slotNotiWidgetDestroyed(QObject* obj);
};
}
} // namespace LtsNotification
@@ -1,19 +1,17 @@
#pragma once
#include <QtCore/qglobal.h>
#ifndef LTSNOTIFICATION_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define LTSNOTIFICATION_EXPORT
# else
# if defined(MAKE_LTSNOTIFICATION_LIB)
# define LTSNOTIFICATION_EXPORT Q_DECL_EXPORT
# else
# define LTSNOTIFICATION_EXPORT Q_DECL_IMPORT
# endif
# endif
#ifdef BUILD_STATIC_LIBRARIES
#define LTSNOTIFICATION_EXPORT
#else
#if defined(MAKE_LTSNOTIFICATION_LIB)
#define LTSNOTIFICATION_EXPORT Q_DECL_EXPORT
#else
#define LTSNOTIFICATION_EXPORT Q_DECL_IMPORT
#endif
#endif
#endif