forked from qt-creator/qt-creator
QmlDesigner: Remove "Internal" namespace from the bundle importer
Change-Id: If082d7fe724b6db2aaad8c1a6bf56f68bbbb3baf Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace QmlDesigner::Internal {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
ContentLibraryBundleImporter::ContentLibraryBundleImporter(QObject *parent)
|
ContentLibraryBundleImporter::ContentLibraryBundleImporter(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
@@ -336,4 +336,4 @@ FilePath ContentLibraryBundleImporter::resolveBundleImportPath(const QString &bu
|
|||||||
return bundleImportPath.resolvePath(bundleId);
|
return bundleImportPath.resolvePath(bundleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace QmlDesigner::Internal
|
} // namespace QmlDesigner
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QVariantHash>
|
#include <QVariantHash>
|
||||||
|
|
||||||
namespace QmlDesigner::Internal {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
class ContentLibraryBundleImporter : public QObject
|
class ContentLibraryBundleImporter : public QObject
|
||||||
{
|
{
|
||||||
@@ -48,4 +48,4 @@ private:
|
|||||||
QHash<TypeName, bool> m_pendingTypes; // <type, isImport>
|
QHash<TypeName, bool> m_pendingTypes; // <type, isImport>
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDesigner::Internal
|
} // namespace QmlDesigner
|
||||||
|
@@ -90,10 +90,10 @@ QHash<int, QByteArray> ContentLibraryEffectsModel::roleNames() const
|
|||||||
|
|
||||||
void ContentLibraryEffectsModel::createImporter()
|
void ContentLibraryEffectsModel::createImporter()
|
||||||
{
|
{
|
||||||
m_importer = new Internal::ContentLibraryBundleImporter();
|
m_importer = new ContentLibraryBundleImporter();
|
||||||
#ifdef QDS_USE_PROJECTSTORAGE
|
#ifdef QDS_USE_PROJECTSTORAGE
|
||||||
connect(m_importer,
|
connect(m_importer,
|
||||||
&Internal::ContentLibraryBundleImporter::importFinished,
|
&ContentLibraryBundleImporter::importFinished,
|
||||||
this,
|
this,
|
||||||
[&](const QmlDesigner::TypeName &typeName) {
|
[&](const QmlDesigner::TypeName &typeName) {
|
||||||
m_importerRunning = false;
|
m_importerRunning = false;
|
||||||
@@ -103,7 +103,7 @@ void ContentLibraryEffectsModel::createImporter()
|
|||||||
});
|
});
|
||||||
#else
|
#else
|
||||||
connect(m_importer,
|
connect(m_importer,
|
||||||
&Internal::ContentLibraryBundleImporter::importFinished,
|
&ContentLibraryBundleImporter::importFinished,
|
||||||
this,
|
this,
|
||||||
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
||||||
m_importerRunning = false;
|
m_importerRunning = false;
|
||||||
@@ -113,7 +113,7 @@ void ContentLibraryEffectsModel::createImporter()
|
|||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect(m_importer, &Internal::ContentLibraryBundleImporter::unimportFinished, this,
|
connect(m_importer, &ContentLibraryBundleImporter::unimportFinished, this,
|
||||||
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
||||||
Q_UNUSED(metaInfo)
|
Q_UNUSED(metaInfo)
|
||||||
m_importerRunning = false;
|
m_importerRunning = false;
|
||||||
@@ -220,7 +220,7 @@ bool ContentLibraryEffectsModel::bundleExists() const
|
|||||||
return m_bundleExists;
|
return m_bundleExists;
|
||||||
}
|
}
|
||||||
|
|
||||||
Internal::ContentLibraryBundleImporter *ContentLibraryEffectsModel::bundleImporter() const
|
ContentLibraryBundleImporter *ContentLibraryEffectsModel::bundleImporter() const
|
||||||
{
|
{
|
||||||
return m_importer;
|
return m_importer;
|
||||||
}
|
}
|
||||||
|
@@ -11,14 +11,11 @@
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class ContentLibraryBundleImporter;
|
||||||
class ContentLibraryEffect;
|
class ContentLibraryEffect;
|
||||||
class ContentLibraryEffectsCategory;
|
class ContentLibraryEffectsCategory;
|
||||||
class ContentLibraryWidget;
|
class ContentLibraryWidget;
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
class ContentLibraryBundleImporter;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ContentLibraryEffectsModel : public QAbstractListModel
|
class ContentLibraryEffectsModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -49,7 +46,7 @@ public:
|
|||||||
void resetModel();
|
void resetModel();
|
||||||
void updateIsEmpty();
|
void updateIsEmpty();
|
||||||
|
|
||||||
Internal::ContentLibraryBundleImporter *bundleImporter() const;
|
ContentLibraryBundleImporter *bundleImporter() const;
|
||||||
|
|
||||||
Q_INVOKABLE void addInstance(QmlDesigner::ContentLibraryEffect *bundleItem);
|
Q_INVOKABLE void addInstance(QmlDesigner::ContentLibraryEffect *bundleItem);
|
||||||
Q_INVOKABLE void removeFromProject(QmlDesigner::ContentLibraryEffect *bundleItem);
|
Q_INVOKABLE void removeFromProject(QmlDesigner::ContentLibraryEffect *bundleItem);
|
||||||
@@ -77,7 +74,7 @@ private:
|
|||||||
QStringList m_importerSharedFiles;
|
QStringList m_importerSharedFiles;
|
||||||
QList<ContentLibraryEffectsCategory *> m_bundleCategories;
|
QList<ContentLibraryEffectsCategory *> m_bundleCategories;
|
||||||
QJsonObject m_bundleObj;
|
QJsonObject m_bundleObj;
|
||||||
Internal::ContentLibraryBundleImporter *m_importer = nullptr;
|
ContentLibraryBundleImporter *m_importer = nullptr;
|
||||||
|
|
||||||
bool m_isEmpty = true;
|
bool m_isEmpty = true;
|
||||||
bool m_bundleExists = false;
|
bool m_bundleExists = false;
|
||||||
|
@@ -209,10 +209,10 @@ void ContentLibraryMaterialsModel::downloadSharedFiles(const QDir &targetDir, co
|
|||||||
|
|
||||||
void ContentLibraryMaterialsModel::createImporter()
|
void ContentLibraryMaterialsModel::createImporter()
|
||||||
{
|
{
|
||||||
m_importer = new Internal::ContentLibraryBundleImporter();
|
m_importer = new ContentLibraryBundleImporter();
|
||||||
#ifdef QDS_USE_PROJECTSTORAGE
|
#ifdef QDS_USE_PROJECTSTORAGE
|
||||||
connect(m_importer,
|
connect(m_importer,
|
||||||
&Internal::ContentLibraryBundleImporter::importFinished,
|
&ContentLibraryBundleImporter::importFinished,
|
||||||
this,
|
this,
|
||||||
[&](const QmlDesigner::TypeName &typeName) {
|
[&](const QmlDesigner::TypeName &typeName) {
|
||||||
m_importerRunning = false;
|
m_importerRunning = false;
|
||||||
@@ -222,7 +222,7 @@ void ContentLibraryMaterialsModel::createImporter()
|
|||||||
});
|
});
|
||||||
#else
|
#else
|
||||||
connect(m_importer,
|
connect(m_importer,
|
||||||
&Internal::ContentLibraryBundleImporter::importFinished,
|
&ContentLibraryBundleImporter::importFinished,
|
||||||
this,
|
this,
|
||||||
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
||||||
m_importerRunning = false;
|
m_importerRunning = false;
|
||||||
@@ -232,7 +232,7 @@ void ContentLibraryMaterialsModel::createImporter()
|
|||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect(m_importer, &Internal::ContentLibraryBundleImporter::unimportFinished, this,
|
connect(m_importer, &ContentLibraryBundleImporter::unimportFinished, this,
|
||||||
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
||||||
Q_UNUSED(metaInfo)
|
Q_UNUSED(metaInfo)
|
||||||
m_importerRunning = false;
|
m_importerRunning = false;
|
||||||
@@ -331,7 +331,7 @@ bool ContentLibraryMaterialsModel::matBundleExists() const
|
|||||||
return m_matBundleExists;
|
return m_matBundleExists;
|
||||||
}
|
}
|
||||||
|
|
||||||
Internal::ContentLibraryBundleImporter *ContentLibraryMaterialsModel::bundleImporter() const
|
ContentLibraryBundleImporter *ContentLibraryMaterialsModel::bundleImporter() const
|
||||||
{
|
{
|
||||||
return m_importer;
|
return m_importer;
|
||||||
}
|
}
|
||||||
|
@@ -11,14 +11,11 @@
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class ContentLibraryBundleImporter;
|
||||||
class ContentLibraryMaterial;
|
class ContentLibraryMaterial;
|
||||||
class ContentLibraryMaterialsCategory;
|
class ContentLibraryMaterialsCategory;
|
||||||
class ContentLibraryWidget;
|
class ContentLibraryWidget;
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
class ContentLibraryBundleImporter;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ContentLibraryMaterialsModel : public QAbstractListModel
|
class ContentLibraryMaterialsModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -53,7 +50,7 @@ public:
|
|||||||
void updateIsEmpty();
|
void updateIsEmpty();
|
||||||
void loadBundle();
|
void loadBundle();
|
||||||
|
|
||||||
Internal::ContentLibraryBundleImporter *bundleImporter() const;
|
ContentLibraryBundleImporter *bundleImporter() const;
|
||||||
|
|
||||||
Q_INVOKABLE void applyToSelected(QmlDesigner::ContentLibraryMaterial *mat, bool add = false);
|
Q_INVOKABLE void applyToSelected(QmlDesigner::ContentLibraryMaterial *mat, bool add = false);
|
||||||
Q_INVOKABLE void addToProject(QmlDesigner::ContentLibraryMaterial *mat);
|
Q_INVOKABLE void addToProject(QmlDesigner::ContentLibraryMaterial *mat);
|
||||||
@@ -87,7 +84,7 @@ private:
|
|||||||
QString m_searchText;
|
QString m_searchText;
|
||||||
QList<ContentLibraryMaterialsCategory *> m_bundleCategories;
|
QList<ContentLibraryMaterialsCategory *> m_bundleCategories;
|
||||||
QJsonObject m_matBundleObj;
|
QJsonObject m_matBundleObj;
|
||||||
Internal::ContentLibraryBundleImporter *m_importer = nullptr;
|
ContentLibraryBundleImporter *m_importer = nullptr;
|
||||||
|
|
||||||
bool m_isEmpty = true;
|
bool m_isEmpty = true;
|
||||||
bool m_matBundleExists = false;
|
bool m_matBundleExists = false;
|
||||||
|
@@ -225,10 +225,10 @@ QHash<int, QByteArray> ContentLibraryUserModel::roleNames() const
|
|||||||
|
|
||||||
void ContentLibraryUserModel::createImporter()
|
void ContentLibraryUserModel::createImporter()
|
||||||
{
|
{
|
||||||
m_importer = new Internal::ContentLibraryBundleImporter();
|
m_importer = new ContentLibraryBundleImporter();
|
||||||
#ifdef QDS_USE_PROJECTSTORAGE
|
#ifdef QDS_USE_PROJECTSTORAGE
|
||||||
connect(m_importer,
|
connect(m_importer,
|
||||||
&Internal::ContentLibraryBundleImporter::importFinished,
|
&ContentLibraryBundleImporter::importFinished,
|
||||||
this,
|
this,
|
||||||
[&](const QmlDesigner::TypeName &typeName) {
|
[&](const QmlDesigner::TypeName &typeName) {
|
||||||
m_importerRunning = false;
|
m_importerRunning = false;
|
||||||
@@ -238,7 +238,7 @@ void ContentLibraryUserModel::createImporter()
|
|||||||
});
|
});
|
||||||
#else
|
#else
|
||||||
connect(m_importer,
|
connect(m_importer,
|
||||||
&Internal::ContentLibraryBundleImporter::importFinished,
|
&ContentLibraryBundleImporter::importFinished,
|
||||||
this,
|
this,
|
||||||
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
||||||
m_importerRunning = false;
|
m_importerRunning = false;
|
||||||
@@ -248,7 +248,7 @@ void ContentLibraryUserModel::createImporter()
|
|||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect(m_importer, &Internal::ContentLibraryBundleImporter::unimportFinished, this,
|
connect(m_importer, &ContentLibraryBundleImporter::unimportFinished, this,
|
||||||
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
[&](const QmlDesigner::NodeMetaInfo &metaInfo) {
|
||||||
Q_UNUSED(metaInfo)
|
Q_UNUSED(metaInfo)
|
||||||
m_importerRunning = false;
|
m_importerRunning = false;
|
||||||
@@ -370,7 +370,7 @@ bool ContentLibraryUserModel::matBundleExists() const
|
|||||||
return m_matBundleExists;
|
return m_matBundleExists;
|
||||||
}
|
}
|
||||||
|
|
||||||
Internal::ContentLibraryBundleImporter *ContentLibraryUserModel::bundleImporter() const
|
ContentLibraryBundleImporter *ContentLibraryUserModel::bundleImporter() const
|
||||||
{
|
{
|
||||||
return m_importer;
|
return m_importer;
|
||||||
}
|
}
|
||||||
|
@@ -12,16 +12,13 @@ QT_FORWARD_DECLARE_CLASS(QUrl)
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class ContentLibraryBundleImporter;
|
||||||
class ContentLibraryEffect;
|
class ContentLibraryEffect;
|
||||||
class ContentLibraryMaterial;
|
class ContentLibraryMaterial;
|
||||||
class ContentLibraryTexture;
|
class ContentLibraryTexture;
|
||||||
class ContentLibraryWidget;
|
class ContentLibraryWidget;
|
||||||
class NodeMetaInfo;
|
class NodeMetaInfo;
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
class ContentLibraryBundleImporter;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ContentLibraryUserModel : public QAbstractListModel
|
class ContentLibraryUserModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -70,7 +67,7 @@ public:
|
|||||||
void loadMaterialBundle();
|
void loadMaterialBundle();
|
||||||
void loadTextureBundle();
|
void loadTextureBundle();
|
||||||
|
|
||||||
Internal::ContentLibraryBundleImporter *bundleImporter() const;
|
ContentLibraryBundleImporter *bundleImporter() const;
|
||||||
|
|
||||||
Q_INVOKABLE void applyToSelected(QmlDesigner::ContentLibraryMaterial *mat, bool add = false);
|
Q_INVOKABLE void applyToSelected(QmlDesigner::ContentLibraryMaterial *mat, bool add = false);
|
||||||
Q_INVOKABLE void addToProject(QmlDesigner::ContentLibraryMaterial *mat);
|
Q_INVOKABLE void addToProject(QmlDesigner::ContentLibraryMaterial *mat);
|
||||||
@@ -114,7 +111,7 @@ private:
|
|||||||
QStringList m_userCategories;
|
QStringList m_userCategories;
|
||||||
|
|
||||||
QJsonObject m_bundleObj;
|
QJsonObject m_bundleObj;
|
||||||
Internal::ContentLibraryBundleImporter *m_importer = nullptr;
|
ContentLibraryBundleImporter *m_importer = nullptr;
|
||||||
|
|
||||||
bool m_isEmpty = true;
|
bool m_isEmpty = true;
|
||||||
bool m_matBundleExists = false;
|
bool m_matBundleExists = false;
|
||||||
|
Reference in New Issue
Block a user