Merge branch 'halosghost-force-reload'

This commit is contained in:
Florian Bruhin 2014-12-29 22:12:43 +01:00
commit 8b9f323f41
4 changed files with 14 additions and 3 deletions

View File

@ -137,6 +137,7 @@ Contributors, sorted by the number of commits in descending order:
* Regina Hug * Regina Hug
* Peter Vilim * Peter Vilim
* Helen Sherwood-Taylor * Helen Sherwood-Taylor
* HalosGhost
// QUTE_AUTHORS_END // QUTE_AUTHORS_END
The following people have contributed graphics: The following people have contributed graphics:

View File

@ -322,8 +322,13 @@ Quit qutebrowser.
[[reload]] [[reload]]
=== reload === reload
Syntax: +:reload [*--force*]+
Reload the current/[count]th tab. Reload the current/[count]th tab.
==== optional arguments
* +*-f*+, +*--force*+: Bypass the page cache.
==== count ==== count
The tab index to reload. The tab index to reload.

View File

@ -29,7 +29,7 @@ from PyQt5.QtWidgets import QApplication, QTabBar
from PyQt5.QtCore import Qt, QUrl from PyQt5.QtCore import Qt, QUrl
from PyQt5.QtGui import QClipboard from PyQt5.QtGui import QClipboard
from PyQt5.QtPrintSupport import QPrintDialog, QPrintPreviewDialog from PyQt5.QtPrintSupport import QPrintDialog, QPrintPreviewDialog
from PyQt5.QtWebKitWidgets import QWebInspector from PyQt5.QtWebKitWidgets import QWebPage, QWebInspector
import pygments import pygments
import pygments.lexers import pygments.lexers
import pygments.formatters import pygments.formatters
@ -305,15 +305,19 @@ class CommandDispatcher:
@cmdutils.register(instance='command-dispatcher', name='reload', @cmdutils.register(instance='command-dispatcher', name='reload',
scope='window') scope='window')
def reloadpage(self, count: {'special': 'count'}=None): def reloadpage(self, force=False, count: {'special': 'count'}=None):
"""Reload the current/[count]th tab. """Reload the current/[count]th tab.
Args: Args:
count: The tab index to reload, or None. count: The tab index to reload, or None.
force: Bypass the page cache.
""" """
tab = self._cntwidget(count) tab = self._cntwidget(count)
if tab is not None: if tab is not None:
tab.reload() if force:
tab.page().triggerAction(QWebPage.ReloadAndBypassCache)
else:
tab.reload()
@cmdutils.register(instance='command-dispatcher', scope='window') @cmdutils.register(instance='command-dispatcher', scope='window')
def stop(self, count: {'special': 'count'}=None): def stop(self, count: {'special': 'count'}=None):

View File

@ -945,6 +945,7 @@ KEY_DATA = collections.OrderedDict([
('tab-prev', ['K']), ('tab-prev', ['K']),
('tab-clone', ['gC']), ('tab-clone', ['gC']),
('reload', ['r']), ('reload', ['r']),
('reload -f', ['R']),
('back', ['H', '<Backspace>']), ('back', ['H', '<Backspace>']),
('back -t', ['th']), ('back -t', ['th']),
('back -w', ['wh']), ('back -w', ['wh']),