From a1ba05ff088f9f25395d37c065b3396f807a1d2e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 29 Oct 2014 07:09:43 +0100 Subject: [PATCH] Add some logging for #152 --- qutebrowser/browser/hints.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index ae0f4befa..69ba387ce 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -20,9 +20,11 @@ """A HintManager to draw hints over links.""" import math +import functools import subprocess import collections +import sip from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject, QEvent, Qt, QUrl from PyQt5.QtGui import QMouseEvent, QClipboard from PyQt5.QtWidgets import QApplication @@ -158,6 +160,8 @@ class HintManager(QObject): pass for f in self._context.frames: log.hints.debug("Disconnecting frame {}".format(f)) + if objreg.get('args').debug: + sip.dump(f) f.contentsSizeChanged.disconnect(self.on_contents_size_changed) log.hints.debug("Disconnected.") text = self.HINT_TEXTS[self._context.target] @@ -602,6 +606,8 @@ class HintManager(QObject): self._context.target = target self._context.baseurl = tabbed_browser.current_url() self._context.frames = webelem.get_child_frames(mainframe) + for frame in self._context.frames: + frame.destroyed.connect(self.on_frame_destroyed) self._context.args = args self._init_elements(mainframe, group) message_bridge = objreg.get('message-bridge', scope='window', @@ -745,3 +751,8 @@ class HintManager(QObject): # hinting. return self._cleanup() + + @pyqtSlot('QObject') + def on_frame_destroyed(self, obj): + """Log when a frame got destroyed by Qt.""" + log.hints.debug("frame destroyed: {}".format(obj))