diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 246fccc1..bf897ad9 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -1607,13 +1607,14 @@ void LibraryWindow::deleteSelectedReadingList() QModelIndexList selectedLists = listsView->selectionModel()->selectedIndexes(); if(!selectedLists.isEmpty()) { - QModelIndex mi = selectedLists.at(0); + QModelIndex mi = listsModelProxy->mapToSource(selectedLists.at(0)); if(listsModel->isEditable(mi)) { int ret = QMessageBox::question(this,tr("Delete list/label"),tr("The selected item will be deleted, your comics or folders will NOT be deleted from your disk. Are you sure?"),QMessageBox::Yes,QMessageBox::No); if(ret == QMessageBox::Yes) { listsModel->deleteItem(mi); + navigationController->reselectCurrentList(); } } } diff --git a/YACReaderLibrary/yacreader_navigation_controller.cpp b/YACReaderLibrary/yacreader_navigation_controller.cpp index 3186d391..b2be7085 100644 --- a/YACReaderLibrary/yacreader_navigation_controller.cpp +++ b/YACReaderLibrary/yacreader_navigation_controller.cpp @@ -152,6 +152,11 @@ void YACReaderNavigationController::selectedList(const QModelIndex &mi) libraryWindow->foldersView->clearSelection(); } +void YACReaderNavigationController::reselectCurrentList() +{ + selectedList(libraryWindow->listsView->currentIndex()); +} + void YACReaderNavigationController::selectedIndexFromHistory(const QModelIndex &sourceMI) { //TODO NO searching allowed, just disable backward/forward actions in searching mode diff --git a/YACReaderLibrary/yacreader_navigation_controller.h b/YACReaderLibrary/yacreader_navigation_controller.h index aa78b327..2ee848df 100644 --- a/YACReaderLibrary/yacreader_navigation_controller.h +++ b/YACReaderLibrary/yacreader_navigation_controller.h @@ -21,6 +21,7 @@ public slots: void reselectCurrentFolder(); //reading lists void selectedList(const QModelIndex & mi); + void reselectCurrentList(); //history navigation void selectedIndexFromHistory(const QModelIndex & mi); //empty subfolder