Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable chunks: fix file selection behavior

clearChunks() was being called after the intial file was displayed, causing
the margin clicks to be ineffective. There was also no need to recreate the
file list model for each refresh. It is perfectly capable of re-initializing
itself.

Changeset b2b0f03f935c

Parent e4701607d2e6

by Steve Borho

Changes to one file · Browse files at b2b0f03f935c Showing diff from parent e4701607d2e6 Diff from another changeset...

 
54
55
56
 
 
57
58
59
 
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
 
371
372
373
 
 
374
375
376
 
54
55
56
57
58
59
60
61
 
349
350
351
 
 
 
 
352
 
 
353
354
355
 
 
 
 
356
357
358
 
363
364
365
366
367
368
369
370
@@ -54,6 +54,8 @@
  self.layout().addWidget(self.splitter)     self.filelist = filelistview.HgFileListView(self) + self.filelistmodel = filelistmodel.HgFileListModel(self.repo, self) + self.filelist.setModel(self.filelistmodel)     self.fileListFrame = QFrame(self.splitter)   self.fileListFrame.setFrameShape(QFrame.NoFrame) @@ -347,20 +349,10 @@
  self.fileSelected.emit(False)     def setContext(self, ctx): - if self.filelist.model() is not None: - f = self.filelist.currentFile() - else: - f = None   self.fileSelected.emit(False) - self.filelistmodel = filelistmodel.HgFileListModel(self.repo, self) - self.filelist.setModel(self.filelistmodel)   self.diffbrowse.setContext(ctx)   self.filelistmodel.setContext(ctx)   self.fileModelEmpty.emit(len(ctx.files()) == 0) - if f and f in ctx: - self.filelist.selectFile(f) - else: - self.diffbrowse.clearChunks()     def refresh(self):   ctx = self.filelistmodel._ctx @@ -371,6 +363,8 @@
  self.repo.thginvalidate()   ctx = self.repo.changectx(ctx.node())   self.setContext(ctx) + if self.currentFile: + self.filelist.selectFile(self.currentFile)     def loadSettings(self, qs, prefix):   self.diffbrowse.loadSettings(qs, prefix)