mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
Properly delete selected nodes
This commit is contained in:
20
src/main.cpp
20
src/main.cpp
@@ -722,17 +722,17 @@ void MainWindow::removeNode() {
|
|||||||
auto* ctrl = activeController();
|
auto* ctrl = activeController();
|
||||||
if (!ctrl) return;
|
if (!ctrl) return;
|
||||||
auto* primary = activePaneEditor();
|
auto* primary = activePaneEditor();
|
||||||
if (!primary || primary->isEditing()) return;
|
if (primary && primary->isEditing()) return;
|
||||||
QSet<int> indices = primary->selectedNodeIndices();
|
QSet<uint64_t> ids = ctrl->selectedIds();
|
||||||
if (indices.size() > 1) {
|
QVector<int> indices;
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
for (uint64_t id : ids) {
|
||||||
ctrl->batchRemoveNodes(indices.values());
|
int idx = ctrl->document()->tree.indexOfId(id & ~kFooterIdBit);
|
||||||
#else
|
if (idx >= 0) indices.append(idx);
|
||||||
ctrl->batchRemoveNodes(indices.values().toVector());
|
|
||||||
#endif
|
|
||||||
} else if (indices.size() == 1) {
|
|
||||||
ctrl->removeNode(*indices.begin());
|
|
||||||
}
|
}
|
||||||
|
if (indices.size() > 1)
|
||||||
|
ctrl->batchRemoveNodes(indices);
|
||||||
|
else if (indices.size() == 1)
|
||||||
|
ctrl->removeNode(indices.first());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::changeNodeType() {
|
void MainWindow::changeNodeType() {
|
||||||
|
|||||||
Reference in New Issue
Block a user