QmlDesigner: Change importAdded and importRemoved in importsChanged

This commit is contained in:
Marco Bubke
2011-02-10 15:44:40 +01:00
parent 1b3f8c57b4
commit e3376b6d8d
30 changed files with 94 additions and 140 deletions

View File

@@ -262,6 +262,7 @@ void DragTool::dragEnterEvent(QGraphicsSceneDragDropEvent * event)
{
if (event->mimeData()->hasFormat("application/vnd.bauhaus.itemlibraryinfo") ||
event->mimeData()->hasFormat("application/vnd.bauhaus.libraryresource")) {
QList<Import> importToBeAddedList;
m_blockMove = false;
if (event->mimeData()->hasFormat("application/vnd.bauhaus.itemlibraryinfo")) {
Q_ASSERT(!event->mimeData()->data("application/vnd.bauhaus.itemlibraryinfo").isEmpty());
@@ -272,12 +273,14 @@ void DragTool::dragEnterEvent(QGraphicsSceneDragDropEvent * event)
Import newImport = Import::createLibraryImport(newImportUrl, newImportVersion);
if (!view()->model()->imports().contains(newImport)) {
view()->model()->addImport(newImport);
importToBeAddedList.append(newImport);
}
}
}
view()->model()->changeImports(importToBeAddedList, QList<Import>());
if (!m_rewriterTransaction.isValid()) {
view()->clearSelectedModelNodes();
m_rewriterTransaction = view()->beginRewriterTransaction();