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

Method setCurrentComicIfNeeded

YACReaderLibrary/grid_comics_view.cpp:377–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377void GridComicsView::setCurrentComicIfNeeded()
378{
379 if (model == nullptr) {
380 return;
381 }
382
383 bool found;
384 currentComic = currentComicFromModel(model, found);
385
386 QQmlContext *ctxt = view->rootContext();
387
388 ComicModel::Mode mode = model->getMode();
389
390 bool showCurrentComic = found &&
391 filterEnabled == false &&
392 (mode == ComicModel::Mode::Folder || mode == ComicModel::Mode::ReadingList) &&
393 settings->value(DISPLAY_CONTINUE_READING_IN_GRID_VIEW, true).toBool();
394
395 ctxt->setContextProperty("currentComic", &currentComic);
396 ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
397 ctxt->setContextProperty("showCurrentComic", QVariant(showCurrentComic));
398}
399
400void GridComicsView::resetScroll()
401{

Callers

nothing calls this directly

Calls 2

currentComicFromModelFunction · 0.85
getModeMethod · 0.80

Tested by

no test coverage detected