mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 22:44:56 -04:00
fixed deleting list
This commit is contained in:
@ -1607,13 +1607,14 @@ void LibraryWindow::deleteSelectedReadingList()
|
|||||||
QModelIndexList selectedLists = listsView->selectionModel()->selectedIndexes();
|
QModelIndexList selectedLists = listsView->selectionModel()->selectedIndexes();
|
||||||
if(!selectedLists.isEmpty())
|
if(!selectedLists.isEmpty())
|
||||||
{
|
{
|
||||||
QModelIndex mi = selectedLists.at(0);
|
QModelIndex mi = listsModelProxy->mapToSource(selectedLists.at(0));
|
||||||
if(listsModel->isEditable(mi))
|
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);
|
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)
|
if(ret == QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
listsModel->deleteItem(mi);
|
listsModel->deleteItem(mi);
|
||||||
|
navigationController->reselectCurrentList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,6 +152,11 @@ void YACReaderNavigationController::selectedList(const QModelIndex &mi)
|
|||||||
libraryWindow->foldersView->clearSelection();
|
libraryWindow->foldersView->clearSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void YACReaderNavigationController::reselectCurrentList()
|
||||||
|
{
|
||||||
|
selectedList(libraryWindow->listsView->currentIndex());
|
||||||
|
}
|
||||||
|
|
||||||
void YACReaderNavigationController::selectedIndexFromHistory(const QModelIndex &sourceMI)
|
void YACReaderNavigationController::selectedIndexFromHistory(const QModelIndex &sourceMI)
|
||||||
{
|
{
|
||||||
//TODO NO searching allowed, just disable backward/forward actions in searching mode
|
//TODO NO searching allowed, just disable backward/forward actions in searching mode
|
||||||
|
@ -21,6 +21,7 @@ public slots:
|
|||||||
void reselectCurrentFolder();
|
void reselectCurrentFolder();
|
||||||
//reading lists
|
//reading lists
|
||||||
void selectedList(const QModelIndex & mi);
|
void selectedList(const QModelIndex & mi);
|
||||||
|
void reselectCurrentList();
|
||||||
//history navigation
|
//history navigation
|
||||||
void selectedIndexFromHistory(const QModelIndex & mi);
|
void selectedIndexFromHistory(const QModelIndex & mi);
|
||||||
//empty subfolder
|
//empty subfolder
|
||||||
|
Reference in New Issue
Block a user