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

Method addNewReadingList

YACReaderLibrary/library_window.cpp:1256–1276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1254}
1255
1256void LibraryWindow::addNewReadingList()
1257{
1258 QModelIndexList selectedLists = listsView->selectionModel()->selectedIndexes();
1259 QModelIndex sourceMI;
1260 if (!selectedLists.isEmpty())
1261 sourceMI = listsModelProxy->mapToSource(selectedLists.at(0));
1262
1263 if (selectedLists.isEmpty() || !listsModel->isReadingSubList(sourceMI)) {
1264 bool ok;
1265 QString newListName = QInputDialog::getText(this, tr("Add new reading lists"),
1266 tr("List name:"), QLineEdit::Normal,
1267 "", &ok);
1268 if (ok) {
1269 if (selectedLists.isEmpty() || !listsModel->isReadingList(sourceMI))
1270 listsModel->addReadingList(newListName); // top level
1271 else {
1272 listsModel->addReadingListAt(newListName, sourceMI); // sublist
1273 }
1274 }
1275 }
1276}
1277
1278void LibraryWindow::deleteSelectedReadingList()
1279{

Callers

nothing calls this directly

Calls 7

selectedIndexesMethod · 0.80
isEmptyMethod · 0.80
isReadingSubListMethod · 0.80
isReadingListMethod · 0.80
addReadingListMethod · 0.80
addReadingListAtMethod · 0.80
selectionModelMethod · 0.45

Tested by

no test coverage detected