From 1f8a5619c8b513bf334596f4be5108101a09b503 Mon Sep 17 00:00:00 2001 From: Diadlo Date: Fri, 27 Oct 2017 20:27:15 +0300 Subject: [PATCH] refactor: Remove call type from callAccepted signal --- src/widget/chatformheader.cpp | 4 +--- src/widget/chatformheader.h | 2 +- src/widget/form/chatform.cpp | 4 +++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/widget/chatformheader.cpp b/src/widget/chatformheader.cpp index 80d58358e..b6215eb4b 100644 --- a/src/widget/chatformheader.cpp +++ b/src/widget/chatformheader.cpp @@ -170,9 +170,7 @@ void ChatFormHeader::showCallConfirm(bool video) QWidget* btn = video ? videoButton : callButton; callConfirm = std::unique_ptr(new CallConfirmWidget(btn)); callConfirm->show(); - connect(callConfirm.get(), &CallConfirmWidget::accepted, this, [this, video]{ - emit callAccepted(video); - }); + connect(callConfirm.get(), &CallConfirmWidget::accepted, this, &ChatFormHeader::callAccepted); connect(callConfirm.get(), &CallConfirmWidget::rejected, this, &ChatFormHeader::callRejected); } diff --git a/src/widget/chatformheader.h b/src/widget/chatformheader.h index 212d687b5..14375fdef 100644 --- a/src/widget/chatformheader.h +++ b/src/widget/chatformheader.h @@ -71,7 +71,7 @@ signals: void nameChanged(const QString& name); - void callAccepted(bool video); + void callAccepted(); void callRejected(); private slots: diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index 739bbb218..851afe798 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -345,7 +345,9 @@ void ChatForm::onAvInvite(uint32_t friendId, bool video) onAvStart(friendId, video); } else { headWidget->showCallConfirm(video); - connect(headWidget, &ChatFormHeader::callAccepted, this, &ChatForm::onAnswerCallTriggered); + connect(headWidget, &ChatFormHeader::callAccepted, this, [this, video] { + onAnswerCallTriggered(video); + }); connect(headWidget, &ChatFormHeader::callRejected, this, &ChatForm::onRejectCallTriggered); auto msg = ChatMessage::createChatInfoMessage(tr("%1 calling").arg(displayedName), ChatMessage::INFO, QDateTime::currentDateTime());