diff options
Diffstat (limited to 'lumina-fm')
-rw-r--r-- | lumina-fm/widgets/DirWidget.cpp | 20 | ||||
-rw-r--r-- | lumina-fm/widgets/DirWidget.h | 3 |
2 files changed, 22 insertions, 1 deletions
diff --git a/lumina-fm/widgets/DirWidget.cpp b/lumina-fm/widgets/DirWidget.cpp index b4a6ca78..14e7820c 100644 --- a/lumina-fm/widgets/DirWidget.cpp +++ b/lumina-fm/widgets/DirWidget.cpp @@ -217,11 +217,14 @@ void DirWidget::LoadDir(QString dir, QList<LFileInfo> list){ } if(DEBUG){ qDebug() << "Update History:" <<time.elapsed(); } //Now update the history for this browser + //qDebug() << "History:" << history << normalbasedir << lastbasedir; if(!history.isEmpty() && history.last() == normalbasedir && lastbasedir!=normalbasedir ){ //We went back one - remove this from the history history.takeLast(); ui->actionBack->setEnabled(!history.isEmpty()); + //qDebug() << " - Duplicate: removed item"; }else if(lastbasedir!=normalbasedir){ //not a refresh or internal snapshot change + //qDebug() << " - New History Item:" << normalbasedir; history << normalbasedir; ui->actionBack->setEnabled(history.length()>1); } @@ -710,8 +713,9 @@ void DirWidget::on_slider_snap_valueChanged(int val){ void DirWidget::on_actionBack_triggered(){ if(history.isEmpty()){ return; } //cannot do anything QString dir = history.takeLast(); + //qDebug() << "Go Back:" << dir << normalbasedir << history.last(); if(dir == normalbasedir){ - dir = history.last(); + dir = history.takeLast(); } stopload = true; //just in case it is still loading emit LoadDirectory(ID, dir); @@ -846,4 +850,18 @@ void DirWidget::SelectionChanged(){ void DirWidget::startSync(){ if(synctimer->isActive()){ synctimer->stop(); } synctimer->start(); +} + +//==================== +// PROTECTED +//==================== +void DirWidget::mouseReleaseEvent(QMouseEvent *ev){ + if(ev->button()==Qt::BackButton){ + ev->accept(); + on_actionBack_triggered(); + //}else if(ev->button()==Qt::ForwardButton()){ + //ev->accept(); + }else{ + ev->ignore(); //not handled here + } }
\ No newline at end of file diff --git a/lumina-fm/widgets/DirWidget.h b/lumina-fm/widgets/DirWidget.h index 55e6f8d1..a7fe3cc3 100644 --- a/lumina-fm/widgets/DirWidget.h +++ b/lumina-fm/widgets/DirWidget.h @@ -152,5 +152,8 @@ signals: void RenameFiles(QStringList); //file selection void RemoveFiles(QStringList); //file selection +protected: + void mouseReleaseEvent(QMouseEvent *); + }; #endif
\ No newline at end of file |