summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-09-02 10:08:08 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-09-02 10:12:25 (GMT)
commit1bce9d21d72a30cc7a17ae646d8fefd71a37c525 (patch)
tree0aa9c62b8a9ac7144cab9d2e403909f294f84c2f /src
parent456feb3c8ecbf5d2349a747f19e742052ecd9762 (diff)
downloadQt-1bce9d21d72a30cc7a17ae646d8fefd71a37c525.zip
Qt-1bce9d21d72a30cc7a17ae646d8fefd71a37c525.tar.gz
Qt-1bce9d21d72a30cc7a17ae646d8fefd71a37c525.tar.bz2
QCompleter could crash when setting the completion prefix
This fixes the autotest that was crashing Task-number: 246056 Reviewed-by: ogoffart
Diffstat (limited to 'src')
-rw-r--r--src/gui/util/qcompleter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index 6196f0f..87dab42 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -823,12 +823,11 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted)
Q_Q(QCompleter);
QString completion;
- if (!(index.flags() & Qt::ItemIsEnabled))
- return;
-
if (!index.isValid() || (!proxy->showAll && (index.row() >= proxy->engine->matchCount()))) {
completion = prefix;
} else {
+ if (!(index.flags() & Qt::ItemIsEnabled))
+ return;
QModelIndex si = proxy->mapToSource(index);
si = si.sibling(si.row(), column); // for clicked()
completion = q->pathFromIndex(si);