From aca3ccec10a2f88ad738581f62ac1311f1c3a815 Mon Sep 17 00:00:00 2001
From: Max Kahnt <max.kahnt@fu-berlin.de>
Date: Mon, 24 Jun 2013 14:06:53 +0000
Subject: [PATCH] bin: Fix hierarchicviewer for level increase > 1.

No more blank linkes should be needed for (debug)
output to be correctly parsed by the hier.viewer.

[[Imported from SVN: r8818]]
---
 bin/hierarchicviewer_qt4.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/hierarchicviewer_qt4.py b/bin/hierarchicviewer_qt4.py
index f71c27b2..fc709d16 100644
--- a/bin/hierarchicviewer_qt4.py
+++ b/bin/hierarchicviewer_qt4.py
@@ -44,15 +44,21 @@ class MyItemModel(Qt.QStandardItemModel):
 		self.parentItem.appendRow(thisItem)
 	    self.lastItemLevel = thisItemLevel
 
-	
 	if (levelDiff < 0):
 	    if (levelDiff < -1):
-		print "ERROR: BAD POSITIVE LEVEL DIFFERENCE"
+                for _ in itertools.repeat(None, -levelDiff-1):
+                    dummyItem = Qt.QStandardItem(item[0].rstrip() + '-Dummy')
+                    self.lastItem.appendRow(dummyItem)
+                    self.lastItem = dummyItem
 	    self.lastItem.appendRow(thisItem)
 	    self.lastItemLevel = thisItemLevel
 	
 	self.lastItem = thisItem
 	
+        #def saveModel(self, file): TODO
+        #def saveItem(self, file, item): TODO
+
+
 class MainWindow(Qt.QMainWindow):
 
     #def __init__(self, app, hit, timeout, autoAppend, follow, *args):
-- 
GitLab