Convert features.fscompleter to QT_[REQUIRE_]CONFIG

Fix one #include as only QCompleter is used and not QFSCompleter.

Change-Id: Ia1e722122f7e322c678d2db6962c6086c684ddd9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-05-31 22:34:24 +02:00
parent 379179df9d
commit 341554e343
5 changed files with 19 additions and 16 deletions

View File

@ -61,7 +61,7 @@
#include <QtWidgets/qdialogbuttonbox.h>
#include "private/qfscompleter_p.h"
#include <private/qcompleter_p.h>
#include "ui_qprintpropertieswidget.h"
#include "ui_qprintsettingsoutput.h"
#include "ui_qprintwidget.h"

View File

@ -1,7 +1,6 @@
# Qt dialogs module
HEADERS += \
dialogs/qfscompleter_p.h \
dialogs/qfontdialog.h \
dialogs/qfontdialog_p.h \
dialogs/qfilesystemmodel.h \
@ -46,6 +45,10 @@ qtConfig(filedialog) {
FORMS += dialogs/qfiledialog.ui
}
qtConfig(fscompleter) {
HEADERS += dialogs/qfscompleter_p.h
}
qtConfig(inputdialog) {
HEADERS += dialogs/qinputdialog.h
SOURCES += dialogs/qinputdialog.cpp

View File

@ -841,7 +841,7 @@ void QFileDialog::setVisible(bool visible)
// Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
// updates the state correctly, but skips showing the non-native version:
setAttribute(Qt::WA_DontShowOnScreen);
#ifndef QT_NO_FSCOMPLETER
#if QT_CONFIG(fscompleter)
// So the completer doesn't try to complete and therefore show a popup
if (!d->nativeDialogInUse)
d->completer->setModel(0);
@ -849,7 +849,7 @@ void QFileDialog::setVisible(bool visible)
} else {
d->createWidgets();
setAttribute(Qt::WA_DontShowOnScreen, false);
#ifndef QT_NO_FSCOMPLETER
#if QT_CONFIG(fscompleter)
if (!d->nativeDialogInUse) {
if (d->proxyModel != 0)
d->completer->setModel(d->proxyModel);
@ -922,7 +922,7 @@ void QFileDialog::setDirectory(const QString &directory)
if (!d->nativeDialogInUse) {
d->qFileDialogUi->newFolderButton->setEnabled(d->model->flags(root) & Qt::ItemIsDropEnabled);
if (root != d->rootIndex()) {
#ifndef QT_NO_FSCOMPLETER
#if QT_CONFIG(fscompleter)
if (directory.endsWith(QLatin1Char('/')))
d->completer->setCompletionPrefix(newDirectory);
else
@ -2909,10 +2909,10 @@ void QFileDialogPrivate::createWidgets()
#ifndef QT_NO_SHORTCUT
qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit);
#endif
#ifndef QT_NO_FSCOMPLETER
#if QT_CONFIG(fscompleter)
completer = new QFSCompleter(model, q);
qFileDialogUi->fileNameEdit->setCompleter(completer);
#endif // QT_NO_FSCOMPLETER
#endif // QT_CONFIG(fscompleter)
qFileDialogUi->fileNameEdit->setInputMethodHints(Qt::ImhNoPredictiveText);
@ -3078,7 +3078,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel)
proxyModel->setSourceModel(d->model);
d->qFileDialogUi->listView->setModel(d->proxyModel);
d->qFileDialogUi->treeView->setModel(d->proxyModel);
#ifndef QT_NO_FSCOMPLETER
#if QT_CONFIG(fscompleter)
d->completer->setModel(d->proxyModel);
d->completer->proxyModel = d->proxyModel;
#endif
@ -3088,7 +3088,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel)
d->proxyModel = 0;
d->qFileDialogUi->listView->setModel(d->model);
d->qFileDialogUi->treeView->setModel(d->model);
#ifndef QT_NO_FSCOMPLETER
#if QT_CONFIG(fscompleter)
d->completer->setModel(d->model);
d->completer->sourceModel = d->model;
d->completer->proxyModel = 0;
@ -4028,7 +4028,7 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e)
e->accept();
}
#ifndef QT_NO_FSCOMPLETER
#if QT_CONFIG(fscompleter)
QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
{

View File

@ -73,7 +73,9 @@
#include <qpointer.h>
#include <qdebug.h>
#include "qsidebar_p.h"
#if QT_CONFIG(fscompleter)
#include "qfscompleter_p.h"
#endif
#if defined (Q_OS_UNIX)
#include <unistd.h>
@ -231,9 +233,9 @@ public:
QStringList watching;
QFileSystemModel *model;
#ifndef QT_NO_FSCOMPLETER
#if QT_CONFIG(fscompleter)
QFSCompleter *completer;
#endif //QT_NO_FSCOMPLETER
#endif //QT_CONFIG(fscompleter)
QString setWindowTitle;

View File

@ -55,9 +55,9 @@
#include "qcompleter.h"
#include <QtWidgets/qfilesystemmodel.h>
QT_BEGIN_NAMESPACE
QT_REQUIRE_CONFIG(fscompleter);
#ifndef QT_NO_FSCOMPLETER
QT_BEGIN_NAMESPACE
/*!
QCompleter that can deal with QFileSystemModel
@ -78,8 +78,6 @@ public:
QFileSystemModel *sourceModel;
};
#endif // QT_NO_FSCOMPLETER
QT_END_NAMESPACE
#endif // QFSCOMPLETOR_P_H