/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to viz/treeview.py

  • Committer: Daniel Schierbeck
  • Date: 2007-11-09 17:53:26 UTC
  • Revision ID: daniel.schierbeck@gmail.com-20071109175326-7aggg43pieersx4d
Fixed performance issue by only releasing the branch lock when the treeview is destroyed. This will surely fuck up the tagging code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
        self.children = None
82
82
        self.parents  = None
83
83
 
 
84
        self.connect("destroy", lambda x: self.branch.unlock())
 
85
 
84
86
    def do_get_property(self, property):
85
87
        if property.name == 'revno-column-visible':
86
88
            return self.revno_column.get_visible()
176
178
        :param broken_line_length: After how much lines branches \
177
179
                       should be broken.
178
180
        """
179
 
        try:
180
 
            self.branch.lock_read()
181
 
            (linegraphdata, index, columns_len) = linegraph(self.branch.repository,
182
 
                                                            start,
183
 
                                                            maxnum, 
184
 
                                                            broken_line_length)
185
 
 
186
 
            self.model = TreeModel(self.branch.repository, linegraphdata)
187
 
            self.graph_cell.columns_len = columns_len
188
 
            width = self.graph_cell.get_size(self.treeview)[2]
189
 
            self.graph_column.set_fixed_width(width)
190
 
            self.graph_column.set_max_width(width)
191
 
            self.index = index
192
 
            self.treeview.set_model(self.model)
193
 
            self.treeview.set_cursor(0)
194
 
            self.emit('revisions-loaded')
195
 
 
196
 
        finally:
197
 
            self.branch.unlock()
 
181
        self.branch.lock_read()
 
182
        (linegraphdata, index, columns_len) = linegraph(self.branch.repository,
 
183
                                                        start,
 
184
                                                        maxnum, 
 
185
                                                        broken_line_length)
 
186
 
 
187
        self.model = TreeModel(self.branch.repository, linegraphdata)
 
188
        self.graph_cell.columns_len = columns_len
 
189
        width = self.graph_cell.get_size(self.treeview)[2]
 
190
        self.graph_column.set_fixed_width(width)
 
191
        self.graph_column.set_max_width(width)
 
192
        self.index = index
 
193
        self.treeview.set_model(self.model)
 
194
        self.treeview.set_cursor(0)
 
195
        self.emit('revisions-loaded')
198
196
 
199
197
        return False
200
198