summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2016-10-09 12:55:59 +0200
committerStefan Sauer <ensonic@users.sf.net>2016-10-10 12:33:06 +0200
commit561c6124729dbcdb5a9cba49057ec40c05b04b50 (patch)
tree3daf7f54984ad1a30b39f5523b7bd9c0a214914c
parentd44c317da74bffd5135d9e2f89b03557cc92ea7c (diff)
degbug-viewer: models: only temporarilly modify the row for filtering
This avoid that we have to chek the type in the getter. Also update the comment - we need the strip since the readline call will not strip the newline.
-rw-r--r--debug-viewer/GstDebugViewer/GUI/models.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/debug-viewer/GstDebugViewer/GUI/models.py b/debug-viewer/GstDebugViewer/GUI/models.py
index a9678c3..984e310 100644
--- a/debug-viewer/GstDebugViewer/GUI/models.py
+++ b/debug-viewer/GstDebugViewer/GUI/models.py
@@ -76,8 +76,10 @@ class LogModelBase (Common.GUI.GenericTreeModel):
row = line_cache[offset]
# adjust special rows
row[COL_LEVEL] = line_levels[i]
- row[COL_MESSAGE] = access_offset(offset + row[COL_MESSAGE])
+ msg_offset = row[COL_MESSAGE]
+ row[COL_MESSAGE] = access_offset(offset + msg_offset)
yield (row, offset,)
+ row[COL_MESSAGE] = msg_offset
def on_get_flags(self):
@@ -130,9 +132,8 @@ 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()
+ # strip whitespace + newline
+ value = self.access_offset(line_offset + value).strip()
return value