From 111708e655d66fb0dcbc4f2cbdc2abf14c700cf4 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 17 Mar 2010 00:11:55 +0100 Subject: Fix the QPrintDialog showing a popup with nothing. QPrintDialog uses QFileSystemModel with QCompleter. In that case with the 4.7 version of QCompleter it was trying to complete stuff even if the prefix was empty. I also fixed QPrintDialog, it was using QFSCompleter which didn't work in QPrintDialog (QFSCompleter is designed for QFileDialog). Now it uses a regular QCompleter. Task-number:QTBUG-8556 Reviewed-by:trond --- src/gui/dialogs/qprintdialog_unix.cpp | 4 +--- src/gui/util/qcompleter.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp index 17283f5..9b4d6e8 100644 --- a/src/gui/dialogs/qprintdialog_unix.cpp +++ b/src/gui/dialogs/qprintdialog_unix.cpp @@ -706,9 +706,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p) #ifndef QT_NO_FILESYSTEMMODEL QFileSystemModel *fsm = new QFileSystemModel(widget.filename); fsm->setRootPath(QDir::homePath()); -#if !defined(QT_NO_FSCOMPLETER) && !defined(QT_NO_FILEDIALOG) - widget.filename->setCompleter(new QFSCompleter(fsm, widget.filename)); -#endif + widget.filename->setCompleter(new QCompleter(fsm, widget.filename)); #endif _q_printerChanged(currentPrinterIndex); diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index b7be967..387bf87 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -907,7 +907,7 @@ void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path) { Q_Q(QCompleter); //the path given by QFileSystemModel does not end with / - if (q->completionPrefix() != path + QLatin1Char('/')) + if (!q->completionPrefix().isEmpty() && q->completionPrefix() != path + QLatin1Char('/')) q->complete(); } -- cgit v0.12