diff options
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r-- | lumina-fm/MainUI.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index 68764997..da970fed 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -434,9 +434,17 @@ void MainUI::setCurrentDir(QString dir){ if(radio_view_details->isChecked()){ ui->tree_dir_view->setRootIndex(fsmod->index(dir)); ui->tree_dir_view->selectionModel()->clearSelection(); + if(olddir.startsWith(rawdir)){ + ui->tree_dir_view->setCurrentIndex( fsmod->index(olddir)); + ui->tree_dir_view->scrollTo( fsmod->index(olddir)); + } }else{ ui->list_dir_view->setRootIndex(fsmod->index(dir)); ui->list_dir_view->selectionModel()->clearSelection(); + if(olddir.startsWith(rawdir)){ + ui->list_dir_view->setCurrentIndex( fsmod->index(olddir)); + ui->list_dir_view->scrollTo( fsmod->index(olddir)); + } } //Adjust the tab data tabBar->setTabWhatsThis( tabBar->currentIndex(), rawdir ); @@ -462,7 +470,7 @@ void MainUI::setCurrentDir(QString dir){ if(isUserWritable){ ui->label_dir_stats->setText(""); } else{ ui->label_dir_stats->setText(tr("Limited Access Directory")); } - + ui->tool_addToDir->setVisible(isUserWritable); ui->tool_addNewFile->setVisible(isUserWritable); ui->actionUpDir->setEnabled(dir!="/"); @@ -470,6 +478,7 @@ void MainUI::setCurrentDir(QString dir){ ui->actionBookMark->setEnabled( rawdir!=QDir::homePath() && settings->value("bookmarks", QStringList()).toStringList().filter("::::"+rawdir).length()<1 ); ItemSelectionChanged(); RebuildDeviceMenu(); //keep this refreshed + } QFileInfoList MainUI::getSelectedItems(){ |