| 952 | } |
| 953 | |
| 954 | void PDFDocumentView::searchProgressValueChanged(PDFSearcher::size_type progressValue) |
| 955 | { |
| 956 | // Inform the rest of the world of our progress (in %, and how many |
| 957 | // occurrences were found so far) |
| 958 | // NOTE: the searchProgressValueChanged slot is not necessarily synchronized |
| 959 | // with the searchResultReady slot. I.e., it can happen that |
| 960 | // searchProgressValueChanged reports 100% with 0 search results (before |
| 961 | // searchResultReady is called for the first time). Thus, searchResultReady |
| 962 | // is also set up to emit searchProgressChanged. In summary, |
| 963 | // searchProgressValueChanged is intended primarily for informing the user |
| 964 | // of the progress when no matches are found, whereas searchResultReady is |
| 965 | // primarily intended for informing the user of the progress when matches are |
| 966 | // found. |
| 967 | if (_searcher.progressMaximum() == _searcher.progressMinimum()) |
| 968 | emit searchProgressChanged(100, _searchResults.count()); |
| 969 | else |
| 970 | emit searchProgressChanged(static_cast<int>(100 * (progressValue - _searcher.progressMinimum()) / (_searcher.progressMaximum() - _searcher.progressMinimum())), _searchResults.count()); |
| 971 | } |
| 972 | |
| 973 | void PDFDocumentView::maybeUpdateSceneRect() { |
| 974 | if (!_pdf_scene || (_pageMode != PageMode_SinglePage && _pageMode != PageMode_Presentation)) |
nothing calls this directly
no test coverage detected