Fix progress info for CreateJob for non-CLI-plugins
AbandonedPublic

Authored by rthomsen on May 25 2019, 2:18 PM.

Details

Reviewers
elvisangelaccio
Summary

Commit ce2f7f6690be1e5165ec1300affeabd5cc146e31 fixed progress info for CreateJob for the CLI-plugins. However, it still doesn't work for libzipplugin and libarchiveplugin (see bug 402824). This seems to be caused by these plugins being run in a separate thread and the progress signal not reaching the slot in the receivers thread. This is fixed by using Qt::DirectConnection in the connect call.

Questions:

  • Is this the correct way to solve the problem?
  • Should this connection type be used for any of the other signals?
Test Plan

Create a large archive with libzipplugin and libarchiveplugin by using the -t <archivename> switch. Verify that progress info is working.

Diff Detail

Repository
R36 Ark
Lint
Lint Skipped
Unit
Unit Tests Skipped
rthomsen created this revision.May 25 2019, 2:18 PM
Restricted Application added subscribers: Ark, kde-utils-devel. ยท View Herald TranscriptMay 25 2019, 2:18 PM
rthomsen requested review of this revision.May 25 2019, 2:18 PM
  • Is this the correct way to solve the problem?
  • Should this connection type be used for any of the other signals?

We should double check it, but it's possible that progress is the only signal "normally" emitted by an AddJob.
Btw I thought we were already using some Qt::DirectConnection elsewhere, but it seems we don't anymore.

I also tried to add

connect(archiveInterface(), &ReadOnlyArchiveInterface::progress, this, &CreateJob::onProgress);

at the beginning of CreateJob::doWork(), without direct connection, but this only fixes the progress for libzip :/

I also tried to add

connect(archiveInterface(), &ReadOnlyArchiveInterface::progress, this, &CreateJob::onProgress);

at the beginning of CreateJob::doWork(), without direct connection, but this only fixes the progress for libzip :/

I checked your solution and it fixes both plugins for me. Please check again.

I'm not sure what is going on to be honest. What do you think is the more correct solution?

I'm not sure what is going on to be honest. What do you think is the more correct solution?

I don't like either, to be honest, as they are both workarounds. The actual problem is that CreateJob starts two different threads, with two "nested" event loops.

This is wrong and should be fixed on master. For 19.04 I submitted D21686 as temporary fix...

rthomsen abandoned this revision.Jun 9 2019, 10:07 AM

See task T11049.