From 63d9122ea23badeb9c6d14af8fb4055a8067783b Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 13 Jan 2010 20:17:45 +0000 Subject: [PATCH] fix 3 one line bugs in treebasemodel svn: r14068 --- src/gui/views/treemodels/treebasemodel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/views/treemodels/treebasemodel.py b/src/gui/views/treemodels/treebasemodel.py index a73de56ff..b48ea9c9d 100644 --- a/src/gui/views/treemodels/treebasemodel.py +++ b/src/gui/views/treemodels/treebasemodel.py @@ -150,7 +150,8 @@ class Node(object): ' not present in self.children: ' + str(self.children)\ + ' at index ' + str(index) if index == 0: - nodemap.node(self.children[index][1]).prev = None + if len(self.children) > 1: + nodemap.node(self.children[index+1][1]).prev = None elif index == len(self.children)-1: nodemap.node(self.children[index - 1][1]).next = None else: @@ -604,7 +605,8 @@ class TreeBaseModel(gtk.GenericTreeModel): path = self.on_get_path(node) self.nodemap.node(node.parent).remove_child(node, self.nodemap) del self.tree[node.ref] - del self.handle2node[node.handle] + if node.handle is not None: + del self.handle2node[node.handle] self.nodemap.del_node(node) del node self.__displayed -= 1