Don't special case file URLs when processing .desktop files
ClosedPublic

Authored by davidedmundson on Aug 25 2017, 9:41 AM.

Details

Summary

At first glance this looks faster, as we skip KIO for a simple stat(),
but as the result isn't cached we do file lookups on every single mouse
move.

This also has the side effect of not blocking Plasma when stat-ing a
file on a disconnected remote drive.

CCBUG: 379994

Test Plan

Created two .desktop files one pointing to a dir, another to a file.
One had the arrow to expand the folder, the other did not.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Aug 25 2017, 9:41 AM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 25 2017, 9:41 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Cool.

(as a future step I think the m_isDirCache look-up should all be done in isDir(). Currently it is used in data() but places like lessThan() use isDir() directly, bypassing the cache. And then some other places just read the IsDir role on the model ..)

hein accepted this revision.Aug 26 2017, 8:46 AM
This revision is now accepted and ready to land.Aug 26 2017, 8:46 AM
This revision was automatically updated to reflect the committed changes.