Add some debug statements to find cause of bug 4481/4834

svn: r17295
This commit is contained in:
Michiel Nauta 2011-04-27 17:45:37 +00:00
parent 33daf99b33
commit 77cf544636

View File

@ -833,13 +833,21 @@ class TreeBaseModel(gtk.GenericTreeModel):
"""
if not self.tree or not self.tree[None].children:
return None
_LOG.debug('path argument of on_get_iter method %s' % str(path))
node = self.tree[None]
pathlist = list(path)
try:
for index in pathlist:
if self.__reverse:
node = self.nodemap.node(node.children[-index - 1][1])
else:
node = self.nodemap.node(node.children[index][1])
except IndexError:
# From the gtk.TreeModel.get_iter documentation:
# This method raises a ValueError exception if path is not a valid
# tree path.
raise ValueError("list index, %s, out of range; max is %d; reverse is %s" % \
(index, len(node.children), self.__reverse))
return node
def on_get_path(self, node):