From 539d8c20d2bd225b31922bd36ca672f5ab64f46b Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 25 Aug 2018 21:21:18 +0300 Subject: [PATCH] Put isValid() in variable. --- src/widgets/helper/ChannelView.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index d714884ae..5b64245ba 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -861,14 +861,15 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event) return; } const auto &tooltip = hoverLayoutElement->getCreator().getTooltip(); + bool isLinkValid = hoverLayoutElement->getLink().isValid(); if (tooltip.isEmpty()) { tooltipWidget->hide(); - } else if (hoverLayoutElement->getLink().isValid() && !getSettings()->enableLinkInfoTooltip) { + } else if (isLinkValid && !getSettings()->enableLinkInfoTooltip) { tooltipWidget->hide(); } else { tooltipWidget->moveTo(this, event->globalPos()); - tooltipWidget->setWordWrap(hoverLayoutElement->getLink().isValid()); + tooltipWidget->setWordWrap(isLinkValid); tooltipWidget->setText(tooltip); tooltipWidget->adjustSize(); tooltipWidget->show(); @@ -876,7 +877,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event) } // check if word has a link - if (hoverLayoutElement->getLink().isValid()) { + if (isLinkValid) { this->setCursor(Qt::PointingHandCursor); } else { this->setCursor(Qt::ArrowCursor);