diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-01-26 12:45:38 +0100 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2021-02-04 09:38:45 +0100 |
commit | 2bb4da9a2cfe38eff7670f633c8caceaba394df6 (patch) | |
tree | 618b7f959a22d182fbced063ea1c418faf1cb3bf | |
parent | 5164b36501cd039a2ddd1e3a5ebaf90f315e0382 (diff) |
Qt.labs.folderlistmodel: Register old versions declaratively
Register old versions declaratively so the plugin can be truly optional.
Change-Id: I0f5774d90788208dfce7928a45a904fc6595faa1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | src/imports/folderlistmodel/plugin.cpp | 14 | ||||
-rw-r--r-- | src/labs/folderlistmodel/qquickfolderlistmodel_p.h | 2 |
2 files changed, 2 insertions, 14 deletions
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp index 28969a3d35..d50002b4c4 100644 --- a/src/imports/folderlistmodel/plugin.cpp +++ b/src/imports/folderlistmodel/plugin.cpp @@ -59,21 +59,9 @@ public: Q_UNUSED(registration); } - void registerTypes(const char *uri) override + void registerTypes(const char *) override { - Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel")); - - // Major version 1 only has a single revision, 0. - folderListModelId = qmlRegisterType<QQuickFolderListModel>(uri, 1, 0, "FolderListModel"); - } - - void unregisterTypes() override { - QQmlMetaType::unregisterType(folderListModelId); - folderListModelId = -1; } - -private: - int folderListModelId = -1; }; //![class decl] diff --git a/src/labs/folderlistmodel/qquickfolderlistmodel_p.h b/src/labs/folderlistmodel/qquickfolderlistmodel_p.h index b5e979be03..6d7fa8c82d 100644 --- a/src/labs/folderlistmodel/qquickfolderlistmodel_p.h +++ b/src/labs/folderlistmodel/qquickfolderlistmodel_p.h @@ -93,7 +93,7 @@ class Q_LABSFOLDERMODEL_PRIVATE_EXPORT QQuickFolderListModel : public QAbstractL //![class props] QML_NAMED_ELEMENT(FolderListModel) - QML_ADDED_IN_VERSION(2, 0) + QML_ADDED_IN_VERSION(1, 0) //![abslistmodel] public: QQuickFolderListModel(QObject *parent = nullptr); |