Switch to clang-format14

This commit is contained in:
Nicolas Werner 2022-09-25 20:05:08 +02:00
parent 951d0f4d23
commit 851333a50d
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
31 changed files with 77 additions and 40 deletions

View file

@ -222,7 +222,8 @@ linting:
image: alpine:latest image: alpine:latest
tags: [docker] tags: [docker]
before_script: before_script:
- apk update && apk add clang-extra-tools make git python3 py3-pip - apk update && apk add make git python3 py3-pip
- apk add clang-extra-tools --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
- export PATH="$PATH:/root/.local/bin" - export PATH="$PATH:/root/.local/bin"
- pip3 install --user reuse - pip3 install --user reuse
script: script:

View file

@ -18,7 +18,8 @@ class FetchPublishedAliasesJob : public QObject
public: public:
explicit FetchPublishedAliasesJob(QObject *p = nullptr) explicit FetchPublishedAliasesJob(QObject *p = nullptr)
: QObject(p) : QObject(p)
{} {
}
signals: signals:
void aliasFetched(std::string alias, std::string target); void aliasFetched(std::string alias, std::string target);

View file

@ -20,7 +20,8 @@ public:
BlurhashRunnable(const QString &id, const QSize &requestedSize) BlurhashRunnable(const QString &id, const QSize &requestedSize)
: m_id(id) : m_id(id)
, m_requestedSize(requestedSize) , m_requestedSize(requestedSize)
{} {
}
void run() override; void run() override;
signals: signals:

View file

@ -96,7 +96,8 @@ struct MegolmSessionIndex
MegolmSessionIndex(std::string room_id_, const mtx::events::msg::Encrypted &e) MegolmSessionIndex(std::string room_id_, const mtx::events::msg::Encrypted &e)
: room_id(std::move(room_id_)) : room_id(std::move(room_id_))
, session_id(e.session_id) , session_id(e.session_id)
{} {
}
//! The room in which this session exists. //! The room in which this session exists.
std::string room_id; std::string room_id;

View file

@ -10,7 +10,8 @@ class ColorImageProvider : public QQuickImageProvider
public: public:
ColorImageProvider() ColorImageProvider()
: QQuickImageProvider(QQuickImageProvider::Pixmap) : QQuickImageProvider(QQuickImageProvider::Pixmap)
{} {
}
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override; QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override;
}; };

View file

@ -12,7 +12,8 @@
InviteesModel::InviteesModel(QObject *parent) InviteesModel::InviteesModel(QObject *parent)
: QAbstractListModel{parent} : QAbstractListModel{parent}
{} {
}
void void
InviteesModel::addUser(QString mxid) InviteesModel::addUser(QString mxid)

View file

@ -83,7 +83,8 @@ JdenticonRunnable::JdenticonRunnable(const QString &key,
, m_crop{crop} , m_crop{crop}
, m_radius{radius} , m_radius{radius}
, m_requestedSize(requestedSize.isValid() ? requestedSize : QSize(100, 100)) , m_requestedSize(requestedSize.isValid() ? requestedSize : QSize(100, 100))
{} {
}
void void
JdenticonRunnable::run() JdenticonRunnable::run()

View file

@ -57,7 +57,10 @@ public:
void showChatPage(); void showChatPage();
#ifdef NHEKO_DBUS_SYS #ifdef NHEKO_DBUS_SYS
bool dbusAvailable() const { return dbusAvailable_; } bool dbusAvailable() const
{
return dbusAvailable_;
}
#endif #endif
Q_INVOKABLE void addPerRoomWindow(const QString &room, QWindow *window); Q_INVOKABLE void addPerRoomWindow(const QString &room, QWindow *window);

View file

@ -29,7 +29,8 @@ public:
, m_requestedSize(requestedSize) , m_requestedSize(requestedSize)
, m_crop(crop) , m_crop(crop)
, m_radius(radius) , m_radius(radius)
{} {
}
void run(); void run();

View file

@ -44,7 +44,8 @@ RoomInfoItem::RoomInfoItem(const QString &roomId,
, roomName_{title} , roomName_{title}
, image_{image} , image_{image}
, unreadNotifications_{unreadNotifications} , unreadNotifications_{unreadNotifications}
{} {
}
RoomInfoItem::RoomInfoItem(const RoomInfoItem &other) RoomInfoItem::RoomInfoItem(const RoomInfoItem &other)
: QObject{other.parent()} : QObject{other.parent()}
@ -53,7 +54,8 @@ RoomInfoItem::RoomInfoItem(const RoomInfoItem &other)
, roomName_{other.roomName_} , roomName_{other.roomName_}
, image_{other.image_} , image_{other.image_}
, unreadNotifications_{other.unreadNotifications_} , unreadNotifications_{other.unreadNotifications_}
{} {
}
RoomInfoItem & RoomInfoItem &
RoomInfoItem::operator=(const RoomInfoItem &other) RoomInfoItem::operator=(const RoomInfoItem &other)

View file

@ -19,7 +19,8 @@
NhekoDBusBackend::NhekoDBusBackend(RoomlistModel *parent) NhekoDBusBackend::NhekoDBusBackend(RoomlistModel *parent)
: QObject{parent} : QObject{parent}
, m_parent{parent} , m_parent{parent}
{} {
}
namespace { namespace {
struct RoomReplyState struct RoomReplyState

View file

@ -82,8 +82,10 @@ Dock::unitySetNotificationCount(const int count)
#else #else
Dock::Dock(QObject *parent) Dock::Dock(QObject *parent)
: QObject(parent) : QObject(parent)
{} {
}
void void
Dock::setUnreadCount(const int) Dock::setUnreadCount(const int)
{} {
}
#endif #endif

View file

@ -15,7 +15,8 @@
VerificationManager::VerificationManager(TimelineViewManager *o) VerificationManager::VerificationManager(TimelineViewManager *o)
: QObject(o) : QObject(o)
, rooms_(o->rooms()) , rooms_(o->rooms())
{} {
}
static bool static bool
isValidTime(std::optional<uint64_t> t) isValidTime(std::optional<uint64_t> t)

View file

@ -102,7 +102,8 @@ registerSignalHandlers()
// No implementation for systems with no stacktrace support. // No implementation for systems with no stacktrace support.
void void
registerSignalHandlers() registerSignalHandlers()
{} {
}
#endif #endif

View file

@ -44,7 +44,8 @@ init()
NotificationsManager::NotificationsManager(QObject *parent) NotificationsManager::NotificationsManager(QObject *parent)
: QObject(parent) : QObject(parent)
{} {
}
void void
NotificationsManager::postNotification(const mtx::responses::Notification &notification, NotificationsManager::postNotification(const mtx::responses::Notification &notification,

View file

@ -62,7 +62,8 @@ public:
, canonical(canonical_) , canonical(canonical_)
, canEditParent(canEditParent_) , canEditParent(canEditParent_)
, canEditChild(canEditChild_) , canEditChild(canEditChild_)
{} {
}
QString roomid, name; QString roomid, name;
int treeIndex = 0; int treeIndex = 0;

View file

@ -74,7 +74,8 @@ private:
DelegateIncubator(DelegateChooser &parent) DelegateIncubator(DelegateChooser &parent)
: QQmlIncubator(QQmlIncubator::AsynchronousIfNested) : QQmlIncubator(QQmlIncubator::AsynchronousIfNested)
, chooser(parent) , chooser(parent)
{} {
}
void statusChanged(QQmlIncubator::Status status) override; void statusChanged(QQmlIncubator::Status status) override;
DelegateChooser &chooser; DelegateChooser &chooser;

View file

@ -48,7 +48,8 @@ class InputVideoSurface : public QAbstractVideoSurface
public: public:
InputVideoSurface(QObject *parent) InputVideoSurface(QObject *parent)
: QAbstractVideoSurface(parent) : QAbstractVideoSurface(parent)
{} {
}
bool present(const QVideoFrame &frame) override; bool present(const QVideoFrame &frame) override;

View file

@ -19,7 +19,8 @@ class PresenceEmitter : public QObject
public: public:
PresenceEmitter(QObject *p = nullptr) PresenceEmitter(QObject *p = nullptr)
: QObject(p) : QObject(p)
{} {
}
void sync(const std::vector<mtx::events::Event<mtx::events::presence::Presence>> &presences); void sync(const std::vector<mtx::events::Event<mtx::events::presence::Presence>> &presences);

View file

@ -1467,7 +1467,8 @@ struct SendMessageVisitor
{ {
explicit SendMessageVisitor(TimelineModel *model) explicit SendMessageVisitor(TimelineModel *model)
: model_(model) : model_(model)
{} {
}
template<typename T, mtx::events::EventType Event> template<typename T, mtx::events::EventType Event>
void sendRoomEvent(mtx::events::RoomEvent<T> msg) void sendRoomEvent(mtx::events::RoomEvent<T> msg)
@ -1491,7 +1492,8 @@ struct SendMessageVisitor
// Do-nothing operator for all unhandled events // Do-nothing operator for all unhandled events
template<typename T> template<typename T>
void operator()(const mtx::events::Event<T> &) void operator()(const mtx::events::Event<T> &)
{} {
}
// Operator for m.room.message events that contain a msgtype in their content // Operator for m.room.message events that contain a msgtype in their content
template<typename T, template<typename T,

View file

@ -152,7 +152,8 @@ class StateKeeper
public: public:
StateKeeper(std::function<void()> &&fn) StateKeeper(std::function<void()> &&fn)
: fn_(std::move(fn)) : fn_(std::move(fn))
{} {
}
~StateKeeper() { fn_(); } ~StateKeeper() { fn_(); }

View file

@ -18,7 +18,8 @@ class HiddenEvents : public QObject
public: public:
explicit HiddenEvents(QObject *p = nullptr) explicit HiddenEvents(QObject *p = nullptr)
: QObject(p) : QObject(p)
{} {
}
Q_INVOKABLE void toggle(int type); Q_INVOKABLE void toggle(int type);
Q_INVOKABLE void save(); Q_INVOKABLE void save();

View file

@ -10,7 +10,8 @@
NhekoCursorShape::NhekoCursorShape(QQuickItem *parent) NhekoCursorShape::NhekoCursorShape(QQuickItem *parent)
: QQuickItem(parent) : QQuickItem(parent)
, currentShape_(Qt::CursorShape::ArrowCursor) , currentShape_(Qt::CursorShape::ArrowCursor)
{} {
}
Qt::CursorShape Qt::CursorShape
NhekoCursorShape::cursorShape() const NhekoCursorShape::cursorShape() const

View file

@ -20,7 +20,8 @@ public:
UIA(QObject *parent = nullptr) UIA(QObject *parent = nullptr)
: QObject(parent) : QObject(parent)
{} {
}
mtx::http::UIAHandler genericHandler(QString context); mtx::http::UIAHandler genericHandler(QString context);

View file

@ -39,7 +39,8 @@ class UserProfileFetchProxy : public QObject
public: public:
UserProfileFetchProxy(QObject *p = nullptr) UserProfileFetchProxy(QObject *p = nullptr)
: QObject(p) : QObject(p)
{} {
}
signals: signals:
void profileFetched(mtx::responses::Profile); void profileFetched(mtx::responses::Profile);
@ -58,7 +59,8 @@ public:
, verification_status(verification_status_) , verification_status(verification_status_)
, lastIp(lastIp_) , lastIp(lastIp_)
, lastTs(lastTs_) , lastTs(lastTs_)
{} {
}
DeviceInfo(const QString deviceID, DeviceInfo(const QString deviceID,
const QString displayName, const QString displayName,
verification::Status verification_status_) verification::Status verification_status_)
@ -66,10 +68,12 @@ public:
, display_name(displayName) , display_name(displayName)
, verification_status(verification_status_) , verification_status(verification_status_)
, lastTs(0) , lastTs(0)
{} {
}
DeviceInfo() DeviceInfo()
: verification_status(verification::UNVERIFIED) : verification_status(verification::UNVERIFIED)
{} {
}
QString device_id; QString device_id;
QString display_name; QString display_name;

View file

@ -20,7 +20,8 @@ extern "C"
CallDevices::CallDevices() CallDevices::CallDevices()
: QObject() : QObject()
{} {
}
#ifdef GSTREAMER_AVAILABLE #ifdef GSTREAMER_AVAILABLE
namespace { namespace {

View file

@ -1153,7 +1153,8 @@ WebRTCSession::acceptAnswer(const std::string &)
void void
WebRTCSession::acceptICECandidates( WebRTCSession::acceptICECandidates(
const std::vector<mtx::events::voip::CallCandidates::Candidate> &) const std::vector<mtx::events::voip::CallCandidates::Candidate> &)
{} {
}
bool bool
WebRTCSession::isMicMuted() const WebRTCSession::isMicMuted() const
@ -1169,10 +1170,12 @@ WebRTCSession::toggleMicMute()
void void
WebRTCSession::toggleLocalPiP() WebRTCSession::toggleLocalPiP()
{} {
}
void void
WebRTCSession::end() WebRTCSession::end()
{} {
}
#endif #endif