1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

style: change code in searchInText

This commit is contained in:
TriKriSta 2018-02-12 19:35:50 +02:00
parent ffb51e8a0e
commit f73021c376

View File

@ -582,7 +582,9 @@ bool GenericChatForm::searchInText(const QString& phrase, bool searchUp)
for (int i = startLine; searchUp ? i >= 0 : i < numLines; searchUp ? --i : ++i) {
ChatLine::Ptr l = lines[i];
if (l->getColumnCount() < 2) { continue; }
if (l->getColumnCount() < 2) {
continue;
}
ChatLineContent* content = l->getContent(1);
Text* text = static_cast<Text*>(content);
@ -596,7 +598,10 @@ bool GenericChatForm::searchInText(const QString& phrase, bool searchUp)
QString txt = content->getText();
if (txt.contains(phrase, Qt::CaseInsensitive)) {
if (!txt.contains(phrase, Qt::CaseInsensitive)) {
continue;
}
int index = indexForSearchInLine(txt, phrase, searchUp);
if ((index == -1 && searchPoint.y() > -1)) {
text->deselectText();
@ -611,7 +616,6 @@ bool GenericChatForm::searchInText(const QString& phrase, bool searchUp)
break;
}
}
}
return isSearch;
}