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) TextInputWidget::changeCallButtonState(webrtc::State state)
{ {
QIcon icon; QIcon icon;
if (state == webrtc::State::ICEFAILED || if (state == webrtc::State::ICEFAILED || state == webrtc::State::DISCONNECTED) {
state == webrtc::State::DISCONNECTED) {
callBtn_->setToolTip(tr("Place a call")); callBtn_->setToolTip(tr("Place a call"));
icon.addFile(":/icons/icons/ui/place-call.png"); icon.addFile(":/icons/icons/ui/place-call.png");
} else { } else {

View file

@ -1,5 +1,5 @@
#include <cctype>
#include <QQmlEngine> #include <QQmlEngine>
#include <cctype>
#include "Logging.h" #include "Logging.h"
#include "WebRTCSession.h" #include "WebRTCSession.h"
@ -21,15 +21,10 @@ using webrtc::State;
WebRTCSession::WebRTCSession() WebRTCSession::WebRTCSession()
: QObject() : QObject()
{ {
qRegisterMetaType<webrtc::State>(); qRegisterMetaType<webrtc::State>();
qmlRegisterUncreatableMetaObject( qmlRegisterUncreatableMetaObject(
webrtc::staticMetaObject, webrtc::staticMetaObject, "im.nheko", 1, 0, "WebRTCState", "Can't instantiate enum");
"im.nheko",
1,
0,
"WebRTCState",
"Can't instantiate enum");
connect(this, &WebRTCSession::stateChanged, this, &WebRTCSession::setState); connect(this, &WebRTCSession::stateChanged, this, &WebRTCSession::setState);
init(); init();
@ -257,12 +252,10 @@ iceGatheringStateChanged(GstElement *webrtc,
nhlog::ui()->debug("WebRTC: GstWebRTCICEGatheringState -> Complete"); nhlog::ui()->debug("WebRTC: GstWebRTCICEGatheringState -> Complete");
if (isoffering_) { if (isoffering_) {
emit WebRTCSession::instance().offerCreated(localsdp_, localcandidates_); emit WebRTCSession::instance().offerCreated(localsdp_, localcandidates_);
emit WebRTCSession::instance().stateChanged( emit WebRTCSession::instance().stateChanged(State::OFFERSENT);
State::OFFERSENT);
} else { } else {
emit WebRTCSession::instance().answerCreated(localsdp_, localcandidates_); emit WebRTCSession::instance().answerCreated(localsdp_, localcandidates_);
emit WebRTCSession::instance().stateChanged( emit WebRTCSession::instance().stateChanged(State::ANSWERSENT);
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))) if (GST_PAD_LINK_FAILED(gst_pad_link(newpad, queuepad)))
nhlog::ui()->error("WebRTC: unable to link new pad"); nhlog::ui()->error("WebRTC: unable to link new pad");
else { else {
emit WebRTCSession::instance().stateChanged( emit WebRTCSession::instance().stateChanged(State::CONNECTED);
State::CONNECTED);
} }
gst_object_unref(queuepad); gst_object_unref(queuepad);
} }

View file

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

View file

@ -34,8 +34,7 @@ class TimelineViewManager : public QObject
bool isInitialSync MEMBER isInitialSync_ READ isInitialSync NOTIFY initialSyncChanged) bool isInitialSync MEMBER isInitialSync_ READ isInitialSync NOTIFY initialSyncChanged)
Q_PROPERTY( Q_PROPERTY(
bool isNarrowView MEMBER isNarrowView_ READ isNarrowView NOTIFY narrowViewChanged) bool isNarrowView MEMBER isNarrowView_ READ isNarrowView NOTIFY narrowViewChanged)
Q_PROPERTY( Q_PROPERTY(webrtc::State callState READ callState NOTIFY callStateChanged)
webrtc::State callState READ callState NOTIFY callStateChanged)
public: public:
TimelineViewManager(QSharedPointer<UserSettings> userSettings, TimelineViewManager(QSharedPointer<UserSettings> userSettings,
@ -52,7 +51,10 @@ public:
Q_INVOKABLE bool isInitialSync() const { return isInitialSync_; } Q_INVOKABLE bool isInitialSync() const { return isInitialSync_; }
bool isNarrowView() const { return isNarrowView_; } bool isNarrowView() const { return isNarrowView_; }
webrtc::State callState() const { return WebRTCSession::instance().state(); } 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 void openImageOverlay(QString mxcUrl, QString eventId) const;
Q_INVOKABLE QColor userColor(QString id, QColor background); Q_INVOKABLE QColor userColor(QString id, QColor background);
Q_INVOKABLE QString escapeEmoji(QString str) const; Q_INVOKABLE QString escapeEmoji(QString str) const;