clang-format

This commit is contained in:
trilene 2020-09-22 12:14:15 -04:00
parent da27670cbe
commit 44cfc8d22a
4 changed files with 16 additions and 21 deletions

View file

@ -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 {

View file

@ -1,5 +1,5 @@
#include <cctype>
#include <QQmlEngine>
#include <cctype>
#include "Logging.h"
#include "WebRTCSession.h"
@ -21,15 +21,10 @@ using webrtc::State;
WebRTCSession::WebRTCSession()
: QObject()
{
{
qRegisterMetaType<webrtc::State>();
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);
}

View file

@ -141,8 +141,10 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettin
isInitialSync_ = true;
emit initialSyncChanged(true);
});
connect(
&WebRTCSession::instance(), &WebRTCSession::stateChanged, this, &TimelineViewManager::callStateChanged);
connect(&WebRTCSession::instance(),
&WebRTCSession::stateChanged,
this,
&TimelineViewManager::callStateChanged);
}
void

View file

@ -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> 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;