From 1dde911618edac08fa7bad443f186c19eb53c94f Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Thu, 21 Apr 2016 11:54:57 +0200 Subject: [PATCH] browser: dump tree header, fix root path setting --- artiq/browser/files.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/artiq/browser/files.py b/artiq/browser/files.py index 5fb7ad9f9..8f6711735 100644 --- a/artiq/browser/files.py +++ b/artiq/browser/files.py @@ -111,8 +111,11 @@ class FilesDock(QtWidgets.QDockWidget): self.model.directoryLoaded.connect( lambda: self.rt.resizeColumnToContents(0)) self.rt.setAnimated(False) + if browse_root != "": + browse_root = os.path.abspath(browse_root) self.rt.setRootIndex(rt_model.mapFromSource( - self.model.setRootPath(os.path.abspath(browse_root)))) + self.model.setRootPath(browse_root))) + self.rt.setHeaderHidden(True) self.rt.setSelectionBehavior(self.rt.SelectRows) self.rt.setSelectionMode(self.rt.SingleSelection) self.rt.selectionModel().currentChanged.connect( @@ -206,7 +209,6 @@ class FilesDock(QtWidgets.QDockWidget): return { "dir": self.model.filePath(self.rl.rootIndex()), "file": self.model.filePath(self.rl.currentIndex()), - "header": bytes(self.rt.header().saveState()), "splitter": bytes(self.splitter.saveState()), } @@ -214,5 +216,4 @@ class FilesDock(QtWidgets.QDockWidget): if self.restore_selected: self.select_dir(state["dir"]) self.select_file(state["file"]) - self.rt.header().restoreState(QtCore.QByteArray(state["header"])) self.splitter.restoreState(QtCore.QByteArray(state["splitter"]))