[Differential] [Request, 85 lines] D408: Improve error handling when loading plugins

rthomsen (Ragnar Thomsen) noreply at phabricator.kde.org
Tue Oct 13 17:44:53 UTC 2015


rthomsen created this revision.
rthomsen added a reviewer: elvisangelaccio.
rthomsen set the repository for this revision to rARK Ark.
rthomsen added a project: Ark.
Herald added a subscriber: kde-utils-devel.

REVISION SUMMARY
  Previously, if Archive::create() failed to load a plugin, a QInputDialog was shown where the user could choose the mime-type of the archive. This was not suitable anymore, since mime-type detection is much better now and because we try all registered plugins for a mimetype.
  
  New behavior: When a plugin fails to load, two different error messages can be shown:
  1) No suitable plugin was found.
  2) All suitable plugins failed to load.
  Because we (potentially) try to load different plugins, which can fail for different reasons (missing executables, broken plugin, etc.), error message 2 can not be made more specific.
  
  This was implemented by adding an alternative constructor for Archive which takes an error code. Part::openFile() then checks if an error message is found before continuing to load the interface, and displays the error messages.

TEST PLAN
  1) Try to open an unsupported mimetype with Ark, e.g. a text file. Error message 1 is displayed.
  2) Rename e.g. unrar binary so rar plugin fails to load, then use Ark to open a rar archive or create a new rar archive. Error message 2 is displayed.

REPOSITORY
  rARK Ark

REVISION DETAIL
  https://phabricator.kde.org/D408

AFFECTED FILES
  kerfuffle/archive_kerfuffle.cpp
  kerfuffle/archive_kerfuffle.h
  part/part.cpp

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: rthomsen, elvisangelaccio
Cc: kde-utils-devel


More information about the Kde-utils-devel mailing list