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();
if (document && !document->inFileComponentModelActive() && model()
&& Utils::addImportWithCheck(
&& ModelUtils::addImportWithCheck(
"QtQuick3D",
[](const Import &import) { return !import.hasVersion() || import.majorVersion() >= 6; },
model())) {

View File

@@ -709,7 +709,7 @@ void ItemLibraryAssetImporter::finalizeQuick3DImport()
try {
RewriterTransaction transaction = model->rewriterView()->beginRewriterTransaction(
QByteArrayLiteral("ItemLibraryAssetImporter::finalizeQuick3DImport"));
bool success = Utils::addImportsWithCheck(m_requiredImports, model);
bool success = ModelUtils::addImportsWithCheck(m_requiredImports, model);
if (!success)
addError(tr("Failed to insert import statement into qml document."));
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
// beforehand, so we import the module immediately when the drag starts
if (!entry.requiredImport().isEmpty()
&& !Utils::addImportWithCheck(entry.requiredImport(), m_model)) {
&& !ModelUtils::addImportWithCheck(entry.requiredImport(), m_model)) {
qWarning() << __FUNCTION__ << "Required import adding failed:"
<< entry.requiredImport();
}

View File

@@ -885,7 +885,7 @@ ModelNode NavigatorTreeModel::handleItemLibraryFontDrop(const QString &fontFamil
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;
}

View File

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

View File

@@ -14,7 +14,7 @@ namespace QmlDesigner {
class PropertyMetaInfo;
}
namespace QmlDesigner::Utils {
namespace QmlDesigner::ModelUtils {
QMLDESIGNERCORE_EXPORT bool addImportsWithCheck(const QStringList &importNames,
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,
const PropertyName &propertyName);
} // namespace QmlDesigner::Utils
} // namespace QmlDesigner::ModelUtils