summaryrefslogtreecommitdiffstats
path: root/src/gui/util
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2010-07-15 09:08:17 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2010-07-15 09:10:22 (GMT)
commit910b8fe6222011b8f94259f165bcf4d4002172c0 (patch)
tree26b20e1a3464499876af0c4d1cac7fe84200a375 /src/gui/util
parent633349982422fec92df4ed06da5d2becf788c494 (diff)
downloadQt-910b8fe6222011b8f94259f165bcf4d4002172c0.zip
Qt-910b8fe6222011b8f94259f165bcf4d4002172c0.tar.gz
Qt-910b8fe6222011b8f94259f165bcf4d4002172c0.tar.bz2
QFileDialog : Fix completer showing up on the MyComputer view.
Only complete if there is a text to complete Reviewed-by:janarve
Diffstat (limited to 'src/gui/util')
-rw-r--r--src/gui/util/qcompleter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index 1abc2d9..04d6de9 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -154,6 +154,7 @@
#include "QtGui/qevent.h"
#include "QtGui/qheaderview.h"
#include "QtGui/qdesktopwidget.h"
+#include "QtGui/qlineedit.h"
QT_BEGIN_NAMESPACE
@@ -920,8 +921,9 @@ void QCompleterPrivate::showPopup(const QRect& rect)
void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path)
{
Q_Q(QCompleter);
+ QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget);
//the path given by QFileSystemModel does not end with /
- if (!q->completionPrefix().isEmpty() && q->completionPrefix() != path + QLatin1Char('/'))
+ if (lineEdit && !lineEdit->text().isEmpty() && !q->completionPrefix().isEmpty() && q->completionPrefix() != path + QLatin1Char('/'))
q->complete();
}