Do not let the user add duplicate lines to the bottom log view
authorRené Stadler <mail@renestadler.de>
Mon, 3 Dec 2007 15:49:04 +0000 (17:49 +0200)
committerStefan Sauer <ensonic@users.sf.net>
Thu, 11 Sep 2014 18:51:42 +0000 (20:51 +0200)
debug-viewer/GstDebugViewer/GUI.py

index b80f086..a244f0a 100755 (executable)
@@ -1198,7 +1198,15 @@ class LineView (object):
             position = bisect_right (timestamps, row[line_model.COL_TIME])
         else:
             position = 0
-        line_model.insert_line (position, super_line_index)
+        if len (line_model) > 1:
+            other_index = line_model.line_index_to_super (position - 1)
+        else:
+            other_index = -1
+        if other_index == super_line_index:
+            # Already have the line.
+            pass
+        else:
+            line_model.insert_line (position, super_line_index)
 
     def handle_log_view_selection_changed (self, selection):