Commit 626364f6 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.DragTool: Remove import handling code



We have an import manager now.

Change-Id: If0123059a0fa1b51ef91c13bf24e3e6998195880
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 9c3604ba
......@@ -203,24 +203,6 @@ FormEditorItem* DragTool::calculateContainer(const QPointF &point, FormEditorIte
return 0;
}
QList<Import> DragTool::missingImportList(const ItemLibraryEntry &itemLibraryEntry)
{
QList<Import> importToBeAddedList;
if (!itemLibraryEntry.requiredImport().isEmpty()) {
const QString newImportUrl = itemLibraryEntry.requiredImport();
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);
}
return importToBeAddedList;
}
void DragTool::formEditorItemsChanged(const QList<FormEditorItem*> & itemList)
{
if (m_movingItem && itemList.contains(m_movingItem.data())) {
......@@ -317,13 +299,8 @@ void DragTool::dragEnterEvent(QGraphicsSceneDragDropEvent * event)
view()->widgetInfo().widget->setFocus();
m_Aborted = false;
Q_ASSERT(!event->mimeData()->data("application/vnd.bauhaus.itemlibraryinfo").isEmpty());
importToBeAddedList = missingImportList(
itemLibraryEntryFromData(event->mimeData()->data("application/vnd.bauhaus.itemlibraryinfo")));
}
view()->model()->changeImports(importToBeAddedList, QList<Import>());
if (!m_rewriterTransaction.isValid()) {
view()->clearSelectedModelNodes();
m_rewriterTransaction = view()->beginRewriterTransaction(QByteArrayLiteral("DragTool::dragEnterEvent"));
......
......@@ -113,7 +113,6 @@ private:
void createQmlItemNode(const ItemLibraryEntry &itemLibraryEntry, QmlItemNode parentNode, QPointF scenePos);
void createQmlItemNodeFromImage(const QString &imageName, QmlItemNode parentNode, QPointF scenePos);
FormEditorItem* calculateContainer(const QPointF &point, FormEditorItem * currentItem = 0);
QList<Import> missingImportList(const ItemLibraryEntry &itemLibraryEntry);
void begin(QPointF scenePos);
void end();
......
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