| 543 | } |
| 544 | |
| 545 | void PDFDocumentWindow::loadSyncData() |
| 546 | { |
| 547 | _synchronizer = std::unique_ptr<TWSyncTeXSynchronizer>(new TWSyncTeXSynchronizer(curFile, [](const QString & filename) { |
| 548 | const TeXDocumentWindow * win = TeXDocumentWindow::openDocument(filename, false, false); |
| 549 | return (win ? win->textDoc() : nullptr); |
| 550 | }, [](const QString & filename) { |
| 551 | PDFDocumentWindow * pdfWin = PDFDocumentWindow::findDocument(filename); |
| 552 | return (pdfWin && pdfWin->widget() ? pdfWin->widget()->document().toStrongRef() : QSharedPointer<QtPDF::Backend::Document>()); |
| 553 | } |
| 554 | )); |
| 555 | if (!_synchronizer) |
| 556 | statusBar()->showMessage(tr("Error initializing SyncTeX"), kStatusMessageDuration); |
| 557 | else if (!_synchronizer->isValid()) |
| 558 | statusBar()->showMessage(tr("No SyncTeX data available"), kStatusMessageDuration); |
| 559 | else |
| 560 | statusBar()->showMessage(tr("SyncTeX: \"%1\"").arg(_synchronizer->syncTeXFilename()), kStatusMessageDuration); |
| 561 | } |
| 562 | |
| 563 | void PDFDocumentWindow::syncClick(size_type pageIndex, const QPointF& pos) |
| 564 | { |
nothing calls this directly
no test coverage detected