┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodelrolesupdater.h
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2014-01-06 20:10:08 +0100
committerFrank Reininghaus <[email protected]>2014-01-06 20:10:08 +0100
commit24ad08714e80fab29b4679c0c50e3616f2b5db54 (patch)
treea782d97cdc05eff73c39518b76e8b8a8e916273b /src/kitemviews/kfileitemmodelrolesupdater.h
parent4ddc3cfdde7a52f5880928f7cc8ee8896ded686d (diff)
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
Diffstat (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h')
-rw-r--r--src/kitemviews/kfileitemmodelrolesupdater.h2
1 files changed, 1 insertions, 1 deletions
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<QByteArray, QVariant> rolesData(const KFileItem& item);
/**