From 2bb4da9a2cfe38eff7670f633c8caceaba394df6 Mon Sep 17 00:00:00 2001 From: Maximilian Goldstein Date: Tue, 26 Jan 2021 12:45:38 +0100 Subject: 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 --- src/imports/folderlistmodel/plugin.cpp | 14 +------------- src/labs/folderlistmodel/qquickfolderlistmodel_p.h | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'src') 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(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); -- cgit v1.2.3