History

perf scripts python: exported-sql-viewer.py: Move report name into ReportVars

The report name is a report variable so move it into into ReportVars.

Adrian Hunter committed 7 years ago

Commit 947cc381 parent 0bf09471 file · +8 −8Browse files

Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all

Unified · Split

tools/perf/scripts/python/exported-sql-viewer.py+8−8
@@ -1402,7 +1402,8 @@ class BranchModel(TreeModel): · 1401 unmodified lines
14021402
14031403 class ReportVars():
14041404
1405− def __init__(self, where_clause = ""):
1405+ def __init__(self, name = "", where_clause = ""):
1406+ self.name = name
14061407 self.where_clause = where_clause
14071408
14081409 def UniqueId(self):
@@ -1412,7 +1413,7 @@ class ReportVars(): · 3 unmodified lines
14121413
14131414 class BranchWindow(QMdiSubWindow):
14141415
1415− def __init__(self, glb, event_id, name, report_vars, parent=None):
1416+ def __init__(self, glb, event_id, report_vars, parent=None):
14161417 super(BranchWindow, self).__init__(parent)
14171418
14181419 model_name = "Branch Events " + str(event_id) + " " + report_vars.UniqueId()
@@ -1435,7 +1436,7 @@ class BranchWindow(QMdiSubWindow): · 16 unmodified lines
14351436
14361437 self.setWidget(self.vbox.Widget())
14371438
1438− AddSubWindow(glb.mainwindow.mdi_area, self, name + " Branch Events")
1439+ AddSubWindow(glb.mainwindow.mdi_area, self, report_vars.name + " Branch Events")
14391440
14401441 def ResizeColumnToContents(self, column, n):
14411442 # Using the view's resizeColumnToContents() here is extrememly slow
@@ -1710,7 +1711,6 @@ class ReportDialogBase(QDialog): · 268 unmodified lines
17101711
17111712 self.glb = glb
17121713
1713− self.name = ""
17141714 self.report_vars = ReportVars()
17151715
17161716 self.setWindowTitle(title)
@@ -1751,8 +1751,8 @@ class ReportDialogBase(QDialog): · 34 unmodified lines
17511751
17521752 def Ok(self):
17531753 vars = self.report_vars
1754− self.name = self.data_items[0].value
1755− if not self.name:
1754+ vars.name = self.data_items[0].value
1755+ if not vars.name:
17561756 self.ShowMessage("Report name is required")
17571757 return
17581758 for d in self.data_items:
@@ -2392,13 +2392,13 @@ class MainWindow(QMainWindow): · 633 unmodified lines
23922392 CallGraphWindow(self.glb, self)
23932393
23942394 def NewBranchView(self, event_id):
2395− BranchWindow(self.glb, event_id, "", ReportVars(), self)
2395+ BranchWindow(self.glb, event_id, ReportVars(), self)
23962396
23972397 def NewSelectedBranchView(self, event_id):
23982398 dialog = SelectedBranchDialog(self.glb, self)
23992399 ret = dialog.exec_()
24002400 if ret:
2401− BranchWindow(self.glb, event_id, dialog.name, dialog.report_vars, self)
2401+ BranchWindow(self.glb, event_id, dialog.report_vars, self)
24022402
24032403 def NewTableView(self, table_name):
24042404 TableWindow(self.glb, table_name, self)