From 8ea76d0a0e67fbf03de5c2a10a77077b8fe51c08 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 2 Aug 2011 19:47:06 +0200 Subject: 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.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h') diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h index 4931f9d64..3b173567e 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.h +++ b/src/kitemviews/kfileitemmodelrolesupdater.h @@ -137,7 +137,6 @@ private: KFileItemList sortedItems(const QSet& items) const; - static KFileItemList itemSubSet(const QSet& items, int count); static int subDirectoriesCount(const QString& path); private: -- cgit v1.3.1