forked from qt-creator/qt-creator
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:
@@ -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())) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user