From 068674e63dc05cfe19b093d67095f04e348b9c78 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Tue, 4 Feb 2020 23:57:29 +0100 Subject: [PATCH] Remove the change of selected item when deleting, and let the tree widget handle it --- nw/gui/elements/doctree.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nw/gui/elements/doctree.py b/nw/gui/elements/doctree.py index 30a369e1..5ade6c5b 100644 --- a/nw/gui/elements/doctree.py +++ b/nw/gui/elements/doctree.py @@ -295,8 +295,6 @@ class GuiDocTree(QTreeWidget): tIndex = trItemP.indexOfChild(trItemS) trItemC = trItemP.takeChild(tIndex) - self.clearSelection() - trItemP.setSelected(True) if self.theParent.docEditor.theHandle == tHandle: self.theParent.closeDocument() @@ -317,8 +315,6 @@ class GuiDocTree(QTreeWidget): trItemC = trItemP.takeChild(tIndex) trItemT.addChild(trItemC) nwItemS.setParent(self.theProject.trashRoot) - self.clearSelection() - trItemP.setSelected(True) self.theProject.setProjectChanged(True) self.theParent.theIndex.deleteHandle(tHandle) @@ -332,8 +328,6 @@ class GuiDocTree(QTreeWidget): tIndex = trItemP.indexOfChild(trItemS) if trItemS.childCount() == 0: trItemP.takeChild(tIndex) - self.clearSelection() - trItemP.setSelected(True) self.theProject.deleteItem(tHandle) else: self.makeAlert(["Cannot delete folder.","It is not empty."], nwAlert.ERROR)