Fix bottom view line activating the wrong line after filtering

This commit is contained in:
René Stadler 2008-02-04 17:26:48 +02:00 committed by Stefan Sauer
parent e75b817b72
commit 29ce10fb46

View file

@ -1483,8 +1483,10 @@ class LineView (object):
line_index = path[0] line_index = path[0]
line_model = view.props.model line_model = view.props.model
parent_index = line_model.line_index_to_super (line_index) log_model = self.log_view.props.model
path = (parent_index,) top_index = line_model.line_index_to_top (line_index)
log_index = log_model.line_index_from_top (top_index)
path = (log_index,)
self.log_view.scroll_to_cell (path, use_align = True, row_align = .5) self.log_view.scroll_to_cell (path, use_align = True, row_align = .5)
sel = self.log_view.get_selection () sel = self.log_view.get_selection ()
sel.select_path (path) sel.select_path (path)
@ -1494,7 +1496,7 @@ class LineView (object):
log_model = view.props.model log_model = view.props.model
line_index = path[0] line_index = path[0]
super_line_index = log_model.line_index_to_super (line_index) top_line_index = log_model.line_index_to_top (line_index)
line_model = self.line_view.props.model line_model = self.line_view.props.model
if line_model is None: if line_model is None:
return return
@ -1506,14 +1508,14 @@ class LineView (object):
else: else:
position = 0 position = 0
if len (line_model) > 1: if len (line_model) > 1:
other_index = line_model.line_index_to_super (position - 1) other_index = line_model.line_index_to_top (position - 1)
else: else:
other_index = -1 other_index = -1
if other_index == super_line_index and position != 1: if other_index == top_line_index and position != 1:
# Already have the line. # Already have the line.
pass pass
else: else:
line_model.insert_line (position, super_line_index) line_model.insert_line (position, top_line_index)
self.clear_action.props.sensitive = True self.clear_action.props.sensitive = True
def handle_log_view_selection_changed (self, selection): def handle_log_view_selection_changed (self, selection):