Leave URLs encoded when setting commandline

This commit is contained in:
Florian Bruhin 2014-06-21 23:19:59 +02:00
parent 4d6dd808b1
commit 49fd08b30d
3 changed files with 5 additions and 8 deletions

View File

@ -17,10 +17,6 @@ Bugs
- Segfaults when trying to load http://cmpl.cc/downloads/hlwm-tablet.mkv and
with youtube HTML5 player.
- URL detection and encoded spaces
e.g. when trying to open a link with %20 interactively, or even via click.
- When quitting while being asked for a download filename: segfault / memory
corruption

View File

@ -457,19 +457,19 @@ class CommandDispatcher:
@cmdutils.register(instance='mainwindow.tabs.cmd', hide=True)
def open_tab_cur(self):
"""Set the statusbar to :tabopen and the current URL."""
urlstr = self._current_url().toDisplayString()
urlstr = self._current_url().toDisplayString(QUrl.FullyEncoded)
message.set_cmd_text(':open-tab ' + urlstr)
@cmdutils.register(instance='mainwindow.tabs.cmd', hide=True)
def open_cur(self):
"""Set the statusbar to :open and the current URL."""
urlstr = self._current_url().toDisplayString()
urlstr = self._current_url().toDisplayString(QUrl.FullyEncoded)
message.set_cmd_text(':open ' + urlstr)
@cmdutils.register(instance='mainwindow.tabs.cmd', hide=True)
def open_tab_bg_cur(self):
"""Set the statusbar to :tabopen-bg and the current URL."""
urlstr = self._current_url().toDisplayString()
urlstr = self._current_url().toDisplayString(QUrl.FullyEncoded)
message.set_cmd_text(':open-tab-bg ' + urlstr)
@cmdutils.register(instance='mainwindow.tabs.cmd')

View File

@ -320,8 +320,9 @@ class HintManager(QObject):
Target.cmd_tab: 'open-tab',
Target.cmd_tab_bg: 'open-tab-bg',
}
urlstr = url.toDisplayString(QUrl.FullyEncoded)
message.set_cmd_text(':{} {}'.format(commands[self._context.target],
url.toDisplayString()))
urlstr))
def _download(self, url):
"""Download a hint URL.