diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2016-10-08 14:49:38 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2016-10-08 22:52:21 +0200 |
commit | 2019397059d0e14fb71e69cc83e0216796032a6a (patch) | |
tree | b73c25878811db98f03ea2cd80bff3afb235e2e8 /debug-viewer | |
parent | da3880d6d04acb0186087ded9eb8a9f90956d213 (diff) |
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.
Diffstat (limited to 'debug-viewer')
-rw-r--r-- | debug-viewer/GstDebugViewer/GUI/models.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/debug-viewer/GstDebugViewer/GUI/models.py b/debug-viewer/GstDebugViewer/GUI/models.py index abb019d89e..a9678c36cf 100644 --- a/debug-viewer/GstDebugViewer/GUI/models.py +++ b/debug-viewer/GstDebugViewer/GUI/models.py @@ -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 |