From 24ad08714e80fab29b4679c0c50e3616f2b5db54 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 6 Jan 2014 20:10:08 +0100 Subject: Avoid calling KFileItemModel::index() in KFileItemModelRolesUpdater KFileItemModel allows to find out the index of a KFileItem with its index(const KFileItem&) method. Calling this method is not extremely expensive, but it's also not free (it looks up the URL of the KFileItem in a QHash, i.e., it has to call qHash(QString) for the full URL). In KFileItemModelRolesUpdater, we sometimes converted the known index to a KFileItem and then back to an index in applyResolvedRoles(KFileItem). This patch fixes this by modifying applyResolvedRoles such that it takes the index directly as its argument. REVIEW: 114847 --- src/kitemviews/kfileitemmodelrolesupdater.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h') diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h index fced44a85..19207575e 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.h +++ b/src/kitemviews/kfileitemmodelrolesupdater.h @@ -261,7 +261,7 @@ private: ResolveFast, ResolveAll }; - bool applyResolvedRoles(const KFileItem& item, ResolveHint hint); + bool applyResolvedRoles(int index, ResolveHint hint); QHash rolesData(const KFileItem& item); /** -- cgit v1.3.1