diff options
author | Ken Moore <ken@pcbsd.org> | 2015-02-17 09:38:27 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-02-17 09:38:27 -0500 |
commit | ddcd3abc1b3779c832dc6591766f49887e2e43e9 (patch) | |
tree | 1c454e0dbc87d4a20d245e560a4786413c157075 /lumina-fm/MainUI.cpp | |
parent | Oops, fix another crash with desktop plugins: forgot to disable the synctimer... (diff) | |
download | lumina-ddcd3abc1b3779c832dc6591766f49887e2e43e9.tar.gz lumina-ddcd3abc1b3779c832dc6591766f49887e2e43e9.tar.bz2 lumina-ddcd3abc1b3779c832dc6591766f49887e2e43e9.zip |
Clean up a few things in Lumina:
1) When finding a file mimetype, try a case-insensitive filter if nothing came out of the case-sensitive search.
2) lumina-fm: when removing a slideshow file, try to automatically go to the next/previous picture instead of index=0;
3) Add a bunch more processEvents() calls to the lumina-fm file operations dialog. This should keep the UI's more responsive and update the visuals more often while running operations on large numbers of files.
4) lumina-fm: Fix another upper->lower case extension issue when checking if a file is supported by Qt's read/write operations.
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r-- | lumina-fm/MainUI.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index ffb92572..f4f85f80 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -889,7 +889,7 @@ void MainUI::showNewPicture(){ writeableformats = QImageWriter::supportedImageFormats(); qDebug() << "Writeable image formats:" << writeableformats; } - bool canwrite = writeableformats.contains(file.section(".",-1).toLocal8Bit()); //compare the suffix with the list + bool canwrite = writeableformats.contains(file.section(".",-1).toLower().toLocal8Bit()); //compare the suffix with the list ui->tool_image_remove->setEnabled(isUserWritable); ui->tool_image_rotateleft->setEnabled(isUserWritable && canwrite); ui->tool_image_rotateright->setEnabled(isUserWritable && canwrite); @@ -916,7 +916,14 @@ void MainUI::removePicture(){ if(!file.endsWith("/")){ file.append("/"); } file.append(ui->combo_image_name->currentText()); if( QFile::remove(file) ){ - ui->combo_image_name->removeItem( ui->combo_image_name->currentIndex() ); + int index = ui->combo_image_name->currentIndex(); + 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(); } } |