Source

thg-qt-mq / 9139.diff

Full commit
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1287844952 -32400
# Node ID f0b104b1a41e1214f74451ee1e3d49fe10c5d838
# Parent  d7a92323a06a1d48771e19c20e5e00512a9452ce
manifestdialog: extract method to setup file annotation view

diff --git a/tortoisehg/hgqt/manifestdialog.py b/tortoisehg/hgqt/manifestdialog.py
--- a/tortoisehg/hgqt/manifestdialog.py
+++ b/tortoisehg/hgqt/manifestdialog.py
@@ -153,12 +153,17 @@ class ManifestWidget(QWidget):
 
         self._nullcontent = QWidget()
         self._contentview.addWidget(self._nullcontent)
-        self._fileview = annotate.AnnotateView(self._repo)
-        self._fileview.sourceChanged.connect(self.setSource)
         self._contentview.addWidget(self._fileview)
+
+    @util.propertycache
+    def _fileview(self):
+        """File content/annotation view"""
+        fileview = annotate.AnnotateView(self._repo)
+        fileview.sourceChanged.connect(self.setSource)
         for name in ('revisionHint', 'searchRequested', 'editSelected',
                      'grepRequested'):
-            getattr(self._fileview, name).connect(getattr(self, name))
+            getattr(fileview, name).connect(getattr(self, name))
+        return fileview
 
     def _initactions(self):
         self._statusfilter = _StatusFilterButton(text='MAC')