diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 1417d6791..cbaf77282 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -459,7 +459,6 @@ class Application(QApplication): # downloads tabs.start_download.connect(download_manager.fetch) - tabs.download_get.connect(download_manager.get) def _get_widgets(self): """Get a string list of all widgets.""" diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 25e6e0d8f..27e1219a0 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -766,8 +766,7 @@ class CommandDispatcher: def download_page(self): """Download the current page.""" page = self._current_widget().page() - tabbed_browser = objreg.get('tabbed-browser') - tabbed_browser.download_get.emit(self._current_url(), page) + objreg.get('download-manager').get(self._current_url(), page) @cmdutils.register(instance='command-dispatcher') def view_source(self): diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index 90ffddf2f..875d1eb4a 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -31,7 +31,8 @@ from qutebrowser.config import config from qutebrowser.keyinput import modeman from qutebrowser.browser import webelem from qutebrowser.commands import userscripts, cmdexc -from qutebrowser.utils import usertypes, log, qtutils, message, objreg +from qutebrowser.utils import (usertypes, log, qtutils, message, objreg, + cmdutils) ElemTuple = collections.namedtuple('ElemTuple', 'elem, label') @@ -103,9 +104,6 @@ class HintManager(QObject): arg 0: URL to open as QUrl. arg 1: True if it should be opened in a new tab, else False. set_open_target: Set a new target to open the links in. - download_get: Download an URL. - arg 0: The URL to download, as QUrl. - arg 1: The QWebPage to download the URL in. """ HINT_CSS = """ @@ -139,7 +137,6 @@ class HintManager(QObject): mouse_event = pyqtSignal('QMouseEvent') openurl = pyqtSignal('QUrl', bool) set_open_target = pyqtSignal(str) - download_get = pyqtSignal('QUrl', 'QWebPage') def __init__(self, parent=None): """Constructor. @@ -362,7 +359,7 @@ class HintManager(QObject): immediately=True) return qtutils.ensure_valid(url) - self.download_get.emit(url, elem.webFrame().page()) + cmdreg.get('download-manager').get(url, elem.webFrame().page()) def _call_userscript(self, url): """Call an userscript from a hint.""" diff --git a/qutebrowser/widgets/tabbedbrowser.py b/qutebrowser/widgets/tabbedbrowser.py index ef91eb665..f07443197 100644 --- a/qutebrowser/widgets/tabbedbrowser.py +++ b/qutebrowser/widgets/tabbedbrowser.py @@ -78,7 +78,6 @@ class TabbedBrowser(tabwidget.TabWidget): current_tab_changed: The current tab changed to the emitted WebView. title_changed: Emitted when the application title should be changed. arg: The new title as string. - download_get: Emitted when a QUrl should be downloaded. """ cur_progress = pyqtSignal(int) @@ -90,7 +89,6 @@ class TabbedBrowser(tabwidget.TabWidget): cur_scroll_perc_changed = pyqtSignal(int, int) cur_load_status_changed = pyqtSignal(str) start_download = pyqtSignal('QNetworkReply*') - download_get = pyqtSignal('QUrl', 'QWebPage') hint_strings_updated = pyqtSignal(list) quit = pyqtSignal() resized = pyqtSignal('QRect') @@ -155,7 +153,6 @@ class TabbedBrowser(tabwidget.TabWidget): functools.partial(self.on_url_text_changed, tab)) # hintmanager tab.hintmanager.hint_strings_updated.connect(self.hint_strings_updated) - tab.hintmanager.download_get.connect(self.download_get) tab.hintmanager.openurl.connect(self.openurl) self.cur_load_started.connect(self.on_cur_load_started) # downloads