diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-05-31 23:08:35 +0200 |
---|---|---|
committer | Stephan Binner <stephan.binner@basyskom.com> | 2017-07-02 10:39:04 +0000 |
commit | 2fb9705521bc2879dc89b54c1488d6a20a310d85 (patch) | |
tree | f35e5ebfac50864071a496a204fbef1ba95485c6 /src/widgets | |
parent | 341554e34393199d8f6ba401df1fab0bfbb10188 (diff) |
Convert features.filesystemmodel to QT_[REQUIRE_]CONFIG
Change-Id: I862510387e79d04221ec075f3e79896908ee9d8f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/dialogs/dialogs.pri | 20 | ||||
-rw-r--r-- | src/widgets/dialogs/qfileinfogatherer.cpp | 4 | ||||
-rw-r--r-- | src/widgets/dialogs/qfileinfogatherer_p.h | 7 | ||||
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.cpp | 4 | ||||
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.h | 8 | ||||
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel_p.h | 6 | ||||
-rw-r--r-- | src/widgets/util/qcompleter.cpp | 18 |
7 files changed, 29 insertions, 38 deletions
diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index f072576acc..c2625ec1f4 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -2,16 +2,11 @@ HEADERS += \ dialogs/qfontdialog.h \ - dialogs/qfontdialog_p.h \ - dialogs/qfilesystemmodel.h \ - dialogs/qfilesystemmodel_p.h \ - dialogs/qfileinfogatherer_p.h + dialogs/qfontdialog_p.h INCLUDEPATH += $$PWD SOURCES += \ - dialogs/qfontdialog.cpp \ - dialogs/qfilesystemmodel.cpp \ - dialogs/qfileinfogatherer.cpp + dialogs/qfontdialog.cpp qtConfig(colordialog) { HEADERS += dialogs/qcolordialog.h @@ -45,6 +40,17 @@ qtConfig(filedialog) { FORMS += dialogs/qfiledialog.ui } +qtConfig(filesystemmodel) { + HEADERS += \ + dialogs/qfilesystemmodel.h \ + dialogs/qfilesystemmodel_p.h \ + dialogs/qfileinfogatherer_p.h + + SOURCES += \ + dialogs/qfilesystemmodel.cpp \ + dialogs/qfileinfogatherer.cpp +} + qtConfig(fscompleter) { HEADERS += dialogs/qfscompleter_p.h } diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index 08c5a40c7c..9f2d15d31b 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -50,8 +50,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_FILESYSTEMMODEL - #ifdef QT_BUILD_INTERNAL static QBasicAtomicInt fetchedRoot = Q_BASIC_ATOMIC_INITIALIZER(false); Q_AUTOTEST_EXPORT void qt_test_resetFetchedRoot() @@ -366,8 +364,6 @@ void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bo } } -#endif // QT_NO_FILESYSTEMMODEL - QT_END_NAMESPACE #include "moc_qfileinfogatherer_p.cpp" diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h index 0018b6c387..52578126de 100644 --- a/src/widgets/dialogs/qfileinfogatherer_p.h +++ b/src/widgets/dialogs/qfileinfogatherer_p.h @@ -66,6 +66,8 @@ #include <private/qfilesystemengine_p.h> +QT_REQUIRE_CONFIG(filesystemmodel); + QT_BEGIN_NAMESPACE class QExtendedInformation { @@ -150,8 +152,6 @@ private : class QFileIconProvider; -#ifndef QT_NO_FILESYSTEMMODEL - class Q_AUTOTEST_EXPORT QFileInfoGatherer : public QThread { Q_OBJECT @@ -208,9 +208,6 @@ private: QFileIconProvider *m_iconProvider; // not accessed by run() QFileIconProvider defaultProvider; }; -#endif // QT_NO_FILESYSTEMMODEL - QT_END_NAMESPACE #endif // QFILEINFOGATHERER_H - diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 0ada9c6c58..63b5cf7aaf 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -58,8 +58,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_FILESYSTEMMODEL - /*! \enum QFileSystemModel::Roles \value FileIconRole @@ -1995,5 +1993,3 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const QT_END_NAMESPACE #include "moc_qfilesystemmodel.cpp" - -#endif // QT_NO_FILESYSTEMMODEL diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h index 7d790124c8..a5f23c9220 100644 --- a/src/widgets/dialogs/qfilesystemmodel.h +++ b/src/widgets/dialogs/qfilesystemmodel.h @@ -47,10 +47,9 @@ #include <QtGui/qicon.h> #include <QtCore/qdiriterator.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(filesystemmodel); -#ifndef QT_NO_FILESYSTEMMODEL +QT_BEGIN_NAMESPACE class ExtendedInformation; class QFileSystemModelPrivate; @@ -166,9 +165,6 @@ inline QString QFileSystemModel::fileName(const QModelIndex &aindex) const inline QIcon QFileSystemModel::fileIcon(const QModelIndex &aindex) const { return qvariant_cast<QIcon>(aindex.data(Qt::DecorationRole)); } -#endif // QT_NO_FILESYSTEMMODEL - QT_END_NAMESPACE #endif // QFILESYSTEMMODEL_H - diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h index e7149a3097..640225529b 100644 --- a/src/widgets/dialogs/qfilesystemmodel_p.h +++ b/src/widgets/dialogs/qfilesystemmodel_p.h @@ -54,8 +54,6 @@ #include <QtWidgets/private/qtwidgetsglobal_p.h> #include "qfilesystemmodel.h" -#ifndef QT_NO_FILESYSTEMMODEL - #include <private/qabstractitemmodel_p.h> #include <qabstractitemmodel.h> #include "qfileinfogatherer_p.h" @@ -66,6 +64,8 @@ #include <qtimer.h> #include <qhash.h> +QT_REQUIRE_CONFIG(filesystemmodel); + QT_BEGIN_NAMESPACE class ExtendedInformation; @@ -313,9 +313,7 @@ public: }; Q_DECLARE_TYPEINFO(QFileSystemModelPrivate::Fetching, Q_MOVABLE_TYPE); -#endif // QT_NO_FILESYSTEMMODEL QT_END_NAMESPACE #endif - diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 5a31eb4e52..c412c4cbd5 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -148,7 +148,9 @@ #include "QtWidgets/qscrollbar.h" #include "QtCore/qstringlistmodel.h" #include "QtWidgets/qdirmodel.h" +#if QT_CONFIG(filesystemmodel) #include "QtWidgets/qfilesystemmodel.h" +#endif #include "QtWidgets/qheaderview.h" #include "QtWidgets/qlistview.h" #include "QtWidgets/qapplication.h" @@ -467,7 +469,7 @@ QMatchData QCompletionEngine::filterHistory() const bool isDirModel = false; #endif Q_UNUSED(isDirModel) -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) const bool isFsModel = (qobject_cast<QFileSystemModel *>(source) != 0); #else const bool isFsModel = false; @@ -872,7 +874,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) completion += QDir::separator(); } #endif -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) // add a trailing separator in inline if (mode == QCompleter::InlineCompletion) { if (qobject_cast<QFileSystemModel *>(proxy->sourceModel()) && QFileInfo(completion).isDir()) @@ -1044,7 +1046,7 @@ void QCompleter::setModel(QAbstractItemModel *model) { Q_D(QCompleter); QAbstractItemModel *oldModel = d->proxy->sourceModel(); -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) if (qobject_cast<const QFileSystemModel *>(oldModel)) setCompletionRole(Qt::EditRole); // QTBUG-54642, clear FileNameRole set by QFileSystemModel #endif @@ -1062,7 +1064,7 @@ void QCompleter::setModel(QAbstractItemModel *model) #endif } #endif // QT_NO_DIRMODEL -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) QFileSystemModel *fsModel = qobject_cast<QFileSystemModel *>(model); if (fsModel) { #if defined(Q_OS_WIN) @@ -1073,7 +1075,7 @@ void QCompleter::setModel(QAbstractItemModel *model) setCompletionRole(QFileSystemModel::FileNameRole); connect(fsModel, SIGNAL(directoryLoaded(QString)), this, SLOT(_q_fileSystemModelDirectoryLoaded(QString))); } -#endif // QT_NO_FILESYSTEMMODEL +#endif // QT_CONFIG(filesystemmodel) } /*! @@ -1770,7 +1772,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const #ifndef QT_NO_DIRMODEL isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0; #endif -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) isFsModel = qobject_cast<QFileSystemModel *>(d->proxy->sourceModel()) != 0; #endif if (!isDirModel && !isFsModel) @@ -1782,7 +1784,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const QString t; if (isDirModel) t = sourceModel->data(idx, Qt::EditRole).toString(); -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) else t = sourceModel->data(idx, QFileSystemModel::FileNameRole).toString(); #endif @@ -1820,7 +1822,7 @@ QStringList QCompleter::splitPath(const QString& path) const Q_D(const QCompleter); isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0; #endif -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) #ifdef QT_NO_DIRMODEL Q_D(const QCompleter); #endif |