Convert features.dirmodel to QT_[REQUIRE_]CONFIG
Change-Id: I8e2c6b49857ffb292c4b08ccab560c59665cc3a4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
fcfee98f62
commit
43b7c0c609
@ -10,7 +10,6 @@ HEADERS += \
|
||||
itemviews/qabstractitemdelegate.h \
|
||||
itemviews/qabstractitemdelegate_p.h \
|
||||
itemviews/qitemdelegate.h \
|
||||
itemviews/qdirmodel.h \
|
||||
itemviews/qwidgetitemdata_p.h \
|
||||
itemviews/qitemeditorfactory.h \
|
||||
itemviews/qitemeditorfactory_p.h \
|
||||
@ -23,7 +22,6 @@ SOURCES += \
|
||||
itemviews/qbsptree.cpp \
|
||||
itemviews/qabstractitemdelegate.cpp \
|
||||
itemviews/qitemdelegate.cpp \
|
||||
itemviews/qdirmodel.cpp \
|
||||
itemviews/qitemeditorfactory.cpp \
|
||||
itemviews/qdatawidgetmapper.cpp \
|
||||
itemviews/qstyleditemdelegate.cpp
|
||||
@ -40,6 +38,11 @@ qtConfig(columnview) {
|
||||
itemviews/qcolumnviewgrip.cpp
|
||||
}
|
||||
|
||||
qtConfig(dirmodel) {
|
||||
HEADERS += itemviews/qdirmodel.h
|
||||
SOURCES += itemviews/qdirmodel.cpp
|
||||
}
|
||||
|
||||
qtConfig(listview) {
|
||||
HEADERS += \
|
||||
itemviews/qlistview.h \
|
||||
|
@ -39,7 +39,6 @@
|
||||
|
||||
#include "qdirmodel.h"
|
||||
|
||||
#ifndef QT_NO_DIRMODEL
|
||||
#include <qfile.h>
|
||||
#include <qfilesystemmodel.h>
|
||||
#include <qurl.h>
|
||||
@ -1389,5 +1388,3 @@ QFileInfo QDirModelPrivate::resolvedInfo(QFileInfo info)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qdirmodel.cpp"
|
||||
|
||||
#endif // QT_NO_DIRMODEL
|
||||
|
@ -45,11 +45,10 @@
|
||||
#include <QtCore/qdir.h>
|
||||
#include <QtWidgets/qfileiconprovider.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(dirmodel);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_DIRMODEL
|
||||
|
||||
class QDirModelPrivate;
|
||||
|
||||
class Q_WIDGETS_EXPORT QDirModel : public QAbstractItemModel
|
||||
@ -143,8 +142,6 @@ private:
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_refresh())
|
||||
};
|
||||
|
||||
#endif // QT_NO_DIRMODEL
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QDIRMODEL_H
|
||||
|
@ -147,7 +147,9 @@
|
||||
|
||||
#include "QtWidgets/qscrollbar.h"
|
||||
#include "QtCore/qstringlistmodel.h"
|
||||
#if QT_CONFIG(dirmodel)
|
||||
#include "QtWidgets/qdirmodel.h"
|
||||
#endif
|
||||
#if QT_CONFIG(filesystemmodel)
|
||||
#include "QtWidgets/qfilesystemmodel.h"
|
||||
#endif
|
||||
@ -465,7 +467,7 @@ QMatchData QCompletionEngine::filterHistory()
|
||||
if (curParts.count() <= 1 || c->proxy->showAll || !source)
|
||||
return QMatchData();
|
||||
|
||||
#ifndef QT_NO_DIRMODEL
|
||||
#if QT_CONFIG(dirmodel)
|
||||
const bool isDirModel = (qobject_cast<QDirModel *>(source) != 0);
|
||||
#else
|
||||
const bool isDirModel = false;
|
||||
@ -869,7 +871,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted)
|
||||
QModelIndex si = proxy->mapToSource(index);
|
||||
si = si.sibling(si.row(), column); // for clicked()
|
||||
completion = q->pathFromIndex(si);
|
||||
#ifndef QT_NO_DIRMODEL
|
||||
#if QT_CONFIG(dirmodel)
|
||||
// add a trailing separator in inline
|
||||
if (mode == QCompleter::InlineCompletion) {
|
||||
if (qobject_cast<QDirModel *>(proxy->sourceModel()) && QFileInfo(completion).isDir())
|
||||
@ -1057,7 +1059,7 @@ void QCompleter::setModel(QAbstractItemModel *model)
|
||||
setPopup(d->popup); // set the model and make new connections
|
||||
if (oldModel && oldModel->QObject::parent() == this)
|
||||
delete oldModel;
|
||||
#ifndef QT_NO_DIRMODEL
|
||||
#if QT_CONFIG(dirmodel)
|
||||
if (qobject_cast<QDirModel *>(model)) {
|
||||
#if defined(Q_OS_WIN)
|
||||
setCaseSensitivity(Qt::CaseInsensitive);
|
||||
@ -1065,7 +1067,7 @@ void QCompleter::setModel(QAbstractItemModel *model)
|
||||
setCaseSensitivity(Qt::CaseSensitive);
|
||||
#endif
|
||||
}
|
||||
#endif // QT_NO_DIRMODEL
|
||||
#endif // QT_CONFIG(dirmodel)
|
||||
#if QT_CONFIG(filesystemmodel)
|
||||
QFileSystemModel *fsModel = qobject_cast<QFileSystemModel *>(model);
|
||||
if (fsModel) {
|
||||
@ -1771,7 +1773,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const
|
||||
return QString();
|
||||
bool isDirModel = false;
|
||||
bool isFsModel = false;
|
||||
#ifndef QT_NO_DIRMODEL
|
||||
#if QT_CONFIG(dirmodel)
|
||||
isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0;
|
||||
#endif
|
||||
#if QT_CONFIG(filesystemmodel)
|
||||
@ -1820,12 +1822,12 @@ QStringList QCompleter::splitPath(const QString& path) const
|
||||
{
|
||||
bool isDirModel = false;
|
||||
bool isFsModel = false;
|
||||
#ifndef QT_NO_DIRMODEL
|
||||
#if QT_CONFIG(dirmodel)
|
||||
Q_D(const QCompleter);
|
||||
isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0;
|
||||
#endif
|
||||
#if QT_CONFIG(filesystemmodel)
|
||||
#ifdef QT_NO_DIRMODEL
|
||||
#if !QT_CONFIG(dirmodel)
|
||||
Q_D(const QCompleter);
|
||||
#endif
|
||||
isFsModel = qobject_cast<QFileSystemModel *>(d->proxy->sourceModel()) != 0;
|
||||
|
Loading…
Reference in New Issue
Block a user