X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatviewsearchcontroller.cpp;h=cff190820d52fd55285afdf63ea91a2be31a5dc3;hb=a0e333e994dce2d949a84930293382020e724596;hp=930aea52759cb4183602b26aebb7a88c17cc06ef;hpb=158443f71d48215eea8b47b836b61afd77654b78;p=quassel.git diff --git a/src/qtui/chatviewsearchcontroller.cpp b/src/qtui/chatviewsearchcontroller.cpp index 930aea52..cff19082 100644 --- a/src/qtui/chatviewsearchcontroller.cpp +++ b/src/qtui/chatviewsearchcontroller.cpp @@ -69,7 +69,7 @@ void ChatViewSearchController::setScene(ChatScene *scene) if (!scene) return; - connect(_scene, SIGNAL(destroyed()), this, SLOT(sceneDestroyed())); + connect(_scene, &QObject::destroyed, this, &ChatViewSearchController::sceneDestroyed); connect(_scene, SIGNAL(layoutChanged()), this, SLOT(repositionHighlights())); connect(Client::messageModel(), SIGNAL(finishedBacklogFetch(BufferId)), this, SLOT(updateHighlights())); updateHighlights(); @@ -118,7 +118,7 @@ void ChatViewSearchController::updateHighlights(bool reuse) if (reuse) { QSet chatLines; foreach(SearchHighlightItem *highlightItem, _highlightItems) { - ChatLine *line = qgraphicsitem_cast(highlightItem->parentItem()); + auto *line = qgraphicsitem_cast(highlightItem->parentItem()); if (line) chatLines << line; } @@ -145,7 +145,7 @@ void ChatViewSearchController::updateHighlights(bool reuse) int start = 0; int end = _highlightItems.count() - 1; QPointF startPos; QPointF endPos; - while (1) { + while (true) { startPos = _highlightItems[start]->scenePos(); endPos = _highlightItems[end]->scenePos(); if (startPos == oldHighlightPos) { @@ -259,7 +259,7 @@ void ChatViewSearchController::updateHighlights(ChatLine *line) } foreach(QGraphicsItem *child, line->childItems()) { - SearchHighlightItem *highlightItem = qgraphicsitem_cast(child); + auto *highlightItem = qgraphicsitem_cast(child); if (!highlightItem) continue; @@ -304,7 +304,7 @@ void ChatViewSearchController::repositionHighlights() { QSet chatLines; foreach(SearchHighlightItem *item, _highlightItems) { - ChatLine *line = qgraphicsitem_cast(item->parentItem()); + auto *line = qgraphicsitem_cast(item->parentItem()); if (line) chatLines << line; } @@ -319,7 +319,7 @@ void ChatViewSearchController::repositionHighlights(ChatLine *line) { QList searchHighlights; foreach(QGraphicsItem *child, line->childItems()) { - SearchHighlightItem *highlightItem = qgraphicsitem_cast(child); + auto *highlightItem = qgraphicsitem_cast(child); if (highlightItem) searchHighlights << highlightItem; } @@ -422,7 +422,7 @@ SearchHighlightItem::SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent) setPos(wordRect.x(), wordRect.y()); updateGeometry(wordRect.width(), wordRect.height()); - connect(&_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(updateHighlight(qreal))); + connect(&_timeLine, &QTimeLine::valueChanged, this, &SearchHighlightItem::updateHighlight); }