Wizard: fix incorrectly added modules to the tree
This commit is contained in:
+3
-3
@@ -23,13 +23,13 @@ class TargetsModel(
|
|||||||
val userObject = parentToAdd.userObject
|
val userObject = parentToAdd.userObject
|
||||||
when {
|
when {
|
||||||
userObject is Module && userObject.kind == ModuleKind.singleplatform -> {
|
userObject is Module && userObject.kind == ModuleKind.singleplatform -> {
|
||||||
val indexOfLastModule = parent.children()
|
val indexOfLastModule = parentToAdd.children()
|
||||||
.toList()
|
.toList()
|
||||||
.indexOfLast {
|
.indexOfLast {
|
||||||
it.safeAs<DefaultMutableTreeNode>()?.userObject is Module
|
it.safeAs<DefaultMutableTreeNode>()?.userObject is Module
|
||||||
}
|
}
|
||||||
if (indexOfLastModule == -1) parent.insert(this, 0)
|
if (indexOfLastModule == -1) parentToAdd.insert(this, 0)
|
||||||
else parent.insert(this, indexOfLastModule)
|
else parentToAdd.insert(this, indexOfLastModule)
|
||||||
}
|
}
|
||||||
else -> parentToAdd.add(this)
|
else -> parentToAdd.add(this)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user