Commit 268265bd authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.statesEditor: do not add redundant imports

Do not add QtQuick 1.0 import if we already have a QtQuick 1.1
import.

Reviewed-by: Kai Koehne
parent 0000ed61
......@@ -140,7 +140,9 @@ void StatesEditorView::addState()
}
try {
if (rootStateGroup().allStates().count() < 1)
if ((rootStateGroup().allStates().count() < 1) && //QtQuick import might be missing
(!model()->imports().contains(Import::createLibraryImport("QtQuick", "1.0")) &&
!model()->imports().contains(Import::createLibraryImport("QtQuick", "1.1"))))
model()->changeImports(QList<Import>() << Import::createLibraryImport("QtQuick", "1.0"), QList<Import>());
ModelNode newState = rootStateGroup().addState(newStateName);
setCurrentState(newState);
......
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