From 2c022561f692a813b44da39d6ffdcb373aa4c7ba Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 10 Dec 2014 22:10:50 +0100 Subject: Various Bugfixes and cleanups * remove debug statements from SmDirWatcher * Don't crash on parentDir when current Dir is already deleted * Fix PicFilesModel MappingQuery. It needlessly referenced the table pics in FROM causing an expensive full table scan! * Fix findRecursive in PicFilesModel: Stupid typo! * Give SmDirWatcher a separate DB-Connection. One Thread, one Connection * Remove several includes This should have been 6 commits, but that's how debugging works :( --- filesystemwidget.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'filesystemwidget.cpp') diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp index 779db2e..60c2d78 100644 --- a/filesystemwidget.cpp +++ b/filesystemwidget.cpp @@ -227,11 +227,18 @@ void FilesystemWidget::fileViewActivated(const QModelIndex &idx){ void FilesystemWidget::parentDir(){ QModelIndex idx = mDirView->currentIndex(); + QModelIndex prev = idx.sibling(idx.row() - 1, idx.column()); + QString pName; + if(prev.isValid()){ + pName = idx.data().toString(); + } + QString sel = idx.data().toString(); if(idx.parent().isValid()){ mDirView->setCurrentIndex(idx.parent()); - } - QString sel = idx.data().toString(); - emit upSelected(sel); + } + if(!pName.isEmpty()){ + emit upSelected(sel); + } } void FilesystemWidget::goBack(){ -- cgit v1.2.3-70-g09d2