/***************************************************************************
- * 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 *
#include "chatviewsearchcontroller.h"
+#include <algorithm>
+
#include <QAbstractItemModel>
#include <QPainter>
_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 {
if (line)
chatLines << line;
}
- foreach (ChatLine* line, QList<ChatLine*>(chatLines.toList())) {
+ foreach (ChatLine* line, chatLines) {
updateHighlights(line);
}
}
if (line)
chatLines << line;
}
- QList<ChatLine*> chatLineList(chatLines.toList());
- foreach (ChatLine* line, chatLineList) {
+ foreach (ChatLine* line, chatLines) {
repositionHighlights(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++) {