X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatviewsearchcontroller.cpp;h=243817e13e6412ab70ba8259cd776a40d5f0fe16;hb=HEAD;hp=b81e261aa943a3a86855252b3aecae6eef48e198;hpb=cc6e7c08709c4e761e2fd9c2e322751015497003;p=quassel.git diff --git a/src/qtui/chatviewsearchcontroller.cpp b/src/qtui/chatviewsearchcontroller.cpp index b81e261a..90dd0f39 100644 --- a/src/qtui/chatviewsearchcontroller.cpp +++ b/src/qtui/chatviewsearchcontroller.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -20,6 +20,8 @@ #include "chatviewsearchcontroller.h" +#include + #include #include @@ -39,7 +41,7 @@ void ChatViewSearchController::setSearchString(const QString& searchString) _searchString = searchString; if (_scene) { if (!searchString.startsWith(oldSearchString) || oldSearchString.isEmpty()) { - // we can't reuse our all findings... cler the scene and do it all over + // we can't reuse our all findings... clear the scene and do it all over updateHighlights(); } else { @@ -116,7 +118,7 @@ void ChatViewSearchController::updateHighlights(bool reuse) if (line) chatLines << line; } - foreach (ChatLine* line, QList(chatLines.toList())) { + foreach (ChatLine* line, chatLines) { updateHighlights(line); } } @@ -300,8 +302,7 @@ void ChatViewSearchController::repositionHighlights() if (line) chatLines << line; } - QList chatLineList(chatLines.toList()); - foreach (ChatLine* line, chatLineList) { + foreach (ChatLine* line, chatLines) { repositionHighlights(line); } } @@ -330,7 +331,7 @@ void ChatViewSearchController::repositionHighlights(ChatLine* line) } } - qSort(searchHighlights.begin(), searchHighlights.end(), SearchHighlightItem::firstInLine); + std::sort(searchHighlights.begin(), searchHighlights.end(), SearchHighlightItem::firstInLine); Q_ASSERT(wordPos.count() == searchHighlights.count()); for (int i = 0; i < searchHighlights.count(); i++) {