Disable adding files to existing password-protected non-header-encrypted archives
ClosedPublic

Authored by rthomsen on Jul 17 2016, 4:20 PM.

Details

Summary

We have no way to know the password after opening a non-he pwd-protected archive. If adding files, the new files will be unencrypted with no warning to the user.

This diff disables adding files to such an archive and shows a KMessageBox if the user tries to add files.

Test Plan

Open an existing pwd-protected non-he archive and activate the Add Files action.

Diff Detail

Repository
R36 Ark
Lint
Lint Skipped
Unit
Unit Tests Skipped
rthomsen updated this revision to Diff 5241.Jul 17 2016, 4:20 PM
rthomsen retitled this revision from to Disable adding files to existing password-protected non-header-encrypted archives.
rthomsen updated this object.
rthomsen edited the test plan for this revision. (Show Details)
rthomsen added a reviewer: elvisangelaccio.
rthomsen set the repository for this revision to R36 Ark.
rthomsen added a project: Ark.
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptJul 17 2016, 4:20 PM

I'm not entirely convinced by this approach. What about disabling the action and explaining the reason in a tooltip?

Rationale: if the user sees the action is enabled, s/he expect something to happen when clicking on it. When instead a messagebox appears, s/he gets frustated because of the unexpected failure (and might not even read the error text).

rthomsen updated this revision to Diff 5284.Jul 18 2016, 5:09 PM
rthomsen edited edge metadata.

Instead of showing a KMessageBox, we disable the "Add Files" action and provide an explanation in the tooltip.

elvisangelaccio requested changes to this revision.Jul 18 2016, 9:27 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
part/part.cpp
420 ↗(On Diff #5284)

const bool

425 ↗(On Diff #5284)

Use xi18nc, which will nicely split this long sentence across multiple lines. You can even re-add the "workaround" sentence ("Extract the files and...").

This revision now requires changes to proceed.Jul 18 2016, 9:27 PM
rthomsen updated this revision to Diff 5317.Jul 19 2016, 4:01 PM
rthomsen edited edge metadata.

Implement Elvis' suggestions.

rthomsen marked 2 inline comments as done.Jul 19 2016, 4:01 PM
elvisangelaccio accepted this revision.Jul 19 2016, 4:42 PM
elvisangelaccio edited edge metadata.
This revision is now accepted and ready to land.Jul 19 2016, 4:42 PM

I just realized that the user can still add files using the drag-and-drop...