From 1bbf7fb4e39fd1382e3956e2bb5fbebaca01cf53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Sat, 9 Jan 2016 19:58:06 +0000 Subject: Fix a few container detachments Change-Id: I018a1fe4bdbbe42b683793d7ddbf19f464d6e3b0 Reviewed-by: Marc Mutz --- src/widgets/util/qcompleter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/widgets/util/qcompleter.cpp') diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index ba56f004b7..4382abaf50 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -432,7 +432,7 @@ void QCompletionEngine::filter(const QStringList& parts) QModelIndex parent; for (int i = 0; i < curParts.count() - 1; i++) { - QString part = curParts[i]; + QString part = curParts.at(i); int emi = filter(part, parent, -1).exactMatchIndex; if (emi == -1) return; @@ -442,10 +442,10 @@ void QCompletionEngine::filter(const QStringList& parts) // Note that we set the curParent to a valid parent, even if we have no matches // When filtering is disabled, we show all the items under this parent curParent = parent; - if (curParts.last().isEmpty()) + if (curParts.constLast().isEmpty()) curMatch = QMatchData(QIndexMapper(0, model->rowCount(curParent) - 1), -1, false); else - curMatch = filter(curParts.last(), curParent, 1); // build at least one + curMatch = filter(curParts.constLast(), curParent, 1); // build at least one curRow = curMatch.isValid() ? 0 : -1; } -- cgit v1.2.3