Process entries while listing archives
ClosedPublic

Authored by rthomsen on Oct 5 2016, 6:46 PM.

Details

Summary

Currently, when listing archives Ark waits until the LoadJob is done to process the entries. This causes a lag (>7 seconds for large archives on fast systems) after the LoadJob has completed until the ArchiveView is ready.

This diff causes ArchiveModel to start processing entries while the LoadJob is running. This results in the view being ready <1 second after LoadJob completes.

To avoid the view showing a partially loaded archive while LoadJob runs, we set the model of the view to Q_NULLPTR and in Part::slotLoadingFinished() set it to m_model again.

Test Plan
  1. Open a large archive.
  2. Check that there is no long delay after LoadJob completes until the view is ready.

Diff Detail

Repository
R36 Ark
Lint
Lint Skipped
Unit
Unit Tests Skipped
rthomsen updated this revision to Diff 7122.Oct 5 2016, 6:46 PM
rthomsen retitled this revision from to Process entries while listing 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 TranscriptOct 5 2016, 6:46 PM
elvisangelaccio requested changes to this revision.Oct 5 2016, 7:40 PM
elvisangelaccio edited edge metadata.

It seems something like this:

if (behaviour == NotifyViews) {
    beginInsertColumns(QModelIndex(), 0, toInsert.size() - 1);
}
m_showColumns << toInsert;
if (behaviour == NotifyViews) {
    endInsertColumns();
}

in Part::slotNewEntry() does the same job, instead of setting a null model in the view.

This revision now requires changes to proceed.Oct 5 2016, 7:40 PM
elvisangelaccio added inline comments.Oct 5 2016, 7:42 PM
part/archivemodel.cpp
601 ↗(On Diff #7122)

The flag here should be change to DoNotNotifyViews

elvisangelaccio added inline comments.Oct 6 2016, 1:38 PM
part/archivemodel.cpp
601 ↗(On Diff #7122)

Actually, we can drop the InsertBehavior enum, since we don't use it.
There are also a beginInsertRow() that should be removed in parentFor() (this is why we were seeing entries with the firefox tarball).

rthomsen updated this revision to Diff 7162.Oct 6 2016, 4:22 PM
rthomsen edited edge metadata.

Use a more clean approach to disable updating of the ArchiveView while loading an archive. Unfortunately, we need tobe able to specify DoNotNotifyView for AddJobs. Otherwise, the view doesn't get updated when adding files.

elvisangelaccio accepted this revision.Oct 6 2016, 6:12 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
part/archivemodel.h
131

What about calling this slotListEntry(), since it's only used when listing an archive?

This revision is now accepted and ready to land.Oct 6 2016, 6:12 PM
This revision was automatically updated to reflect the committed changes.