From 2ec9deb2aa6eb83664d9b2c9d024f6caf1a6b299 Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Thu, 20 Jun 2019 12:47:03 +0200 Subject: [PATCH] Properly remove button from toolbar Signed-off-by: Juraj Oravec --- readability/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/readability/__init__.py b/readability/__init__.py index 97a40cf..1593bd5 100644 --- a/readability/__init__.py +++ b/readability/__init__.py @@ -61,8 +61,12 @@ class Readability(Falkon.PluginInterface, QtCore.QObject): self.buttons[window] = button def onMainWindowDeleted(self, window): - if window in self.buttons: - del self.buttons[window] + if window not in self.buttons: + return + + button = self.buttons[window] + window.navigationBar().removeToolButton(button) + del self.buttons[window] def populateWebViewMenu(self, menu, view, hitTestResult): if not self.config["contextMenu"]: