From 5ce4e44148ec4d750e4b41e13ec8ea7dd17c6dcc Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Wed, 30 Sep 2015 21:54:53 +0100 Subject: [PATCH] Fixup FileStoreDialog nits .. select root folders .. show files for context --- src/FileStore.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/FileStore.cpp b/src/FileStore.cpp index 451cc8ea2..ea963e98a 100644 --- a/src/FileStore.cpp +++ b/src/FileStore.cpp @@ -283,7 +283,8 @@ void FileStoreDialog::fileDoubleClicked(QTreeWidgetItem*item, int) { // try and set the path to the item double clicked - setPath(pathname + "/" + item->text(0)); + if (pathname.endsWith("/")) setPath(pathname + item->text(0)); + else setPath(pathname + "/" + item->text(0)); } void @@ -314,11 +315,11 @@ FileStoreDialog::setFiles(FileStoreEntry *fse) // add each FOLDER from the list foreach(FileStoreEntry *p, fse->children) { - // directories only - if (dironly && !p->isDir) continue; - QTreeWidgetItem *item = new QTreeWidgetItem(files); + // if only directories disable files for selection (but show for context) + if (dironly && !p->isDir) item->setFlags(item->flags() & ~(Qt::ItemIsSelectable|Qt::ItemIsEnabled)); + // name item->setText(0, p->name);