X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatviewsearchcontroller.cpp;h=23609136b74d2505376af61d858ab97e58fccca9;hp=7bae02fd5d20ae5441170e5bba688ff9a47caf01;hb=e2188dc438be6f3eb0d9cdf47d28821aefe9835e;hpb=6d35d3ab0b4885c2db40e5aa25574a5764e52c51 diff --git a/src/qtui/chatviewsearchcontroller.cpp b/src/qtui/chatviewsearchcontroller.cpp index 7bae02fd..23609136 100644 --- a/src/qtui/chatviewsearchcontroller.cpp +++ b/src/qtui/chatviewsearchcontroller.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -30,13 +30,7 @@ #include "messagemodel.h" ChatViewSearchController::ChatViewSearchController(QObject *parent) - : QObject(parent), - _scene(0), - _currentHighlight(0), - _caseSensitive(false), - _searchSenders(false), - _searchMsgs(true), - _searchOnlyRegularMsgs(true) + : QObject(parent) { } @@ -65,8 +59,8 @@ void ChatViewSearchController::setScene(ChatScene *scene) return; if (_scene) { - disconnect(_scene, 0, this, 0); - disconnect(Client::messageModel(), 0, this, 0); + disconnect(_scene, nullptr, this, nullptr); + disconnect(Client::messageModel(), nullptr, this, nullptr); qDeleteAll(_highlightItems); _highlightItems.clear(); } @@ -124,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; } @@ -265,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; @@ -310,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; } @@ -325,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; } @@ -357,7 +351,7 @@ void ChatViewSearchController::repositionHighlights(ChatLine *line) void ChatViewSearchController::sceneDestroyed() { // WARNING: don't call any methods on scene! - _scene = 0; + _scene = nullptr; // the items will be automatically deleted when the scene is destroyed // so we just have to clear the list; _highlightItems.clear();