From 730c5c5e1c3ee1912af717bc21eec9dd65413e91 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 18 Feb 2015 09:43:34 -0500 Subject: Ok, *now* the file manager makes sure the slideshow viewer does not change the current item when re-loading the files in the directory (caused issues when remvoing files from within the slideshow viewer). --- lumina-fm/MainUI.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'lumina-fm/MainUI.cpp') diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index f4f85f80..7a10d41e 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -474,8 +474,12 @@ void MainUI::AvailableBackups(QString basedir, QStringList snapdirs){ void MainUI::AvailablePictures(QStringList pics){ if(!pics.isEmpty()){ + QString citem = ui->combo_image_name->currentText(); ui->combo_image_name->clear(); ui->combo_image_name->addItems(pics); + if(pics.contains(citem)){ + ui->combo_image_name->setCurrentText(citem); + } ui->tool_goToImages->setVisible(true); } @@ -917,14 +921,14 @@ void MainUI::removePicture(){ file.append(ui->combo_image_name->currentText()); if( QFile::remove(file) ){ int index = ui->combo_image_name->currentIndex(); + int newindex = index; + newindex--; ui->combo_image_name->removeItem( index ); - if(ui->combo_image_name->count() > index){} //re-use the same index (go to the next picture) - else if(ui->combo_image_name->count() > 0 ){ index = ui->combo_image_name->count()-1; } // go to the previous picture (last one in the list) - else{ index = -1; } - if(index>=0){ - ui->combo_image_name->setCurrentIndex(index); - } - showNewPicture(); + //showNewPicture(); + //Move to the new index before removing the old one + /*if(newindex>=0){ + ui->combo_image_name->setCurrentIndex(newindex); + }*/ } } -- cgit