KZip::openArchive: Don't assert when opening broken files
ClosedPublic

Authored by aacid on Jul 27 2019, 4:06 PM.

Details

Summary

It's not nice bringing down the application just because the user opens a broken file

Diff Detail

Repository
R243 KArchive
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14473
Build 14491: arc lint + arc unit
aacid created this revision.Jul 27 2019, 4:06 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 27 2019, 4:06 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
aacid requested review of this revision.Jul 27 2019, 4:06 PM
dfaure accepted this revision.Jul 27 2019, 4:52 PM

I wonder if the end users needs all those technical details.
Maybe we should qWarning the technical details, and setErrorString(tr("Invalid ZIP file"))?

This revision is now accepted and ready to land.Jul 27 2019, 4:52 PM
aacid added a comment.Jul 27 2019, 8:00 PM

I can do that if you prefer but if you look the setErrorString just 8 lines above it's also mega "technical". Want me to change that one too?

aacid closed this revision.Jul 27 2019, 8:17 PM

Yes, I mean all of them.

aacid added a comment.Jul 28 2019, 8:05 PM

Yes, I mean all of them.

I think it can useful to have such "technical" error messages, obviously not something you'd show the user directly, but maybe in an "advanced" button of the UI.

I disagree. Those errors are for developers, and should therefore be in English (and in qWarning), rather than translated and shown to the user.
A bug report with "Could not seek to file compressed size" translated to Russian or Chinese isn't going to be very useful to most developers, and isn't useful to the user either (compared to tr("Invalid file")).
But this is unrelated to your patch, of course, it's a more fundamental change for this library.

aacid added a comment.Jul 29 2019, 4:55 PM

Ok, if you think so, you're the maintainer after all. But since you seem to have a clear idea of how the error messages should look like, maybe we can do it the other way around, you do the patch and i review it?