]> cloud.milkyroute.net Git - dolphin.git/commit
Improve performance for creating previews
authorPeter Penz <peter.penz19@gmail.com>
Tue, 2 Aug 2011 17:47:06 +0000 (19:47 +0200)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 2 Aug 2011 17:54:39 +0000 (19:54 +0200)
commit8ea76d0a0e67fbf03de5c2a10a77077b8fe51c08
tree5e5f29a5bd07a099b4893f8ea3cc334790d9dd06
parent94f3320444b9243bf52e4578ca9043fa690c5e4c
Improve performance for creating previews

The overall time for creating previews is faster the more items
are passed to KIO::previewJob() in parallel instead of passing
e.g. only 100 items once and start several KIO::previewJobs
sequentially.

However in the worst case KIO::previewJob() might
block the application for several seconds if the
MIME-type of the passed KFileItems are unknown and e.g. 10000 items
are forwarded.

So KFileItemModelRolesUpdater will now take care to resolve as many
MIME-types as possible until a timeout is reached and will only pass
those items to KIO::previewJob().

For huge image folders, where the MIME-type can be determined very
fast, this means that the overall time for creating previews will
decrease without blocking the application. For "worst case" directories
where resolving the MIME-type can get very expensive this approach
assures no blocking of the user-interface although the overall time
until all previews are generated might slightly increase.
src/kitemviews/kfileitemmodelrolesupdater.cpp
src/kitemviews/kfileitemmodelrolesupdater.h