From fe99cbc33152dc41a80cbc397891a66ac334efe5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 17 Jun 2014 10:20:15 +0200 Subject: [PATCH] Fix crashes after parent-child cleanup. --- qutebrowser/app.py | 2 +- qutebrowser/widgets/statusbar/progress.py | 2 +- qutebrowser/widgets/statusbar/url.py | 11 +++-------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index d9b9afb93..7dd640fdc 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -136,7 +136,7 @@ class Application(QApplication): self.searchmanager = SearchManager(self) self.downloadmanager = DownloadManager(self) self.downloadmodel = DownloadModel(self.downloadmanager) - self.mainwindow = MainWindow(self) + self.mainwindow = MainWindow() self.modeman.mainwindow = self.mainwindow self.installEventFilter(self.modeman) diff --git a/qutebrowser/widgets/statusbar/progress.py b/qutebrowser/widgets/statusbar/progress.py index d129e6c61..7342423b9 100644 --- a/qutebrowser/widgets/statusbar/progress.py +++ b/qutebrowser/widgets/statusbar/progress.py @@ -46,7 +46,7 @@ class Progress(QProgressBar): }} """ - def __init__(self, parent): + def __init__(self, parent=None): super().__init__(parent) set_register_stylesheet(self) self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Ignored) diff --git a/qutebrowser/widgets/statusbar/url.py b/qutebrowser/widgets/statusbar/url.py index 56a7e8d51..9acf963c4 100644 --- a/qutebrowser/widgets/statusbar/url.py +++ b/qutebrowser/widgets/statusbar/url.py @@ -69,14 +69,9 @@ class Url(TextBase): }} """ - def __init__(self, bar, elidemode=Qt.ElideMiddle): - """Override TextBase::__init__ to elide in the middle by default. - - Args: - bar: The statusbar (parent) object. - elidemode: How to elide the text. - """ - super().__init__(bar, elidemode) + def __init__(self, parent=None): + """Override TextBase.__init__ to elide in the middle by default.""" + super().__init__(parent, Qt.ElideMiddle) self.setObjectName(self.__class__.__name__) set_register_stylesheet(self) self._hover_url = None