MCPcopy Create free account
hub / github.com/YACReader/yacreader / deleteComicsFromList

Method deleteComicsFromList

YACReaderLibrary/library_window.cpp:2551–2579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2549}
2550
2551void LibraryWindow::deleteComicsFromList()
2552{
2553 int ret = QMessageBox::question(this, tr("Remove comics"), tr("Comics will only be deleted from the current label/list. Are you sure?"), QMessageBox::Yes, QMessageBox::No);
2554
2555 if (ret == QMessageBox::Yes) {
2556 QModelIndexList indexList = getSelectedComics();
2557 if (indexList.isEmpty())
2558 return;
2559
2560 QModelIndex mi = listsModelProxy->mapToSource(listsView->currentIndex());
2561
2562 ReadingListModel::TypeList typeList = (ReadingListModel::TypeList)mi.data(ReadingListModel::TypeListsRole).toInt();
2563
2564 qulonglong id = mi.data(ReadingListModel::IDRole).toULongLong();
2565 switch (typeList) {
2566 case ReadingListModel::SpecialList:
2567 comicsModel->deleteComicsFromSpecialList(indexList, id);
2568 break;
2569 case ReadingListModel::Label:
2570 comicsModel->deleteComicsFromLabel(indexList, id);
2571 break;
2572 case ReadingListModel::ReadingList:
2573 comicsModel->deleteComicsFromReadingList(indexList, id);
2574 break;
2575 case ReadingListModel::Separator:
2576 break;
2577 }
2578 }
2579}
2580
2581void LibraryWindow::showFoldersContextMenu(const QPoint &point)
2582{

Callers

nothing calls this directly

Calls 6

isEmptyMethod · 0.80
currentIndexMethod · 0.45
dataMethod · 0.45
deleteComicsFromLabelMethod · 0.45

Tested by

no test coverage detected