}
+void FileList::toggleShowHiddenFiles() {
+ clearSelection();
+ scrollToTop();
+ fileSystemModel->setFilter(fileSystemModel->filter() ^ QDir::Hidden);
+}
+
+
void FileList::activateItem(QModelIndex index) {
const QFileInfo &file = fileSystemModel->fileInfo(index);
if(file.isDir()) {
changePath(file.absoluteFilePath());
+ // hack: we reset it to MultiSelection again in the mousePressEvent
+ // without this, the item under the cursor gets selected right after changing the directory
+ setSelectionMode(QAbstractItemView::NoSelection);
} else if(file.isExecutable()) {
QProcess::startDetached(file.absoluteFilePath());
} else {
void FileList::mousePressEvent(QMouseEvent *event) {
emit mousePressed();
QListView::mousePressEvent(event);
+ // need to reset the selection mode in case it was set to NoSelection in activateItem(...)
+ setSelectionMode(QAbstractItemView::MultiSelection);
}