Implement KMessageWidget to report import errors.
Needs RevisionPublic

Authored by bdevries on Fri, Nov 1, 10:50 PM.

Details

Reviewers
ngraham
Group Reviewers
Gwenview
KDE Applications
Summary

Add a KMessageWidget to report any errors that have occured during
the import:

  • Files that have failed to copy into the temporary directory.
  • Files that failed to rename/move to their final location.
  • Subfolders (as defined by FileRenameFormatter) that failed to create.

Depending on the kind of failure(s), the KMessageWidget will contain
one or two actions to show a detailed list of files and/or subfolder
failures.

Test Plan

Tested extensively with all kinds of errors:

  • set file permissions such that files cannot be copied into their final location;
  • set directory permissions such that subfolders cannot be created.

For each case observed that errors were reported correctly.
Tested that KMessageWidget stays hidden after import without errors.
Tested that previous errors have been correctly cleared when doing
a second import right after the first (without closing the program).

Diff Detail

Repository
R260 Gwenview
Branch
error-handling
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18434
Build 18452: arc lint + arc unit
bdevries created this revision.Fri, Nov 1, 10:50 PM
Restricted Application added a project: Gwenview. · View Herald TranscriptFri, Nov 1, 10:50 PM
bdevries requested review of this revision.Fri, Nov 1, 10:50 PM
ngraham added a subscriber: ngraham.Fri, Nov 8, 9:52 PM

Nice, will review soon.

ngraham requested changes to this revision.Fri, Nov 15, 5:53 PM
ngraham added a reviewer: KDE Applications.

Thanks again for the patch!

Unfortunately I don't have a device capable of importing photos using Gwenview so I'm afraid I can't test this out, so I'll have to leave that part to someone else. I've done some code review; please see the following comments:

importer/dialogpage.cpp
55

Localize this string

61

Localize this string

76

Use $1 instead of one (some languages use the singular form for numbers beyond the first)

84

Use $1 instead of one (some languages use the singular form for numbers beyond the first)

90

We don't use raw HTML like this. Instead, do it like so:

mErrorMessageWidget->setText(xi18nc("@info", message.join("<nl/>")));

See also https://api.kde.org/frameworks/ki18n/html/prg_guide.html#kuit_markup

96

Localize this string

105

Localize this string

This revision now requires changes to proceed.Fri, Nov 15, 5:53 PM