[KFileItem] Don't read directory comment on slow mounts
ClosedPublic

Authored by broulik on Aug 8 2018, 10:35 AM.

Details

Summary

Doing so might block the UI. We don't do it for .desktop files, so also don't it for folders.

Test Plan

No longer have freezes when hovering a folder on a slow sshfs connection in Dolphon
A less invasive variant than D13757

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Aug 8 2018, 10:35 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 8 2018, 10:35 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Aug 8 2018, 10:35 AM

Even isSlow() causes blockage as that does KFileSystemType::fileSystemType which then blocks in statfs64 :( (this patch still makes sense imho)

dfaure added inline comments.Aug 9 2018, 7:50 AM
src/core/kfileitem.cpp
816

Shouldn't you check isSlow() at the end of the condition, or at least after isDir()? This way it wouldn't be checked for non-directories (you say it takes time...).

anthonyfieroni added inline comments.
src/core/kfileitem.cpp
816

+1, at end will be better.

broulik updated this revision to Diff 39348.Aug 9 2018, 11:44 AM
  • Move check

isDirectoryMounted creates a QFileInfo on the url anyway, so both are prone to block, doesn't really matter which way round, does it?

dfaure accepted this revision.Aug 9 2018, 12:12 PM

Yep, exactly.

This revision is now accepted and ready to land.Aug 9 2018, 12:12 PM
This revision was automatically updated to reflect the committed changes.