From 60c6b7f0abcc9e602fa3912990e5aa16e14a396a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 31 Oct 2016 16:08:46 +0100 Subject: [PATCH] Simplify FilenamePrompt._insert_text --- qutebrowser/mainwindow/prompt.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py index 9d75a75d1..e052fcbd5 100644 --- a/qutebrowser/mainwindow/prompt.py +++ b/qutebrowser/mainwindow/prompt.py @@ -573,16 +573,11 @@ class FilenamePrompt(_BasePrompt): index: The QModelIndex of the selected element. clicked: Whether the element was clicked. """ - parts = [] - cur = index - while cur.isValid(): - parts.append(cur.data()) - cur = cur.parent() - path = os.path.normpath(os.path.join(*reversed(parts))) + path = os.path.normpath(self._file_model.filePath(index)) if clicked: path += os.sep - log.prompt.debug('Clicked {!r} -> {}'.format(parts, path)) + log.prompt.debug('Inserting path {}'.format(path)) self._lineedit.setText(path) self._lineedit.setFocus() if clicked: