QmlDesigner: Rename QmlDesigner::Utils to QmlDesigner::ModelUtils

Change-Id: Ie586482c49e84660cb725f4581fd9413e42f80a8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Thomas Hartmann
2023-06-21 16:24:57 +02:00
parent fc4138d491
commit c5117d0de1
6 changed files with 8 additions and 8 deletions

View File

@@ -922,7 +922,7 @@ void Edit3DView::addQuick3DImport()
{ {
DesignDocument *document = QmlDesignerPlugin::instance()->currentDesignDocument(); DesignDocument *document = QmlDesignerPlugin::instance()->currentDesignDocument();
if (document && !document->inFileComponentModelActive() && model() if (document && !document->inFileComponentModelActive() && model()
&& Utils::addImportWithCheck( && ModelUtils::addImportWithCheck(
"QtQuick3D", "QtQuick3D",
[](const Import &import) { return !import.hasVersion() || import.majorVersion() >= 6; }, [](const Import &import) { return !import.hasVersion() || import.majorVersion() >= 6; },
model())) { model())) {

View File

@@ -709,7 +709,7 @@ void ItemLibraryAssetImporter::finalizeQuick3DImport()
try { try {
RewriterTransaction transaction = model->rewriterView()->beginRewriterTransaction( RewriterTransaction transaction = model->rewriterView()->beginRewriterTransaction(
QByteArrayLiteral("ItemLibraryAssetImporter::finalizeQuick3DImport")); QByteArrayLiteral("ItemLibraryAssetImporter::finalizeQuick3DImport"));
bool success = Utils::addImportsWithCheck(m_requiredImports, model); bool success = ModelUtils::addImportsWithCheck(m_requiredImports, model);
if (!success) if (!success)
addError(tr("Failed to insert import statement into qml document.")); addError(tr("Failed to insert import statement into qml document."));
transaction.commit(); transaction.commit();

View File

@@ -82,7 +82,7 @@ bool ItemLibraryWidget::eventFilter(QObject *obj, QEvent *event)
// For drag to be handled correctly, we must have the component properly imported // For drag to be handled correctly, we must have the component properly imported
// beforehand, so we import the module immediately when the drag starts // beforehand, so we import the module immediately when the drag starts
if (!entry.requiredImport().isEmpty() if (!entry.requiredImport().isEmpty()
&& !Utils::addImportWithCheck(entry.requiredImport(), m_model)) { && !ModelUtils::addImportWithCheck(entry.requiredImport(), m_model)) {
qWarning() << __FUNCTION__ << "Required import adding failed:" qWarning() << __FUNCTION__ << "Required import adding failed:"
<< entry.requiredImport(); << entry.requiredImport();
} }

View File

@@ -885,7 +885,7 @@ ModelNode NavigatorTreeModel::handleItemLibraryFontDrop(const QString &fontFamil
void NavigatorTreeModel::addImport(const QString &importName) void NavigatorTreeModel::addImport(const QString &importName)
{ {
if (!Utils::addImportWithCheck(importName, m_view->model())) if (!ModelUtils::addImportWithCheck(importName, m_view->model()))
qWarning() << __FUNCTION__ << "Adding import failed:" << importName; qWarning() << __FUNCTION__ << "Adding import failed:" << importName;
} }

View File

@@ -9,7 +9,7 @@
#include <algorithm> #include <algorithm>
namespace QmlDesigner::Utils { namespace QmlDesigner::ModelUtils {
namespace { namespace {
@@ -102,4 +102,4 @@ PropertyMetaInfo metainfo(const ModelNode &node, const PropertyName &propertyNam
return node.metaInfo().property(propertyName); return node.metaInfo().property(propertyName);
} }
} // namespace QmlDesigner::Utils } // namespace QmlDesigner::ModelUtils

View File

@@ -14,7 +14,7 @@ namespace QmlDesigner {
class PropertyMetaInfo; class PropertyMetaInfo;
} }
namespace QmlDesigner::Utils { namespace QmlDesigner::ModelUtils {
QMLDESIGNERCORE_EXPORT bool addImportsWithCheck(const QStringList &importNames, QMLDESIGNERCORE_EXPORT bool addImportsWithCheck(const QStringList &importNames,
const std::function<bool(const Import &)> &predicate, const std::function<bool(const Import &)> &predicate,
@@ -29,4 +29,4 @@ QMLDESIGNERCORE_EXPORT PropertyMetaInfo metainfo(const AbstractProperty &propert
QMLDESIGNERCORE_EXPORT PropertyMetaInfo metainfo(const ModelNode &node, QMLDESIGNERCORE_EXPORT PropertyMetaInfo metainfo(const ModelNode &node,
const PropertyName &propertyName); const PropertyName &propertyName);
} // namespace QmlDesigner::Utils } // namespace QmlDesigner::ModelUtils