diff options
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/folderlistmodel/fileinfothread.cpp | 14 | ||||
-rw-r--r-- | src/imports/folderlistmodel/fileinfothread_p.h | 2 | ||||
-rw-r--r-- | src/imports/folderlistmodel/plugin.cpp | 9 | ||||
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.cpp | 27 | ||||
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.h | 3 | ||||
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 11 | ||||
-rw-r--r-- | src/imports/models/plugin.cpp | 8 | ||||
-rw-r--r-- | src/imports/particles/plugin.cpp | 8 | ||||
-rw-r--r-- | src/imports/qtquick2/plugin.cpp | 8 | ||||
-rw-r--r-- | src/imports/settings/plugin.cpp | 8 | ||||
-rw-r--r-- | src/imports/statemachine/plugin.cpp | 8 | ||||
-rw-r--r-- | src/imports/testlib/main.cpp | 8 | ||||
-rw-r--r-- | src/imports/window/plugin.cpp | 9 | ||||
-rw-r--r-- | src/imports/xmllistmodel/plugin.cpp | 8 |
14 files changed, 125 insertions, 6 deletions
diff --git a/src/imports/folderlistmodel/fileinfothread.cpp b/src/imports/folderlistmodel/fileinfothread.cpp index ebdfba42a8..731eb45460 100644 --- a/src/imports/folderlistmodel/fileinfothread.cpp +++ b/src/imports/folderlistmodel/fileinfothread.cpp @@ -52,7 +52,8 @@ FileInfoThread::FileInfoThread(QObject *parent) showDirsFirst(false), showDotAndDotDot(false), showHidden(false), - showOnlyReadable(false) + showOnlyReadable(false), + caseSensitive(true) { #ifndef QT_NO_FILESYSTEMWATCHER watcher = new QFileSystemWatcher(this); @@ -190,6 +191,14 @@ void FileInfoThread::setShowOnlyReadable(bool on) condition.wakeAll(); } +void FileInfoThread::setCaseSensitive(bool on) +{ + QMutexLocker locker(&mutex); + caseSensitive = on; + folderUpdate = true; + condition.wakeAll(); +} + #ifndef QT_NO_FILESYSTEMWATCHER void FileInfoThread::updateFile(const QString &path) { @@ -228,7 +237,8 @@ void FileInfoThread::run() void FileInfoThread::getFileInfos(const QString &path) { QDir::Filters filter; - filter = QDir::CaseSensitive; + if (caseSensitive) + filter = QDir::CaseSensitive; if (showFiles) filter = filter | QDir::Files; if (showDirs) diff --git a/src/imports/folderlistmodel/fileinfothread_p.h b/src/imports/folderlistmodel/fileinfothread_p.h index b375584ff8..5f62f39a20 100644 --- a/src/imports/folderlistmodel/fileinfothread_p.h +++ b/src/imports/folderlistmodel/fileinfothread_p.h @@ -79,6 +79,7 @@ public: void setShowDotAndDotDot(bool on); void setShowHidden(bool on); void setShowOnlyReadable(bool on); + void setCaseSensitive(bool on); public Q_SLOTS: #ifndef QT_NO_FILESYSTEMWATCHER @@ -113,6 +114,7 @@ private: bool showDotAndDotDot; bool showHidden; bool showOnlyReadable; + bool caseSensitive; }; #endif // FILEINFOTHREAD_P_H diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp index a2536bdc7d..33c1167719 100644 --- a/src/imports/folderlistmodel/plugin.cpp +++ b/src/imports/folderlistmodel/plugin.cpp @@ -36,6 +36,13 @@ #include "qquickfolderlistmodel.h" +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_Qt_labs_folderlistmodel); +#endif +} + QT_BEGIN_NAMESPACE //![class decl] @@ -45,6 +52,7 @@ class QmlFolderListModelPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: + QmlFolderListModelPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel")); @@ -52,6 +60,7 @@ public: qmlRegisterType<QQuickFolderListModel>(uri,1,0,"FolderListModel"); qmlRegisterType<QQuickFolderListModel>(uri,2,0,"FolderListModel"); qmlRegisterType<QQuickFolderListModel,1>(uri,2,1,"FolderListModel"); + qmlRegisterType<QQuickFolderListModel,2>(uri,2,2,"FolderListModel"); #endif } }; diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp index 8bfbf09769..839e0f42c7 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp @@ -49,7 +49,7 @@ public: : q_ptr(q), sortField(QQuickFolderListModel::Name), sortReversed(false), showFiles(true), showDirs(true), showDirsFirst(false), showDotAndDotDot(false), showOnlyReadable(false), - showHidden(false) + showHidden(false), caseSensitive(true) { nameFilters << QLatin1String("*"); } @@ -70,6 +70,7 @@ public: bool showDotAndDotDot; bool showOnlyReadable; bool showHidden; + bool caseSensitive; ~QQuickFolderListModelPrivate() {} void init(); @@ -762,6 +763,30 @@ void QQuickFolderListModel::setShowOnlyReadable(bool on) } /*! + * \qmlproperty bool FolderListModel::caseSensitive + * \since 5.7 + * + * Use case sensitive pattern matching. + * + * By default, this property is true. + * + */ +bool QQuickFolderListModel::caseSensitive() const +{ + Q_D(const QQuickFolderListModel); + return d->caseSensitive; +} + +void QQuickFolderListModel::setCaseSensitive(bool on) +{ + Q_D(QQuickFolderListModel); + + if (on != d->caseSensitive) { + d->fileInfoThread.setCaseSensitive(on); + } +} + +/*! \qmlmethod var FolderListModel::get(int index, string property) Get the folder property for the given index. The following properties diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h index fcfec56c87..4b540742b4 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.h +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h @@ -67,6 +67,7 @@ class QQuickFolderListModel : public QAbstractListModel, public QQmlParserStatus Q_PROPERTY(bool showDotAndDotDot READ showDotAndDotDot WRITE setShowDotAndDotDot) Q_PROPERTY(bool showHidden READ showHidden WRITE setShowHidden REVISION 1) Q_PROPERTY(bool showOnlyReadable READ showOnlyReadable WRITE setShowOnlyReadable) + Q_PROPERTY(bool caseSensitive READ caseSensitive WRITE setCaseSensitive REVISION 2) Q_PROPERTY(int count READ count NOTIFY countChanged) //![class props] @@ -128,6 +129,8 @@ public: void setShowHidden(bool on); bool showOnlyReadable() const; void setShowOnlyReadable(bool on); + bool caseSensitive() const; + void setCaseSensitive(bool on); //![prop funcs] Q_INVOKABLE bool isFolder(int index) const; diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index ada50774a7..5b55a2711f 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -54,6 +54,13 @@ #include <private/qv4scopedvalue_p.h> #include <private/qv4objectiterator_p.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQuick_LocalStorage); +#endif +} + QT_BEGIN_NAMESPACE #define V4THROW_SQL(error, desc) { \ @@ -744,10 +751,10 @@ class QQmlLocalStoragePlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: - QQmlLocalStoragePlugin() + QQmlLocalStoragePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { + initResources(); } - void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == "QtQuick.LocalStorage"); diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp index c2b0d2ae94..4ba1ddea14 100644 --- a/src/imports/models/plugin.cpp +++ b/src/imports/models/plugin.cpp @@ -35,6 +35,13 @@ #include <private/qqmlmodelsmodule_p.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQml_Models_2); +#endif +} + QT_BEGIN_NAMESPACE /*! @@ -64,6 +71,7 @@ class QtQmlModelsPlugin : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") public: + QtQmlModelsPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml.Models")); diff --git a/src/imports/particles/plugin.cpp b/src/imports/particles/plugin.cpp index 56b611a408..609efd0bad 100644 --- a/src/imports/particles/plugin.cpp +++ b/src/imports/particles/plugin.cpp @@ -35,6 +35,13 @@ #include <private/qquickparticlesmodule_p.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQuick_Particles_2); +#endif +} + QT_BEGIN_NAMESPACE //![class decl] @@ -43,6 +50,7 @@ class QtQuick2ParticlesPlugin : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") public: + QtQuick2ParticlesPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Particles")); diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp index 36a57112b2..4cb77dcd4b 100644 --- a/src/imports/qtquick2/plugin.cpp +++ b/src/imports/qtquick2/plugin.cpp @@ -35,6 +35,13 @@ #include <private/qtquick2_p.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQuick_2); +#endif +} + QT_BEGIN_NAMESPACE //![class decl] @@ -43,6 +50,7 @@ class QtQuick2Plugin : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") public: + QtQuick2Plugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick")); diff --git a/src/imports/settings/plugin.cpp b/src/imports/settings/plugin.cpp index c32d370537..49ee8ab9bf 100644 --- a/src/imports/settings/plugin.cpp +++ b/src/imports/settings/plugin.cpp @@ -36,6 +36,13 @@ #include "qqmlsettings_p.h" +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_Qt_labs_settings); +#endif +} + QT_BEGIN_NAMESPACE class QmlSettingsPlugin : public QQmlExtensionPlugin @@ -44,6 +51,7 @@ class QmlSettingsPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: + QmlSettingsPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QByteArray(uri) == QByteArray("Qt.labs.settings")); diff --git a/src/imports/statemachine/plugin.cpp b/src/imports/statemachine/plugin.cpp index 4a711a3278..e0fea01d8f 100644 --- a/src/imports/statemachine/plugin.cpp +++ b/src/imports/statemachine/plugin.cpp @@ -41,6 +41,13 @@ #include <QQmlExtensionPlugin> #include <qqml.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQml_StateMachine); +#endif +} + QT_BEGIN_NAMESPACE class QtQmlStateMachinePlugin : public QQmlExtensionPlugin @@ -49,6 +56,7 @@ class QtQmlStateMachinePlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtQml.StateMachine/1.0") public: + QtQmlStateMachinePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } void registerTypes(const char *uri) { qmlRegisterType<State>(uri, 1, 0, "State"); diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index c42ece5da5..b2ea10fa38 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -48,6 +48,13 @@ QML_DECLARE_TYPE(QuickTestEvent) #include <QtDebug> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtTest); +#endif +} + QT_BEGIN_NAMESPACE class QuickTestUtil : public QObject @@ -137,6 +144,7 @@ class QTestQmlModule : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: + QTestQmlModule(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtTest")); diff --git a/src/imports/window/plugin.cpp b/src/imports/window/plugin.cpp index 010e9b3eed..2946cae679 100644 --- a/src/imports/window/plugin.cpp +++ b/src/imports/window/plugin.cpp @@ -35,6 +35,13 @@ #include <private/qquickwindowmodule_p.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQuick_Window_2); +#endif +} + QT_BEGIN_NAMESPACE /*! @@ -53,13 +60,13 @@ QT_BEGIN_NAMESPACE */ - //![class decl] class QtQuick2WindowPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") public: + QtQuick2WindowPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Window")); diff --git a/src/imports/xmllistmodel/plugin.cpp b/src/imports/xmllistmodel/plugin.cpp index 8a9d4379c4..514a44fe14 100644 --- a/src/imports/xmllistmodel/plugin.cpp +++ b/src/imports/xmllistmodel/plugin.cpp @@ -36,6 +36,13 @@ #include "qqmlxmllistmodel_p.h" +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQuick_XmlListModel); +#endif +} + QT_BEGIN_NAMESPACE class QmlXmlListModelPlugin : public QQmlExtensionPlugin @@ -44,6 +51,7 @@ class QmlXmlListModelPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: + QmlXmlListModelPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.XmlListModel")); |