mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
KFileItemModelRolesUpdater: test isSlow in startDirectorySizeCounting
NO_CHANGELOG
This commit is contained in:
parent
bd40f21a0a
commit
47e4c64e6a
|
@ -1214,8 +1214,9 @@ void KFileItemModelRolesUpdater::applySortRole(int index)
|
||||||
}
|
}
|
||||||
|
|
||||||
data.insert("type", item.mimeComment());
|
data.insert("type", item.mimeComment());
|
||||||
} else if (m_model->sortRole() == "size" && item.isLocalFile() && !item.isSlow() && item.isDir()) {
|
} else if (m_model->sortRole() == "size" && item.isLocalFile() && item.isDir()) {
|
||||||
startDirectorySizeCounting(item, index);
|
startDirectorySizeCounting(item, index);
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Probably the sort role is a baloo role - just determine all roles.
|
// Probably the sort role is a baloo role - just determine all roles.
|
||||||
data = rolesData(item, index);
|
data = rolesData(item, index);
|
||||||
|
@ -1277,6 +1278,10 @@ bool KFileItemModelRolesUpdater::applyResolvedRoles(int index, ResolveHint hint)
|
||||||
|
|
||||||
void KFileItemModelRolesUpdater::startDirectorySizeCounting(const KFileItem &item, int index)
|
void KFileItemModelRolesUpdater::startDirectorySizeCounting(const KFileItem &item, int index)
|
||||||
{
|
{
|
||||||
|
if (item.isSlow()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Tell m_directoryContentsCounter that we want to count the items
|
// Tell m_directoryContentsCounter that we want to count the items
|
||||||
// inside the directory. The result will be received in slotDirectoryContentsCountReceived.
|
// inside the directory. The result will be received in slotDirectoryContentsCountReceived.
|
||||||
if (m_scanDirectories && item.isLocalFile()) {
|
if (m_scanDirectories && item.isLocalFile()) {
|
||||||
|
@ -1294,7 +1299,7 @@ QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileIte
|
||||||
const bool getSizeRole = m_roles.contains("size");
|
const bool getSizeRole = m_roles.contains("size");
|
||||||
const bool getIsExpandableRole = m_roles.contains("isExpandable");
|
const bool getIsExpandableRole = m_roles.contains("isExpandable");
|
||||||
|
|
||||||
if ((getSizeRole || getIsExpandableRole) && !item.isSlow() && item.isDir()) {
|
if ((getSizeRole || getIsExpandableRole) && item.isDir()) {
|
||||||
startDirectorySizeCounting(item, index);
|
startDirectorySizeCounting(item, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue