summaryrefslogtreecommitdiff
path: root/qutebrowser/mainwindow/prompt.py
diff options
context:
space:
mode:
authorMarc Jauvin <marc.jauvin@gmail.com>2018-02-10 00:38:27 -0500
committerMarc Jauvin <marc.jauvin@gmail.com>2018-02-10 00:38:27 -0500
commitc6ad23f9215f361426b254734ec5c4168fc55a94 (patch)
treebb9229bf35d49318304e088e4f00dfd29c201307 /qutebrowser/mainwindow/prompt.py
parentf16f425cb12071720dadf82e6aca0bb85adf1c74 (diff)
downloadqutebrowser-c6ad23f9215f361426b254734ec5c4168fc55a94.tar.gz
qutebrowser-c6ad23f9215f361426b254734ec5c4168fc55a94.zip
address all mentionned issues except for file://
- re-encode url using QUrl.RemovePassword | QUrl.FullyEncoded - improve readability for clipboard / primary selection code block
Diffstat (limited to 'qutebrowser/mainwindow/prompt.py')
-rw-r--r--qutebrowser/mainwindow/prompt.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py
index aff6701fc..b502f1f3d 100644
--- a/qutebrowser/mainwindow/prompt.py
+++ b/qutebrowser/mainwindow/prompt.py
@@ -432,16 +432,16 @@ class PromptContainer(QWidget):
sel: Use the primary selection instead of the clipboard.
"""
question = self._prompt.question
- if not question.url:
+ if question.url is None:
message.error('No URL found.')
return
- s = question.url
- target = 'primary selection'
- if not (sel and utils.supports_selection()):
- target = 'clipboard'
+ if sel and utils.supports_selection():
+ target = 'primary selection'
+ else:
sel = False
- utils.set_clipboard(s, sel)
- message.info("Yanked to {}: {}".format(target, s))
+ target = 'clipboard'
+ utils.set_clipboard(question.url, sel)
+ message.info("Yanked to {}: {}".format(target, question.url))
class LineEdit(QLineEdit):