diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2013-11-06 12:38:47 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-07 18:49:54 +0100 |
commit | c29e825ec6064aa266f0082b3d3b1cb0ceb0809a (patch) | |
tree | 081e9216477e9b02df8010187f726804e91ba2de | |
parent | 9d90a33c7f83a49919133cd8647b0503e18e6444 (diff) |
Fix FolderListModel versioning
Task-number: QTBUG-34448
Change-Id: Idebfdc123a7b908988c9ae86d7db4831ad0e4433
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
-rw-r--r-- | src/imports/folderlistmodel/folderlistmodel.pro | 2 | ||||
-rw-r--r-- | src/imports/folderlistmodel/plugin.cpp | 1 | ||||
-rw-r--r-- | src/imports/folderlistmodel/plugins.qmltypes | 12 | ||||
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.cpp | 17 | ||||
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.h | 6 |
5 files changed, 23 insertions, 15 deletions
diff --git a/src/imports/folderlistmodel/folderlistmodel.pro b/src/imports/folderlistmodel/folderlistmodel.pro index c8c805adb6..99c54113e4 100644 --- a/src/imports/folderlistmodel/folderlistmodel.pro +++ b/src/imports/folderlistmodel/folderlistmodel.pro @@ -1,7 +1,7 @@ CXX_MODULE = qml TARGET = qmlfolderlistmodelplugin TARGETPATH = Qt/labs/folderlistmodel -IMPORT_VERSION = 2.0 +IMPORT_VERSION = 2.1 QT = core-private qml-private diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp index ef0947af76..9e8b65863c 100644 --- a/src/imports/folderlistmodel/plugin.cpp +++ b/src/imports/folderlistmodel/plugin.cpp @@ -59,6 +59,7 @@ public: #ifndef QT_NO_DIRMODEL qmlRegisterType<QQuickFolderListModel>(uri,1,0,"FolderListModel"); qmlRegisterType<QQuickFolderListModel>(uri,2,0,"FolderListModel"); + qmlRegisterType<QQuickFolderListModel,1>(uri,2,1,"FolderListModel"); #endif } }; diff --git a/src/imports/folderlistmodel/plugins.qmltypes b/src/imports/folderlistmodel/plugins.qmltypes index 1d451e9e24..a55d3a3499 100644 --- a/src/imports/folderlistmodel/plugins.qmltypes +++ b/src/imports/folderlistmodel/plugins.qmltypes @@ -3,7 +3,8 @@ import QtQuick.tooling 1.1 // This file describes the plugin-supplied types contained in the library. // It is used for QML tooling purposes only. // -// This file was auto-generated with the command 'qmlplugindump -notrelocatable Qt.labs.folderlistmodel 2.0'. +// This file was auto-generated by: +// 'qmlplugindump -nonrelocatable Qt.labs.folderlistmodel 2.1' Module { Component { @@ -11,9 +12,10 @@ Module { prototype: "QAbstractListModel" exports: [ "Qt.labs.folderlistmodel/FolderListModel 1.0", - "Qt.labs.folderlistmodel/FolderListModel 2.0" + "Qt.labs.folderlistmodel/FolderListModel 2.0", + "Qt.labs.folderlistmodel/FolderListModel 2.1" ] - exportMetaObjectRevisions: [0, 0] + exportMetaObjectRevisions: [0, 0, 1] Enum { name: "SortField" values: { @@ -30,13 +32,15 @@ Module { Property { name: "nameFilters"; type: "QStringList" } Property { name: "sortField"; type: "SortField" } Property { name: "sortReversed"; type: "bool" } + Property { name: "showFiles"; revision: 1; type: "bool" } Property { name: "showDirs"; type: "bool" } Property { name: "showDirsFirst"; type: "bool" } Property { name: "showDotAndDotDot"; type: "bool" } - Property { name: "showHidden"; type: "bool" } + Property { name: "showHidden"; revision: 1; type: "bool" } Property { name: "showOnlyReadable"; type: "bool" } Property { name: "count"; type: "int"; isReadonly: true } Signal { name: "rowCountChanged" } + Signal { name: "countChanged"; revision: 1 } Method { name: "isFolder" type: "bool" diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp index e02de1c208..f425eaa220 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp @@ -217,7 +217,7 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path) } /*! - \qmlmodule Qt.labs.folderlistmodel 1.0 + \qmlmodule Qt.labs.folderlistmodel 2.1 \title Qt Labs FolderListModel QML Types \ingroup qmlmodules \brief The FolderListModel provides a model of the contents of a file system folder. @@ -225,14 +225,14 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path) To use this module, import the module with the following line: \code - import Qt.labs.folderlistmodel 1.0 + import Qt.labs.folderlistmodel 2.1 \endcode */ /*! \qmltype FolderListModel - \inqmlmodule Qt.labs.folderlistmodel 1.0 + \inqmlmodule Qt.labs.folderlistmodel \instantiates QQuickFolderListModel \ingroup qtquick-models \brief The FolderListModel provides a model of the contents of a file system folder. @@ -244,7 +244,7 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path) \e{Elements in the Qt.labs module are not guaranteed to remain compatible in future versions.} - \b{import Qt.labs.folderlistmodel 1.0} + \b{import Qt.labs.folderlistmodel 2.1} The \l folder property specifies the folder to access. Information about the files and directories in the folder is supplied via the model's interface. @@ -253,6 +253,7 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path) \list \li \c fileName \li \c filePath + \li \c fileURL (since Qt 5.2) \li \c fileBaseName \li \c fileSuffix \li \c fileSize @@ -289,7 +290,7 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path) \qml import QtQuick 2.0 - import Qt.labs.folderlistmodel 1.0 + import Qt.labs.folderlistmodel 2.1 ListView { width: 200; height: 400 @@ -627,6 +628,7 @@ bool QQuickFolderListModel::isFolder(int index) const /*! \qmlproperty bool FolderListModel::showFiles + \since 5.2 If true, files are included in the model; otherwise only directories are included. @@ -727,6 +729,7 @@ void QQuickFolderListModel::setShowDotAndDotDot(bool on) /*! \qmlproperty bool FolderListModel::showHidden + \since 5.2 If true, hidden files and directories are included in the model; otherwise they are excluded. @@ -774,7 +777,7 @@ void QQuickFolderListModel::setShowOnlyReadable(bool on) } /*! - \qmlmethod QVariant QQuickFolderListModel::get(int idx, const QString &property) const + \qmlmethod var FolderListModel::get(int index, string property) Get the folder property for the given index. The following properties are available. @@ -782,7 +785,7 @@ void QQuickFolderListModel::setShowOnlyReadable(bool on) \list \li \c fileName \li \c filePath - \li \c fileURL + \li \c fileURL (since Qt 5.2) \li \c fileBaseName \li \c fileSuffix \li \c fileSize diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h index cdf7e0601a..fe60c8d4c1 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.h +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h @@ -69,11 +69,11 @@ class QQuickFolderListModel : public QAbstractListModel, public QQmlParserStatus Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters) Q_PROPERTY(SortField sortField READ sortField WRITE setSortField) Q_PROPERTY(bool sortReversed READ sortReversed WRITE setSortReversed) - Q_PROPERTY(bool showFiles READ showFiles WRITE setShowFiles) + Q_PROPERTY(bool showFiles READ showFiles WRITE setShowFiles REVISION 1) Q_PROPERTY(bool showDirs READ showDirs WRITE setShowDirs) Q_PROPERTY(bool showDirsFirst READ showDirsFirst WRITE setShowDirsFirst) Q_PROPERTY(bool showDotAndDotDot READ showDotAndDotDot WRITE setShowDotAndDotDot) - Q_PROPERTY(bool showHidden READ showHidden WRITE setShowHidden) + Q_PROPERTY(bool showHidden READ showHidden WRITE setShowHidden REVISION 1) Q_PROPERTY(bool showOnlyReadable READ showOnlyReadable WRITE setShowOnlyReadable) Q_PROPERTY(int count READ count NOTIFY countChanged) //![class props] @@ -152,7 +152,7 @@ public: Q_SIGNALS: void folderChanged(); void rowCountChanged() const; - void countChanged() const; + Q_REVISION(1) void countChanged() const; //![notifier] //![class end] |