Commit c4b1b16e authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.ItemNode: Remove import handling



We have an import manager now and do not have to handle imports
in the code for item creation. This is just a possible source of bugs.

Change-Id: I5de40b874659f27f0f1a8d83dd78bcae2194aa32
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 2e1c1df7
......@@ -106,34 +106,6 @@ QmlItemNode QmlItemNode::createQmlItemNode(AbstractView *view, const ItemLibrary
int minorVersion = metaInfo.minorVersion();
int majorVersion = metaInfo.majorVersion();
if (itemLibraryEntry.typeName().contains('.')) {
const QString newImportUrl = itemLibraryEntry.requiredImport();
if (!itemLibraryEntry.requiredImport().isEmpty()) {
const QString newImportVersion = QString("%1.%2").arg(QString::number(itemLibraryEntry.majorVersion()), QString::number(itemLibraryEntry.minorVersion()));
Import newImport = Import::createLibraryImport(newImportUrl, newImportVersion);
if (itemLibraryEntry.majorVersion() == -1 && itemLibraryEntry.minorVersion() == -1)
newImport = Import::createFileImport(newImportUrl, QString());
else
newImport = Import::createLibraryImport(newImportUrl, newImportVersion);
foreach (const Import &import, view->model()->imports()) {
if (import.isLibraryImport()
&& import.url() == newImport.url()
&& import.version() == newImport.version()) {
// reuse this import
newImport = import;
break;
}
}
if (!view->model()->hasImport(newImport, true, true))
view->model()->changeImports(QList<Import>() << newImport, QList<Import>());
}
}
typedef QPair<PropertyName, QString> PropertyBindingEntry;
QList<PropertyBindingEntry> propertyBindingList;
if (itemLibraryEntry.qmlSource().isEmpty()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment