diff options
author | Arno <arno@disconnect.de> | 2018-02-18 09:03:17 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-02-18 09:03:17 +0100 |
commit | c59d7c772634e0095bb8c235c3f88801d2728b3f (patch) | |
tree | 55465b496fb819faa960b0dd61ce32fe52e1e972 /collectionfoldersview.cpp | |
parent | a80fe1e9dc3a16d9c41d40065768315237b8091f (diff) | |
download | BeetPlayer-c59d7c772634e0095bb8c235c3f88801d2728b3f.tar.gz BeetPlayer-c59d7c772634e0095bb8c235c3f88801d2728b3f.tar.bz2 BeetPlayer-c59d7c772634e0095bb8c235c3f88801d2728b3f.zip |
Implement navigating Folders again
Diffstat (limited to 'collectionfoldersview.cpp')
-rw-r--r-- | collectionfoldersview.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/collectionfoldersview.cpp b/collectionfoldersview.cpp index cd8765f..2dfb32f 100644 --- a/collectionfoldersview.cpp +++ b/collectionfoldersview.cpp @@ -9,6 +9,7 @@ CollectionFoldersView::CollectionFoldersView(QWidget *parent) : CollectionWidget(parent){ readSettings(); + connect(view(), &BeetView::doubleClicked, this, &CollectionFoldersView::itemDoubleCliced); } void CollectionFoldersView::populate(){ @@ -59,3 +60,14 @@ void CollectionFoldersView::readSettings(){ QSettings s; mCurrentFolder = s.value("folderdir", QDir::homePath()).toString(); } + +void CollectionFoldersView::itemDoubleCliced(const QModelIndex &idx){ + QDir d(mCurrentFolder); + if(idx.data().toString() == ".."){ + d.cdUp(); + }else{ + d.cd(idx.data().toString()); + } + mCurrentFolder = d.absolutePath(); + populate(); +} |