[Differential] [Request, 234 lines] D1510: Don't block the main thread while running CliInterface jobs

elvisangelaccio (Elvis Angelaccio) noreply at phabricator.kde.org
Fri Apr 29 16:48:49 UTC 2016


elvisangelaccio created this revision.
elvisangelaccio added a reviewer: rthomsen.
Restricted Application added a subscriber: kde-utils-devel.
Restricted Application added a project: Ark.

REVISION SUMMARY
  Currently we freeze the GUI thread while running CliInterface jobs, because
  there is a nested event loop in runProcess(), which doesn't run anymore in a
  separate thread.
  
  This is of course bad and for example is currently impossible to close Ark
  while loading a huge zip file.
  
  We can simply drop this event loop and rework the CliInterface logic, such that
  the emit signal is not emitted anymore when runProcess() returns, but
  in processFinished() instead.
  
  This exposed another set of issues:
  
  1. Ark crashed if closing the UI during a running Job, because 'result' is
  
  emitted and the UI thinks the job succeeded. This is fixed by calling
  disconnect() in Job::doKill(), but a better solution should be found (in the
  meantime, we can definitely close bug #222392).
  I'm not sure why this doesn't happen on 16.04, probably because of the separate
  thread.
  
  2. Ark crashes if canceling the password dialog with header-encrypted archives.
  
  I'm working on a separate patch to fix this.

TEST PLAN
  Close Ark while loading a huge zip. Ark does neither freeze nor crash.

REPOSITORY
  rARK Ark

BRANCH
  cliinterface-cleanup

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

AFFECTED FILES
  kerfuffle/archiveinterface.h
  kerfuffle/cliinterface.cpp
  kerfuffle/cliinterface.h
  kerfuffle/jobs.cpp
  part/jobtracker.cpp
  plugins/cliunarchiverplugin/cliplugin.cpp

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

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


More information about the Kde-utils-devel mailing list