Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A progress signal is being emitted for file extracted or filtered making both cases non distinguishable #56

Open
1 of 4 tasks
theLSB opened this issue Oct 27, 2022 · 2 comments

Comments

@theLSB
Copy link

theLSB commented Oct 27, 2022

Select your issue type: (check at least one)

  • Bug
  • Question
  • Suggestion
  • Other (please describe):

Describe your issue:
When applying a filter for extraction, QArchive still emits a progress signal for the filtered files (filtered out that is, the files that should not be extracted), which is not distinguishable from extracted files.
The reason is that ExtractorPrivate::writeData() retuns "NoError" both for an extracted file and a filtered file, resulting in the same behavior in ExtractorPrivate::extract().
Adding a new Error enum (NoErrorFiltered) and then emitting the progress signal with '-1' for 'entries' allows the slot to distinguish between a filtered file progress and an extracted one.
There might be a better way, but this one seems to work for me at least.
All tests are passing (but I only tested wish 5.15.2).
Attached is a patch. (interesting that GitHub does not support patch files...)

Ways to Reproduce the issue (optional):
NoErrorFiltered.zip

@theLSB theLSB changed the title No distinguishable progress signal is being emitted for file exacted or filtered A progress signal is being emitted for file exacted or filtered making both cases non distinguishable Oct 27, 2022
@theLSB theLSB changed the title A progress signal is being emitted for file exacted or filtered making both cases non distinguishable A progress signal is being emitted for file extracted or filtered making both cases non distinguishable Oct 27, 2022
@theLSB
Copy link
Author

theLSB commented Dec 9, 2022

I have made this a bug, since extraction progress notifies for the extracted files, if it also notifies for filtered files as if they are extracted when they are not, that is a wrong behavior, and thus a bug.

@antony-jr antony-jr added bug and removed enhancement labels Dec 9, 2022
@antony-jr
Copy link
Owner

@theLSB I think we can have a boolean at the end of the progress signal which is true when it's skipped or filtered. is that fine for you? This way we don't break any public API just to be safe. Also when we emit with entries -1 for filtered files, it might be confusing for some developers (ex: when they directly hook this to a progress bar, the behavior would be super weird don't you think?)

@antony-jr antony-jr added enhancement and removed bug labels Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants