From 46b24fc64a1922661d5dc6257c52ec34a0a60874 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 26 Oct 2016 21:36:46 +0200 Subject: [PATCH] Improve how file list is shown in download prompt --- qutebrowser/mainwindow/prompt.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py index 4e4b0dcc0..592b1fbfb 100644 --- a/qutebrowser/mainwindow/prompt.py +++ b/qutebrowser/mainwindow/prompt.py @@ -477,6 +477,10 @@ class FilenamePrompt(_BasePrompt): @pyqtSlot(str) def _set_fileview_root(self, path): """Set the root path for the file display.""" + if not path.endswith('/'): + return + path.rstrip('/') + try: if os.path.isdir(path): path = path @@ -498,6 +502,10 @@ class FilenamePrompt(_BasePrompt): self._file_model = QFileSystemModel(self) self._file_view.setModel(self._file_model) self._vbox.addWidget(self._file_view) + # Only show name + self._file_view.setHeaderHidden(True) + for col in range(1, 4): + self._file_view.setColumnHidden(col, True) def accept(self, value=None): text = value if value is not None else self._lineedit.text()