From 44cfc8d22afd5b7522a13f52af67839de6a37dcc Mon Sep 17 00:00:00 2001 From: trilene Date: Tue, 22 Sep 2020 12:14:15 -0400 Subject: [PATCH] clang-format --- src/TextInputWidget.cpp | 3 +-- src/WebRTCSession.cpp | 20 ++++++-------------- src/timeline/TimelineViewManager.cpp | 6 ++++-- src/timeline/TimelineViewManager.h | 8 +++++--- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/TextInputWidget.cpp b/src/TextInputWidget.cpp index a7d9797..f0d23e2 100644 --- a/src/TextInputWidget.cpp +++ b/src/TextInputWidget.cpp @@ -779,8 +779,7 @@ void TextInputWidget::changeCallButtonState(webrtc::State state) { QIcon icon; - if (state == webrtc::State::ICEFAILED || - state == webrtc::State::DISCONNECTED) { + if (state == webrtc::State::ICEFAILED || state == webrtc::State::DISCONNECTED) { callBtn_->setToolTip(tr("Place a call")); icon.addFile(":/icons/icons/ui/place-call.png"); } else { diff --git a/src/WebRTCSession.cpp b/src/WebRTCSession.cpp index 8f877c4..b4eaada 100644 --- a/src/WebRTCSession.cpp +++ b/src/WebRTCSession.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include "Logging.h" #include "WebRTCSession.h" @@ -21,15 +21,10 @@ using webrtc::State; WebRTCSession::WebRTCSession() : QObject() -{ +{ qRegisterMetaType(); qmlRegisterUncreatableMetaObject( - webrtc::staticMetaObject, - "im.nheko", - 1, - 0, - "WebRTCState", - "Can't instantiate enum"); + webrtc::staticMetaObject, "im.nheko", 1, 0, "WebRTCState", "Can't instantiate enum"); connect(this, &WebRTCSession::stateChanged, this, &WebRTCSession::setState); init(); @@ -257,12 +252,10 @@ iceGatheringStateChanged(GstElement *webrtc, nhlog::ui()->debug("WebRTC: GstWebRTCICEGatheringState -> Complete"); if (isoffering_) { emit WebRTCSession::instance().offerCreated(localsdp_, localcandidates_); - emit WebRTCSession::instance().stateChanged( - State::OFFERSENT); + emit WebRTCSession::instance().stateChanged(State::OFFERSENT); } else { emit WebRTCSession::instance().answerCreated(localsdp_, localcandidates_); - emit WebRTCSession::instance().stateChanged( - State::ANSWERSENT); + emit WebRTCSession::instance().stateChanged(State::ANSWERSENT); } } } @@ -366,8 +359,7 @@ linkNewPad(GstElement *decodebin G_GNUC_UNUSED, GstPad *newpad, GstElement *pipe if (GST_PAD_LINK_FAILED(gst_pad_link(newpad, queuepad))) nhlog::ui()->error("WebRTC: unable to link new pad"); else { - emit WebRTCSession::instance().stateChanged( - State::CONNECTED); + emit WebRTCSession::instance().stateChanged(State::CONNECTED); } gst_object_unref(queuepad); } diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index 3a308be..09ab8cf 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -141,8 +141,10 @@ TimelineViewManager::TimelineViewManager(QSharedPointer userSettin isInitialSync_ = true; emit initialSyncChanged(true); }); - connect( - &WebRTCSession::instance(), &WebRTCSession::stateChanged, this, &TimelineViewManager::callStateChanged); + connect(&WebRTCSession::instance(), + &WebRTCSession::stateChanged, + this, + &TimelineViewManager::callStateChanged); } void diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h index fdf1603..243927e 100644 --- a/src/timeline/TimelineViewManager.h +++ b/src/timeline/TimelineViewManager.h @@ -34,8 +34,7 @@ class TimelineViewManager : public QObject bool isInitialSync MEMBER isInitialSync_ READ isInitialSync NOTIFY initialSyncChanged) Q_PROPERTY( bool isNarrowView MEMBER isNarrowView_ READ isNarrowView NOTIFY narrowViewChanged) - Q_PROPERTY( - webrtc::State callState READ callState NOTIFY callStateChanged) + Q_PROPERTY(webrtc::State callState READ callState NOTIFY callStateChanged) public: TimelineViewManager(QSharedPointer userSettings, @@ -52,7 +51,10 @@ public: Q_INVOKABLE bool isInitialSync() const { return isInitialSync_; } bool isNarrowView() const { return isNarrowView_; } webrtc::State callState() const { return WebRTCSession::instance().state(); } - Q_INVOKABLE bool toggleMuteAudioSource() { return WebRTCSession::instance().toggleMuteAudioSource(); } + Q_INVOKABLE bool toggleMuteAudioSource() + { + return WebRTCSession::instance().toggleMuteAudioSource(); + } Q_INVOKABLE void openImageOverlay(QString mxcUrl, QString eventId) const; Q_INVOKABLE QColor userColor(QString id, QColor background); Q_INVOKABLE QString escapeEmoji(QString str) const;