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

Method process

common/comic.cpp:560–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560void FileComic::process()
561{
562 CompressedArchive archive(_path);
563 if (!archive.toolsLoaded()) {
564 moveToThread(QCoreApplication::instance()->thread());
565 emit errorOpening(tr("7z not found"));
566 return;
567 }
568
569 if (!archive.isValid()) {
570 moveToThread(QCoreApplication::instance()->thread());
571 emit errorOpening(tr("Format not supported"));
572 return;
573 }
574
575 // se filtran para obtener s�lo los formatos soportados
576 _order = archive.getFileNames();
577 _fileNames = filter(_order);
578
579 if (_fileNames.size() == 0) {
580 // QMessageBox::critical(NULL,tr("File error"),tr("File not found or not images in file"));
581 moveToThread(QCoreApplication::instance()->thread());
582 emit errorOpening();
583 return;
584 }
585
586 // TODO, cambiar por listas
587 //_order = _fileNames;
588
589 _pages.resize(_fileNames.size());
590 _loadedPages = QVector<bool>(_fileNames.size(), false);
591
592 emit pageChanged(0); // this indicates new comic, index=0
593 emit numPages(_pages.size());
594 _loaded = true;
595
596 _cfi = 0;
597
598 // TODO, add a setting for choosing the type of page sorting used.
599 comic_pages_sort(_fileNames, YACReaderHeuristicSorting);
600
601 if (_firstPage == -1) {
602 _firstPage = bm->getLastPage();
603 }
604
605 if (_firstPage >= _pages.length()) {
606 _firstPage = 0;
607 }
608
609 _index = _firstPage;
610 emit openAt(_index);
611
612 int sectionIndex;
613 QList<QVector<quint32>> sections = getSections(sectionIndex);
614
615 for (int i = sectionIndex; i < sections.count(); i++) {
616 if (_invalidated) {
617 moveToThread(QCoreApplication::instance()->thread());

Callers

nothing calls this directly

Calls 12

comic_pages_sortFunction · 0.85
loadFunction · 0.85
getLastPageMethod · 0.80
setFilterMethod · 0.80
toolsLoadedMethod · 0.45
isValidMethod · 0.45
getFileNamesMethod · 0.45
getAllDataMethod · 0.45
clearMethod · 0.45
openMethod · 0.45
openComicMethod · 0.45
numPagesMethod · 0.45

Tested by

no test coverage detected