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

Method updateInfoForIndex

YACReaderLibrary/comics_view.cpp:54–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void ComicsView::updateInfoForIndex(int index)
55{
56 QQmlContext *ctxt = view->rootContext();
57
58 if (comicDB != nullptr)
59 delete comicDB;
60
61 if ((index < 0) || (index >= model->rowCount())) {
62 ctxt->setContextProperty("comic", nullptr);
63 ctxt->setContextProperty("comicInfo", nullptr);
64 ctxt->setContextProperty("comic_info_index", -1);
65 return;
66 }
67
68 comicDB = new ComicDB(model->getComic(this->model->index(index, 0)));
69 ComicInfo *comicInfo = &(comicDB->info);
70 comicInfo->isFavorite = model->isFavorite(model->index(index, 0));
71
72 ctxt->setContextProperty("comic", comicDB);
73 ctxt->setContextProperty("comicInfo", comicInfo);
74
75 ctxt->setContextProperty("comic_info_index", index);
76}
77
78void ComicsView::dragEnterEvent(QDragEnterEvent *event)
79{

Callers

nothing calls this directly

Calls 4

getComicMethod · 0.80
isFavoriteMethod · 0.80
rowCountMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected