mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 06:24:39 -04:00
fixed deleting list
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user