modernize: Replace most remaining old-style connects by PMF ones
[quassel.git] / src / qtui / chatviewsearchcontroller.cpp
index 2360913..f12bfa0 100644 (file)
@@ -69,9 +69,9 @@ void ChatViewSearchController::setScene(ChatScene *scene)
     if (!scene)
         return;
 
-    connect(_scene, SIGNAL(destroyed()), this, SLOT(sceneDestroyed()));
-    connect(_scene, SIGNAL(layoutChanged()), this, SLOT(repositionHighlights()));
-    connect(Client::messageModel(), SIGNAL(finishedBacklogFetch(BufferId)), this, SLOT(updateHighlights()));
+    connect(_scene, &QObject::destroyed, this, &ChatViewSearchController::sceneDestroyed);
+    connect(_scene, &ChatScene::layoutChanged, this, [this]() { repositionHighlights(); });
+    connect(Client::messageModel(), &MessageModel::finishedBacklogFetch, this, [this]() { updateHighlights(); });
     updateHighlights();
 }
 
@@ -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) {
@@ -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);
 }