cppcheck stuff (#1200)

* cppcheck stuff

* Update src/ui/RoomSettings.cpp

Co-authored-by: DeepBlueV7.X <nicolas.werner@hotmail.de>

* Update src/ui/RoomSettings.cpp

Co-authored-by: DeepBlueV7.X <nicolas.werner@hotmail.de>

* Fix linting

Co-authored-by: DeepBlueV7.X <nicolas.werner@hotmail.de>
This commit is contained in:
Loren Burkholder 2022-10-03 17:57:30 -04:00 committed by GitHub
parent 5e9eb845ab
commit 8ecbb39dc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 162 additions and 146 deletions

View file

@ -31,8 +31,8 @@ key_verification_mac(mtx::crypto::SAS *sas,
DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
DeviceVerificationFlow::Type flow_type,
TimelineModel *model,
QString userID,
std::vector<QString> deviceIds_)
const QString &userID,
const std::vector<QString> &deviceIds_)
: sender(false)
, type(flow_type)
, deviceIds(std::move(deviceIds_))
@ -86,12 +86,14 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
});
if (model) {
connect(
this->model_, &TimelineModel::updateFlowEventId, this, [this](std::string event_id_) {
this->relation.rel_type = mtx::common::RelationType::Reference;
this->relation.event_id = event_id_;
this->transaction_id = event_id_;
});
connect(this->model_,
&TimelineModel::updateFlowEventId,
this,
[this](const std::string &event_id_) {
this->relation.rel_type = mtx::common::RelationType::Reference;
this->relation.event_id = event_id_;
this->transaction_id = event_id_;
});
}
connect(timeout, &QTimer::timeout, this, [this]() {
@ -548,7 +550,7 @@ DeviceVerificationFlow::isSelfVerification() const
}
void
DeviceVerificationFlow::setEventId(std::string event_id_)
DeviceVerificationFlow::setEventId(const std::string &event_id_)
{
this->relation.rel_type = mtx::common::RelationType::Reference;
this->relation.event_id = event_id_;
@ -864,8 +866,8 @@ QSharedPointer<DeviceVerificationFlow>
DeviceVerificationFlow::NewInRoomVerification(QObject *parent_,
TimelineModel *timelineModel_,
const mtx::events::msg::KeyVerificationRequest &msg,
QString other_user_,
QString event_id_)
const QString &other_user_,
const QString &event_id_)
{
QSharedPointer<DeviceVerificationFlow> flow(
new DeviceVerificationFlow(parent_,
@ -887,8 +889,8 @@ DeviceVerificationFlow::NewInRoomVerification(QObject *parent_,
QSharedPointer<DeviceVerificationFlow>
DeviceVerificationFlow::NewToDeviceVerification(QObject *parent_,
const mtx::events::msg::KeyVerificationRequest &msg,
QString other_user_,
QString txn_id_)
const QString &other_user_,
const QString &txn_id_)
{
QSharedPointer<DeviceVerificationFlow> flow(new DeviceVerificationFlow(
parent_, Type::ToDevice, nullptr, other_user_, {QString::fromStdString(msg.from_device)}));
@ -905,8 +907,8 @@ DeviceVerificationFlow::NewToDeviceVerification(QObject *parent_,
QSharedPointer<DeviceVerificationFlow>
DeviceVerificationFlow::NewToDeviceVerification(QObject *parent_,
const mtx::events::msg::KeyVerificationStart &msg,
QString other_user_,
QString txn_id_)
const QString &other_user_,
const QString &txn_id_)
{
QSharedPointer<DeviceVerificationFlow> flow(new DeviceVerificationFlow(
parent_, Type::ToDevice, nullptr, other_user_, {QString::fromStdString(msg.from_device)}));
@ -919,7 +921,7 @@ DeviceVerificationFlow::NewToDeviceVerification(QObject *parent_,
QSharedPointer<DeviceVerificationFlow>
DeviceVerificationFlow::InitiateUserVerification(QObject *parent_,
TimelineModel *timelineModel_,
QString userid)
const QString &userid)
{
QSharedPointer<DeviceVerificationFlow> flow(
new DeviceVerificationFlow(parent_, Type::RoomMsg, timelineModel_, userid, {}));
@ -928,8 +930,8 @@ DeviceVerificationFlow::InitiateUserVerification(QObject *parent_,
}
QSharedPointer<DeviceVerificationFlow>
DeviceVerificationFlow::InitiateDeviceVerification(QObject *parent_,
QString userid,
std::vector<QString> devices)
const QString &userid,
const std::vector<QString> &devices)
{
assert(!devices.empty());