Commits

Yuya Nishihara committed e7e5dc8

filediffdialog: eliminate unneeded reference to each repo view

  • Participants
  • Parent commits e4a0d10

Comments (0)

Files changed (1)

File tortoisehg/hgqt/filedialogs.py

         self.splitter = QSplitter(Qt.Vertical)
         self.setCentralWidget(self.splitter)
         self.horizontalLayout = QHBoxLayout()
+        self._repoViews = []
         cs = ('fileDiffDialogLeft', _('File Differences Log Columns'))
-        self.tableView_revisions_left = repoview.HgRepoView(self.repo, cs[0],
-                                                            cs, self)
-        self.tableView_revisions_right = repoview.HgRepoView(self.repo,
-                                                             'fileDiffDialogRight',
-                                                             cs, self)
-        self.horizontalLayout.addWidget(self.tableView_revisions_left)
-        self.horizontalLayout.addWidget(self.tableView_revisions_right)
-        self.tableView_revisions_right.setSelectionMode(QAbstractItemView.SingleSelection)
-        self.tableView_revisions_left.setSelectionMode(QAbstractItemView.SingleSelection)
-        self._repoViews = [self.tableView_revisions_left,
-                           self.tableView_revisions_right]
+        for cfgname in [cs[0], 'fileDiffDialogRight']:
+            w = repoview.HgRepoView(self.repo, cfgname, cs, self)
+            w.setSelectionMode(QAbstractItemView.SingleSelection)
+            self.horizontalLayout.addWidget(w)
+            self._repoViews.append(w)
         self.frame = QFrame()
         self.splitter.addWidget(layouttowidget(self.horizontalLayout))
         self.splitter.addWidget(self.frame)