]> cloud.milkyroute.net Git - dolphin.git/commit
Avoid calling KFileItemModel::index() in KFileItemModelRolesUpdater
authorFrank Reininghaus <frank78ac@googlemail.com>
Mon, 6 Jan 2014 19:10:08 +0000 (20:10 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Mon, 6 Jan 2014 19:10:08 +0000 (20:10 +0100)
commit24ad08714e80fab29b4679c0c50e3616f2b5db54
treea782d97cdc05eff73c39518b76e8b8a8e916273b
parent4ddc3cfdde7a52f5880928f7cc8ee8896ded686d
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.cpp
src/kitemviews/kfileitemmodelrolesupdater.h