From 0a1fa87ac9ead763419519a98f678059762b6e90 Mon Sep 17 00:00:00 2001 From: HalosGhost Date: Fri, 19 Dec 2014 08:27:22 -0600 Subject: [PATCH 1/4] Add -f option to reload --- qutebrowser/browser/commands.py | 8 ++++++-- qutebrowser/config/configdata.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 0a6e280fc..56bc65daf 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -305,15 +305,19 @@ class CommandDispatcher: @cmdutils.register(instance='command-dispatcher', name='reload', scope='window') - def reloadpage(self, count: {'special': 'count'}=None): + def reloadpage(self, force=False, count: {'special': 'count'}=None): """Reload the current/[count]th tab. Args: count: The tab index to reload, or None. + force: Bypass the page cache. """ tab = self._cntwidget(count) if tab is not None: - tab.reload() + if force: + tab.triggerAction(QWebPage.ReloadAndBypassCache) + else: + tab.reload() @cmdutils.register(instance='command-dispatcher', scope='window') def stop(self, count: {'special': 'count'}=None): diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 6d59c18df..08fecadd8 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -945,6 +945,7 @@ KEY_DATA = collections.OrderedDict([ ('tab-prev', ['K']), ('tab-clone', ['gC']), ('reload', ['r']), + ('reload -f', ['R']), ('back', ['H', '']), ('back -t', ['th']), ('back -w', ['wh']), From 0ea25c6ef0f0770addae6e50be348a8c7385e8ef Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 29 Dec 2014 22:04:09 +0100 Subject: [PATCH 2/4] Add missing imports --- qutebrowser/browser/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 56bc65daf..6e5301f7d 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -29,7 +29,7 @@ from PyQt5.QtWidgets import QApplication, QTabBar from PyQt5.QtCore import Qt, QUrl from PyQt5.QtGui import QClipboard from PyQt5.QtPrintSupport import QPrintDialog, QPrintPreviewDialog -from PyQt5.QtWebKitWidgets import QWebInspector +from PyQt5.QtWebKitWidgets import QWebPage, QWebInspector import pygments import pygments.lexers import pygments.formatters From 8e550ebe88d1cb5944f197d43a679e341cbfb7dd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 29 Dec 2014 22:04:22 +0100 Subject: [PATCH 3/4] Regenerate docs --- README.asciidoc | 1 + doc/help/commands.asciidoc | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.asciidoc b/README.asciidoc index 815955963..677cbedf2 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -137,6 +137,7 @@ Contributors, sorted by the number of commits in descending order: * Regina Hug * Peter Vilim * Helen Sherwood-Taylor +* HalosGhost // QUTE_AUTHORS_END The following people have contributed graphics: diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index ab08c1451..d5535d485 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -322,8 +322,13 @@ Quit qutebrowser. [[reload]] === reload +Syntax: +:reload [*--force*]+ + Reload the current/[count]th tab. +==== optional arguments +* +*-f*+, +*--force*+: Bypass the page cache. + ==== count The tab index to reload. From 0cd0f97587a317008e692478a207b6fd93102e6c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 29 Dec 2014 22:12:09 +0100 Subject: [PATCH 4/4] Call triggerAction on page, not view. --- qutebrowser/browser/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 6e5301f7d..2d489dfd5 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -315,7 +315,7 @@ class CommandDispatcher: tab = self._cntwidget(count) if tab is not None: if force: - tab.triggerAction(QWebPage.ReloadAndBypassCache) + tab.page().triggerAction(QWebPage.ReloadAndBypassCache) else: tab.reload()