mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
debug-viewer: models: allow filter to check COL_MESSAGE
COL_MESSAGE contains the message offset as an internal optimization. When preparing a row for filters, we need to replace this. Otherwise filters get an 'int' instead of the 'string' they expect.
This commit is contained in:
parent
da3880d6d0
commit
2019397059
1 changed files with 6 additions and 1 deletions
|
@ -68,11 +68,15 @@ class LogModelBase (Common.GUI.GenericTreeModel):
|
|||
line_cache = self.line_cache
|
||||
line_levels = self.line_levels
|
||||
COL_LEVEL = self.COL_LEVEL
|
||||
COL_MESSAGE = self.COL_MESSAGE
|
||||
access_offset = self.access_offset
|
||||
|
||||
for i, offset in enumerate(self.line_offsets):
|
||||
ensure_cached(offset)
|
||||
row = line_cache[offset]
|
||||
row[COL_LEVEL] = line_levels[i] # FIXME
|
||||
# adjust special rows
|
||||
row[COL_LEVEL] = line_levels[i]
|
||||
row[COL_MESSAGE] = access_offset(offset + row[COL_MESSAGE])
|
||||
yield (row, offset,)
|
||||
|
||||
def on_get_flags(self):
|
||||
|
@ -127,6 +131,7 @@ class LogModelBase (Common.GUI.GenericTreeModel):
|
|||
value = self.line_cache[line_offset][col_id]
|
||||
if col_id == self.COL_MESSAGE:
|
||||
message_offset = value
|
||||
# TODO: correct the message offset to avodi the strip() calls
|
||||
value = self.access_offset(line_offset + message_offset).strip()
|
||||
|
||||
return value
|
||||
|
|
Loading…
Reference in a new issue