Retain bottom view model and fix crash after filter change

This commit is contained in:
René Stadler 2007-11-30 10:21:38 +02:00 committed by Stefan Sauer
parent 1e0c5215d2
commit fab31075c7

View file

@ -1118,13 +1118,16 @@ class LineView (object):
self.line_view.connect ("row-activated", self.handle_line_view_row_activated) self.line_view.connect ("row-activated", self.handle_line_view_row_activated)
self.log_view = log_view = window.log_view self.log_view = log_view = window.log_view
log_view.connect ("notify::model", self.handle_log_view_notify_model)
log_view.connect ("row-activated", self.handle_log_view_row_activated) log_view.connect ("row-activated", self.handle_log_view_row_activated)
sel = log_view.get_selection () sel = log_view.get_selection ()
sel.connect ("changed", self.handle_log_view_selection_changed) sel.connect ("changed", self.handle_log_view_selection_changed)
self.column_manager.attach (window) self.column_manager.attach (window)
def handle_attach_log_file (self, window):
self.line_view.props.model = LineViewLogModel (window.log_model)
def handle_line_view_row_activated (self, view, path, column): def handle_line_view_row_activated (self, view, path, column):
line_index = path[0] line_index = path[0]
@ -1135,16 +1138,6 @@ class LineView (object):
sel = self.log_view.get_selection () sel = self.log_view.get_selection ()
sel.select_path (path) sel.select_path (path)
def handle_log_view_notify_model (self, view, gparam):
log_model = view.props.model
if log_model is None:
return
line_model = LineViewLogModel (log_model)
self.line_view.props.model = line_model
def handle_log_view_row_activated (self, view, path, column): def handle_log_view_row_activated (self, view, path, column):
log_filter = view.props.model log_filter = view.props.model
@ -1604,6 +1597,7 @@ class Window (object):
def idle_set (): def idle_set ():
self.log_view.props.model = self.log_filter self.log_view.props.model = self.log_filter
self.line_view.handle_attach_log_file (self)
for feature in self.features: for feature in self.features:
feature.handle_attach_log_file (self, self.log_file) feature.handle_attach_log_file (self, self.log_file)
if len (self.log_filter): if len (self.log_filter):