hgview #10127474 Crashes with QHeaderView.setDefaultSectionSize(int): argument 1 has unexpected type 'HgConfig' [open]

Current default branch crashes on startup with:

Traceback (most recent call last):
  File "/home/luke/devel/hgview/bin/hgview", line 38, in <module>
    main()
  File "/home/luke/devel/hgview/hgviewlib/application.py", line 226, in main
    sys.exit(start(repo, opts, args, parser.error))
  File "/home/luke/devel/hgview/hgviewlib/application.py", line 174, in start
    app = Application(repo, opts, args)
  File "/home/luke/devel/hgview/hgviewlib/qt4/application.py", line 54, in __init__
    super(HgViewQtApplication, self).__init__(*args, **kwargs)
  File "/home/luke/devel/hgview/hgviewlib/application.py", line 84, in __init__
    self.choose_viewer()
  File "/home/luke/devel/hgview/hgviewlib/application.py", line 108, in choose_viewer
    viewer = self.HgRepoViewer(self.repo)
  File "/home/luke/devel/hgview/hgviewlib/qt4/hgrepoviewer.py", line 87, in __init__
    self.setupModels(fromhead)
  File "/home/luke/devel/hgview/hgviewlib/qt4/hgrepoviewer.py", line 482, in setupModels
    self.tableView_filelist.setModel(self.filelistmodel)
  File "/home/luke/devel/hgview/hgviewlib/qt4/hgfileview.py", line 568, in setModel
    self.verticalHeader().setDefaultSectionSize(rowheight)
TypeError: QHeaderView.setDefaultSectionSize(int): argument 1 has unexpected type 'HgConfig'

It can be fixed easily with this patch:

diff --git a/hgviewlib/qt4/hgfileview.py b/hgviewlib/qt4/hgfileview.py
--- a/hgviewlib/qt4/hgfileview.py
+++ b/hgviewlib/qt4/hgfileview.py
@@ -564,7 +564,7 @@ class HgFileListView(ActionsMixin, QtGui
                 self.fileSelected)
         self.horizontalHeader().setResizeMode(1, QtGui.QHeaderView.Stretch)

-        rowheight = HgConfig(self.model().repo.ui)
+        rowheight = HgConfig(self.model().repo.ui).getRowHeight()
         self.verticalHeader().setDefaultSectionSize(rowheight)

     def currentFile(self):
priorityimportant
typebug
done in1.10.1
closed by<not specified>