Repository navigation
Keep the previous and next comic actions after a file fails to open - #630
Merged
luisangelsm merged 3 commits intoNov 6, 2026
Merged
luisangelsm merged 3 commits into
luisangelsm merged 3 commits into
Conversation
wonjoonSeol
added a commit
to wonjoonSeol/yacreader
that referenced
this pull request
Oct 25, 2026
Thirteen changes, with a Kind column of Option, Feature or Bug fix and an App column, since rating spans both apps and folder comics are a library change. The PR column says which PRs are closed previews, open, drafts or upstream, and links the two bug fixes' upstream PRs (YACReader#629, YACReader#630). Bicubic and Lanczos3/Lanczos2 become one Scaling methods section with one measurement table, from the numbers in both branches' READMEs. Adds short sections for the background scaling (from PR #13) and the clipped status message fix, makes the menu's scaling row match the six methods, and notes that each change's screenshots come from its own branch.
When a comic opened from the file system could not be read, the reset that follows the error disabled the previous and next comic actions, so the shortcuts could not move on to the neighbouring files. The reset now updates those actions the same way the double manga page switch does.
The previous commit moved the body of doubleMangaPageSwitch into a new updatePrevNextActions() overload and left doubleMangaPageSwitch only forwarding to it. That overload shares its name with updatePrevNextActions(bool, bool) but works the state out instead of applying it. Since doubleMangaPageSwitch never did more than this, the two become one function, refreshPrevNextActions, in the place doubleMangaPageSwitch had, and every caller uses it.
…ssing Opening a recent file that no longer exists also resets the viewer, and the reset now sets the actions from the neighbours of the comic that was open before, while no comic is shown. Forgetting those neighbours first keeps the actions disabled there, as before, for comics not opened from the library. For comics opened from the library the reset works the actions out from the sibling list, so nothing changes there.
luisangelsm
force-pushed
the
fix/prev-next-after-unreadable-comic
branch
from
November 6, 2026 14:03
129cebe to
be3ba43
Compare
Member
|
Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #626.
Problem
When a comic opened from the file system can't be read, the error is shown and after that the previous and next comic shortcuts (default Ctrl+Left/Right, shortcuts_manager.cpp#L41-L42) do nothing, so the reader can't move on to the next file in the folder.
Screenshots
Linux build run offscreen with generated sample pages, taken on my fork, which carries the first commit of this PR. "Upstream" runs the same steps on
developat 268288b.A folder with
Comic 1.pdf, an unreadableComic 2.cbzandComic 3.pdf. Going from Comic 1 to the next comic shows:After closing the error:
With this PR, the next comic action (Ctrl+Right) then opens Comic 3:
Cause
A failed open resets the viewer, and the reset ends in
MainWindowViewer::processReset:Render::errorOpening()is connected toViewer::resetContent(viewer.cpp#L289).Render::errorOpening(QString), which carries "Format not supported" (comic.cpp#L610, #L626), goes toViewer::showMessageErrorOpening(QString)(viewer.cpp#L291), which callsresetContentafter the message (viewer.cpp#L379).resetContentemitsreset(viewer.cpp#L1821), which is connected toprocessReset(main_window_viewer.cpp#L248). For comics not opened from the library,processResetalways disables the previous and next comic actions (main_window_viewer.cpp#L1340-L1345), although the neighbouring files were already found when the comic was opened (openComiccallsgetSiblingComics, #L1023 and #L1685-L1692).Change
processResetnow sets the previous and next comic actions from the neighbouring comics, with the codeMainWindowViewer::doubleMangaPageSwitchalready had (main_window_viewer.cpp#L1522-L1530). That function only works out those two actions, so it is renamed torefreshPrevNextActionsand its two callers use the new name (#L183, #L519). For comics opened from the library the reset now works the actions out from the sibling list, the same wayopendoes (#L971-L972), instead of leaving them as they were. The offscreen run below gives the same result as upstream there.processResetis opening a recent file that no longer exists (main_window_viewer.cpp#L920-L923). There the neighbours still belong to the comic that was open before, while the view shows "Press 'O' to open comic.", so the PR clearspreviousComicPathandnextComicPathfirst and the actions stay disabled as before. In library mode this path behaves as before.Relation to #614
#614 replaces
siblingComics.indexOf(currentComicDB)indoubleMangaPageSwitchwithcurrentSiblingIndex, and this PR renames that function. The two don't conflict:git merge-treeof this branch with #614's head (e0711b3) merges cleanly, andrefreshPrevNextActionskeeps thecurrentSiblingIndexversion. If #614 lands first and you'd rather have this rebased onto it, I'm happy to do that.Testing
-DPDF_BACKEND=poppler).build.ymlplus one line addingworkflow_dispatchso it can be started by hand: run 40144752327. Every job passed: Code Format Validation, Linux (Qt6 + libarchive), Linux (Qt6 + 7zip), macOS (Qt6 Universal), Windows x64 (Qt6), Windows ARM64 (Qt6), Docker amd64 and arm64 images, and Source Tarball. The Linux, macOS and Windows x64 jobs also runctest.tests/sets upMainWindowViewer.MainWindowViewerand reads both actions and their toolbar buttons. The folder holdsComic 1.pdf, an unreadableComic 2.cbz,Comic 3.pdf,Comic 4.pdfand an unreadableComic 5.cbz. "Upstream" is the same run ondevelopat 268288b.Comic 5.cbzis the last file and fails)[Comic 2.cbz, Comic 4.pdf],Comic 2.cbzfailsThe library rows set
isClientand the sibling list directly in the harness, since the real path needs YACReaderLibrary running. The folder neighbours left over from the earlier rows give both directions there, so these rows show that the reset reads the library list. Two mutations fail the run as expected: reading the folder neighbours in library mode breaks the library rows, and dropping the line that clears the paths inopenComicFromRecentActionbreaks the deleted recent file row.Manual checks still to do:
.cbzbetween two good comics in a folder: open the first, Ctrl+Right, close the error, Ctrl+Right opens the third.