Put isValid() in variable.

This commit is contained in:
23rd 2018-08-25 21:21:18 +03:00
parent f8c42918a6
commit 539d8c20d2

View file

@ -861,14 +861,15 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
return; return;
} }
const auto &tooltip = hoverLayoutElement->getCreator().getTooltip(); const auto &tooltip = hoverLayoutElement->getCreator().getTooltip();
bool isLinkValid = hoverLayoutElement->getLink().isValid();
if (tooltip.isEmpty()) { if (tooltip.isEmpty()) {
tooltipWidget->hide(); tooltipWidget->hide();
} else if (hoverLayoutElement->getLink().isValid() && !getSettings()->enableLinkInfoTooltip) { } else if (isLinkValid && !getSettings()->enableLinkInfoTooltip) {
tooltipWidget->hide(); tooltipWidget->hide();
} else { } else {
tooltipWidget->moveTo(this, event->globalPos()); tooltipWidget->moveTo(this, event->globalPos());
tooltipWidget->setWordWrap(hoverLayoutElement->getLink().isValid()); tooltipWidget->setWordWrap(isLinkValid);
tooltipWidget->setText(tooltip); tooltipWidget->setText(tooltip);
tooltipWidget->adjustSize(); tooltipWidget->adjustSize();
tooltipWidget->show(); tooltipWidget->show();
@ -876,7 +877,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
} }
// check if word has a link // check if word has a link
if (hoverLayoutElement->getLink().isValid()) { if (isLinkValid) {
this->setCursor(Qt::PointingHandCursor); this->setCursor(Qt::PointingHandCursor);
} else { } else {
this->setCursor(Qt::ArrowCursor); this->setCursor(Qt::ArrowCursor);