Fix linting issues

This commit is contained in:
redsky17 2019-05-27 16:06:28 -04:00
parent 7c630b1363
commit 9671b1c0d6
No known key found for this signature in database
GPG key ID: E8A1D78EF044B0CB
2 changed files with 16 additions and 18 deletions

View file

@ -126,8 +126,8 @@ void
TimelineItem::adjustMessageLayoutForWidget() TimelineItem::adjustMessageLayoutForWidget()
{ {
messageLayout_->addLayout(widgetLayout_, 1); messageLayout_->addLayout(widgetLayout_, 1);
actionLayout_->addWidget(replyBtn_); actionLayout_->addWidget(replyBtn_);
actionLayout_->addWidget(contextBtn_); actionLayout_->addWidget(contextBtn_);
messageLayout_->addLayout(actionLayout_); messageLayout_->addLayout(actionLayout_);
messageLayout_->addWidget(statusIndicator_); messageLayout_->addWidget(statusIndicator_);
messageLayout_->addWidget(timestamp_); messageLayout_->addWidget(timestamp_);
@ -145,8 +145,8 @@ void
TimelineItem::adjustMessageLayout() TimelineItem::adjustMessageLayout()
{ {
messageLayout_->addWidget(body_, 1); messageLayout_->addWidget(body_, 1);
actionLayout_->addWidget(replyBtn_); actionLayout_->addWidget(replyBtn_);
actionLayout_->addWidget(contextBtn_); actionLayout_->addWidget(contextBtn_);
messageLayout_->addLayout(actionLayout_); messageLayout_->addLayout(actionLayout_);
messageLayout_->addWidget(statusIndicator_); messageLayout_->addWidget(statusIndicator_);
messageLayout_->addWidget(timestamp_); messageLayout_->addWidget(timestamp_);
@ -163,10 +163,10 @@ TimelineItem::adjustMessageLayout()
void void
TimelineItem::init() TimelineItem::init()
{ {
userAvatar_ = nullptr; userAvatar_ = nullptr;
timestamp_ = nullptr; timestamp_ = nullptr;
userName_ = nullptr; userName_ = nullptr;
body_ = nullptr; body_ = nullptr;
auto buttonSize_ = 32; auto buttonSize_ = 32;
contextMenu_ = new QMenu(this); contextMenu_ = new QMenu(this);
@ -179,7 +179,6 @@ TimelineItem::init()
contextMenu_->addAction(markAsRead_); contextMenu_->addAction(markAsRead_);
contextMenu_->addAction(redactMsg_); contextMenu_->addAction(redactMsg_);
connect(showReadReceipts_, &QAction::triggered, this, [this]() { connect(showReadReceipts_, &QAction::triggered, this, [this]() {
if (!event_id_.isEmpty()) if (!event_id_.isEmpty())
MainWindow::instance()->openReadReceiptsDialog(event_id_); MainWindow::instance()->openReadReceiptsDialog(event_id_);
@ -221,7 +220,7 @@ TimelineItem::init()
topLayout_ = new QHBoxLayout(this); topLayout_ = new QHBoxLayout(this);
mainLayout_ = new QVBoxLayout; mainLayout_ = new QVBoxLayout;
messageLayout_ = new QHBoxLayout; messageLayout_ = new QHBoxLayout;
actionLayout_ = new QHBoxLayout; actionLayout_ = new QHBoxLayout;
messageLayout_->setContentsMargins(0, 0, MSG_RIGHT_MARGIN, 0); messageLayout_->setContentsMargins(0, 0, MSG_RIGHT_MARGIN, 0);
messageLayout_->setSpacing(MSG_PADDING); messageLayout_->setSpacing(MSG_PADDING);
@ -870,13 +869,13 @@ TimelineItem::addReplyAction()
} }
void void
TimelineItem::replyAction() { TimelineItem::replyAction()
if (!body_) {
return; if (!body_)
return;
emit ChatPage::instance()->messageReply( emit ChatPage::instance()->messageReply(
Cache::displayName(room_id_, descriptionMsg_.userid), Cache::displayName(room_id_, descriptionMsg_.userid), body_->toPlainText());
body_->toPlainText());
} }
void void

View file

@ -289,7 +289,7 @@ private:
QHBoxLayout *topLayout_ = nullptr; QHBoxLayout *topLayout_ = nullptr;
QHBoxLayout *messageLayout_ = nullptr; QHBoxLayout *messageLayout_ = nullptr;
QHBoxLayout *actionLayout_ = nullptr; QHBoxLayout *actionLayout_ = nullptr;
QVBoxLayout *mainLayout_ = nullptr; QVBoxLayout *mainLayout_ = nullptr;
QHBoxLayout *widgetLayout_ = nullptr; QHBoxLayout *widgetLayout_ = nullptr;
@ -307,7 +307,6 @@ private:
FlatButton *replyBtn_; FlatButton *replyBtn_;
FlatButton *contextBtn_; FlatButton *contextBtn_;
}; };
template<class Widget> template<class Widget>