From af6dcb66593df384e0d9a319eb5d922b28612b7d Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Mon, 29 Apr 2024 15:29:46 +0300 Subject: [PATCH] QmlDesigner: Remove "Internal" namespace from the bundle importer Change-Id: If082d7fe724b6db2aaad8c1a6bf56f68bbbb3baf Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Miikka Heikkinen --- .../contentlibrary/contentlibrarybundleimporter.cpp | 4 ++-- .../contentlibrary/contentlibrarybundleimporter.h | 4 ++-- .../contentlibrary/contentlibraryeffectsmodel.cpp | 10 +++++----- .../contentlibrary/contentlibraryeffectsmodel.h | 9 +++------ .../contentlibrary/contentlibrarymaterialsmodel.cpp | 10 +++++----- .../contentlibrary/contentlibrarymaterialsmodel.h | 9 +++------ .../contentlibrary/contentlibraryusermodel.cpp | 10 +++++----- .../contentlibrary/contentlibraryusermodel.h | 9 +++------ 8 files changed, 28 insertions(+), 37 deletions(-) diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarybundleimporter.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarybundleimporter.cpp index 85d42f9d128..d4859305538 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarybundleimporter.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarybundleimporter.cpp @@ -18,7 +18,7 @@ using namespace Utils; -namespace QmlDesigner::Internal { +namespace QmlDesigner { ContentLibraryBundleImporter::ContentLibraryBundleImporter(QObject *parent) : QObject(parent) @@ -336,4 +336,4 @@ FilePath ContentLibraryBundleImporter::resolveBundleImportPath(const QString &bu return bundleImportPath.resolvePath(bundleId); } -} // namespace QmlDesigner::Internal +} // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarybundleimporter.h b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarybundleimporter.h index 3a7c22a52e1..10786ead995 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarybundleimporter.h +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarybundleimporter.h @@ -10,7 +10,7 @@ #include #include -namespace QmlDesigner::Internal { +namespace QmlDesigner { class ContentLibraryBundleImporter : public QObject { @@ -48,4 +48,4 @@ private: QHash m_pendingTypes; // }; -} // namespace QmlDesigner::Internal +} // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryeffectsmodel.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryeffectsmodel.cpp index f6c3f855baa..fb7fde1014c 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryeffectsmodel.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryeffectsmodel.cpp @@ -90,10 +90,10 @@ QHash ContentLibraryEffectsModel::roleNames() const void ContentLibraryEffectsModel::createImporter() { - m_importer = new Internal::ContentLibraryBundleImporter(); + m_importer = new ContentLibraryBundleImporter(); #ifdef QDS_USE_PROJECTSTORAGE connect(m_importer, - &Internal::ContentLibraryBundleImporter::importFinished, + &ContentLibraryBundleImporter::importFinished, this, [&](const QmlDesigner::TypeName &typeName) { m_importerRunning = false; @@ -103,7 +103,7 @@ void ContentLibraryEffectsModel::createImporter() }); #else connect(m_importer, - &Internal::ContentLibraryBundleImporter::importFinished, + &ContentLibraryBundleImporter::importFinished, this, [&](const QmlDesigner::NodeMetaInfo &metaInfo) { m_importerRunning = false; @@ -113,7 +113,7 @@ void ContentLibraryEffectsModel::createImporter() }); #endif - connect(m_importer, &Internal::ContentLibraryBundleImporter::unimportFinished, this, + connect(m_importer, &ContentLibraryBundleImporter::unimportFinished, this, [&](const QmlDesigner::NodeMetaInfo &metaInfo) { Q_UNUSED(metaInfo) m_importerRunning = false; @@ -220,7 +220,7 @@ bool ContentLibraryEffectsModel::bundleExists() const return m_bundleExists; } -Internal::ContentLibraryBundleImporter *ContentLibraryEffectsModel::bundleImporter() const +ContentLibraryBundleImporter *ContentLibraryEffectsModel::bundleImporter() const { return m_importer; } diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryeffectsmodel.h b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryeffectsmodel.h index 5ac40bbef4b..f63e080b159 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryeffectsmodel.h +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryeffectsmodel.h @@ -11,14 +11,11 @@ namespace QmlDesigner { +class ContentLibraryBundleImporter; class ContentLibraryEffect; class ContentLibraryEffectsCategory; class ContentLibraryWidget; -namespace Internal { -class ContentLibraryBundleImporter; -} - class ContentLibraryEffectsModel : public QAbstractListModel { Q_OBJECT @@ -49,7 +46,7 @@ public: void resetModel(); void updateIsEmpty(); - Internal::ContentLibraryBundleImporter *bundleImporter() const; + ContentLibraryBundleImporter *bundleImporter() const; Q_INVOKABLE void addInstance(QmlDesigner::ContentLibraryEffect *bundleItem); Q_INVOKABLE void removeFromProject(QmlDesigner::ContentLibraryEffect *bundleItem); @@ -77,7 +74,7 @@ private: QStringList m_importerSharedFiles; QList m_bundleCategories; QJsonObject m_bundleObj; - Internal::ContentLibraryBundleImporter *m_importer = nullptr; + ContentLibraryBundleImporter *m_importer = nullptr; bool m_isEmpty = true; bool m_bundleExists = false; diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp index b60ac841d58..1b5f0398982 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp @@ -209,10 +209,10 @@ void ContentLibraryMaterialsModel::downloadSharedFiles(const QDir &targetDir, co void ContentLibraryMaterialsModel::createImporter() { - m_importer = new Internal::ContentLibraryBundleImporter(); + m_importer = new ContentLibraryBundleImporter(); #ifdef QDS_USE_PROJECTSTORAGE connect(m_importer, - &Internal::ContentLibraryBundleImporter::importFinished, + &ContentLibraryBundleImporter::importFinished, this, [&](const QmlDesigner::TypeName &typeName) { m_importerRunning = false; @@ -222,7 +222,7 @@ void ContentLibraryMaterialsModel::createImporter() }); #else connect(m_importer, - &Internal::ContentLibraryBundleImporter::importFinished, + &ContentLibraryBundleImporter::importFinished, this, [&](const QmlDesigner::NodeMetaInfo &metaInfo) { m_importerRunning = false; @@ -232,7 +232,7 @@ void ContentLibraryMaterialsModel::createImporter() }); #endif - connect(m_importer, &Internal::ContentLibraryBundleImporter::unimportFinished, this, + connect(m_importer, &ContentLibraryBundleImporter::unimportFinished, this, [&](const QmlDesigner::NodeMetaInfo &metaInfo) { Q_UNUSED(metaInfo) m_importerRunning = false; @@ -331,7 +331,7 @@ bool ContentLibraryMaterialsModel::matBundleExists() const return m_matBundleExists; } -Internal::ContentLibraryBundleImporter *ContentLibraryMaterialsModel::bundleImporter() const +ContentLibraryBundleImporter *ContentLibraryMaterialsModel::bundleImporter() const { return m_importer; } diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.h b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.h index c37ffd39fbf..6b0705e86d9 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.h +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.h @@ -11,14 +11,11 @@ namespace QmlDesigner { +class ContentLibraryBundleImporter; class ContentLibraryMaterial; class ContentLibraryMaterialsCategory; class ContentLibraryWidget; -namespace Internal { -class ContentLibraryBundleImporter; -} - class ContentLibraryMaterialsModel : public QAbstractListModel { Q_OBJECT @@ -53,7 +50,7 @@ public: void updateIsEmpty(); void loadBundle(); - Internal::ContentLibraryBundleImporter *bundleImporter() const; + ContentLibraryBundleImporter *bundleImporter() const; Q_INVOKABLE void applyToSelected(QmlDesigner::ContentLibraryMaterial *mat, bool add = false); Q_INVOKABLE void addToProject(QmlDesigner::ContentLibraryMaterial *mat); @@ -87,7 +84,7 @@ private: QString m_searchText; QList m_bundleCategories; QJsonObject m_matBundleObj; - Internal::ContentLibraryBundleImporter *m_importer = nullptr; + ContentLibraryBundleImporter *m_importer = nullptr; bool m_isEmpty = true; bool m_matBundleExists = false; diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryusermodel.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryusermodel.cpp index 9b53ae4f064..6a511f42bd0 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryusermodel.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryusermodel.cpp @@ -225,10 +225,10 @@ QHash ContentLibraryUserModel::roleNames() const void ContentLibraryUserModel::createImporter() { - m_importer = new Internal::ContentLibraryBundleImporter(); + m_importer = new ContentLibraryBundleImporter(); #ifdef QDS_USE_PROJECTSTORAGE connect(m_importer, - &Internal::ContentLibraryBundleImporter::importFinished, + &ContentLibraryBundleImporter::importFinished, this, [&](const QmlDesigner::TypeName &typeName) { m_importerRunning = false; @@ -238,7 +238,7 @@ void ContentLibraryUserModel::createImporter() }); #else connect(m_importer, - &Internal::ContentLibraryBundleImporter::importFinished, + &ContentLibraryBundleImporter::importFinished, this, [&](const QmlDesigner::NodeMetaInfo &metaInfo) { m_importerRunning = false; @@ -248,7 +248,7 @@ void ContentLibraryUserModel::createImporter() }); #endif - connect(m_importer, &Internal::ContentLibraryBundleImporter::unimportFinished, this, + connect(m_importer, &ContentLibraryBundleImporter::unimportFinished, this, [&](const QmlDesigner::NodeMetaInfo &metaInfo) { Q_UNUSED(metaInfo) m_importerRunning = false; @@ -370,7 +370,7 @@ bool ContentLibraryUserModel::matBundleExists() const return m_matBundleExists; } -Internal::ContentLibraryBundleImporter *ContentLibraryUserModel::bundleImporter() const +ContentLibraryBundleImporter *ContentLibraryUserModel::bundleImporter() const { return m_importer; } diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryusermodel.h b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryusermodel.h index 6ac2160e9b8..35c2de662be 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibraryusermodel.h +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibraryusermodel.h @@ -12,16 +12,13 @@ QT_FORWARD_DECLARE_CLASS(QUrl) namespace QmlDesigner { +class ContentLibraryBundleImporter; class ContentLibraryEffect; class ContentLibraryMaterial; class ContentLibraryTexture; class ContentLibraryWidget; class NodeMetaInfo; -namespace Internal { -class ContentLibraryBundleImporter; -} - class ContentLibraryUserModel : public QAbstractListModel { Q_OBJECT @@ -70,7 +67,7 @@ public: void loadMaterialBundle(); void loadTextureBundle(); - Internal::ContentLibraryBundleImporter *bundleImporter() const; + ContentLibraryBundleImporter *bundleImporter() const; Q_INVOKABLE void applyToSelected(QmlDesigner::ContentLibraryMaterial *mat, bool add = false); Q_INVOKABLE void addToProject(QmlDesigner::ContentLibraryMaterial *mat); @@ -114,7 +111,7 @@ private: QStringList m_userCategories; QJsonObject m_bundleObj; - Internal::ContentLibraryBundleImporter *m_importer = nullptr; + ContentLibraryBundleImporter *m_importer = nullptr; bool m_isEmpty = true; bool m_matBundleExists = false;