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 | |
parent | a80fe1e9dc3a16d9c41d40065768315237b8091f (diff) | |
download | BeetPlayer-c59d7c772634e0095bb8c235c3f88801d2728b3f.tar.gz BeetPlayer-c59d7c772634e0095bb8c235c3f88801d2728b3f.tar.bz2 BeetPlayer-c59d7c772634e0095bb8c235c3f88801d2728b3f.zip |
Implement navigating Folders again
-rw-r--r-- | collectionfoldersview.cpp | 12 | ||||
-rw-r--r-- | collectionfoldersview.h | 1 |
2 files changed, 13 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(); +} diff --git a/collectionfoldersview.h b/collectionfoldersview.h index a84b4cc..dae87cf 100644 --- a/collectionfoldersview.h +++ b/collectionfoldersview.h @@ -11,6 +11,7 @@ class CollectionFoldersView : public CollectionWidget { public slots: virtual void populate(); virtual void readSettings(); + void itemDoubleCliced(const QModelIndex &idx); private: QString mCurrentFolder; |