Remove old deprecated commands

This commit is contained in:
Florian Bruhin 2017-10-17 10:31:45 +02:00
parent f1ddf58260
commit 458a45c172
4 changed files with 6 additions and 75 deletions

View File

@ -39,6 +39,12 @@ Deprecated
- `:tab-detach` has been deprecated, as `:tab-give` without argument can be used - `:tab-detach` has been deprecated, as `:tab-give` without argument can be used
instead. instead.
Removed
~~~~~~~
- The long-deprecated `:prompt-yes`, `:prompt-no`, `:paste-primary` and `:paste`
commands have been removed.
v1.0.2 v1.0.2
------ ------

View File

@ -1012,43 +1012,6 @@ class CommandDispatcher:
else: else:
raise cmdexc.CommandError("Last tab") raise cmdexc.CommandError("Last tab")
@cmdutils.register(instance='command-dispatcher', scope='window',
deprecated="Use :open {clipboard}")
def paste(self, sel=False, tab=False, bg=False, window=False):
"""Open a page from the clipboard.
If the pasted text contains newlines, each line gets opened in its own
tab.
Args:
sel: Use the primary selection instead of the clipboard.
tab: Open in a new tab.
bg: Open in a background tab.
window: Open in new window.
"""
force_search = False
if not utils.supports_selection():
sel = False
try:
text = utils.get_clipboard(selection=sel)
except utils.ClipboardError as e:
raise cmdexc.CommandError(e)
text_urls = [u for u in text.split('\n') if u.strip()]
if (len(text_urls) > 1 and not urlutils.is_url(text_urls[0]) and
urlutils.get_path_if_valid(
text_urls[0], check_exists=True) is None):
force_search = True
text_urls = [text]
for i, text_url in enumerate(text_urls):
if not window and i > 0:
tab = False
bg = True
try:
url = urlutils.fuzzy_url(text_url, force_search=force_search)
except urlutils.InvalidUrlError as e:
raise cmdexc.CommandError(e)
self._open(url, tab, bg, window)
def _resolve_buffer_index(self, index): def _resolve_buffer_index(self, index):
"""Resolve a buffer index to the tabbedbrowser and tab. """Resolve a buffer index to the tabbedbrowser and tab.
@ -1676,14 +1639,6 @@ class CommandDispatcher:
except webelem.Error as e: except webelem.Error as e:
raise cmdexc.CommandError(str(e)) raise cmdexc.CommandError(str(e))
@cmdutils.register(instance='command-dispatcher',
deprecated="Use :insert-text {primary}",
modes=[KeyMode.insert], hide=True, scope='window',
backend=usertypes.Backend.QtWebKit)
def paste_primary(self):
"""Paste the primary selection at cursor position."""
self.insert_text(utils.get_clipboard(selection=True, fallback=True))
@cmdutils.register(instance='command-dispatcher', maxsplit=0, @cmdutils.register(instance='command-dispatcher', maxsplit=0,
scope='window') scope='window')
def insert_text(self, text): def insert_text(self, text):

View File

@ -388,20 +388,6 @@ class PromptContainer(QWidget):
message.global_bridge.prompt_done.emit(self._prompt.KEY_MODE) message.global_bridge.prompt_done.emit(self._prompt.KEY_MODE)
question.done() question.done()
@cmdutils.register(instance='prompt-container', hide=True, scope='window',
modes=[usertypes.KeyMode.yesno],
deprecated='Use :prompt-accept yes instead!')
def prompt_yes(self):
"""Answer yes to a yes/no prompt."""
self.prompt_accept('yes')
@cmdutils.register(instance='prompt-container', hide=True, scope='window',
modes=[usertypes.KeyMode.yesno],
deprecated='Use :prompt-accept no instead!')
def prompt_no(self):
"""Answer no to a yes/no prompt."""
self.prompt_accept('no')
@cmdutils.register(instance='prompt-container', hide=True, scope='window', @cmdutils.register(instance='prompt-container', hide=True, scope='window',
modes=[usertypes.KeyMode.prompt], maxsplit=0) modes=[usertypes.KeyMode.prompt], maxsplit=0)
def prompt_open_download(self, cmdline: str = None): def prompt_open_download(self, cmdline: str = None):

View File

@ -387,22 +387,6 @@ Feature: Prompts
Then the javascript message "confirm reply: true" should be logged Then the javascript message "confirm reply: true" should be logged
And the error "No default value was set for this question!" should be shown And the error "No default value was set for this question!" should be shown
Scenario: Javascript confirm with deprecated :prompt-yes command
When I open data/prompt/jsconfirm.html
And I run :click-element id button
And I wait for a prompt
And I run :prompt-yes
Then the javascript message "confirm reply: true" should be logged
And the warning "prompt-yes is deprecated - Use :prompt-accept yes instead!" should be shown
Scenario: Javascript confirm with deprecated :prompt-no command
When I open data/prompt/jsconfirm.html
And I run :click-element id button
And I wait for a prompt
And I run :prompt-no
Then the javascript message "confirm reply: false" should be logged
And the warning "prompt-no is deprecated - Use :prompt-accept no instead!" should be shown
# Other # Other
@qtwebengine_skip @qtwebengine_skip