Make calls to resolveNextPendingRoles and resolveNextSortRole delayed

This prevents that functions that call these indirectly call themselves
recursively and cause trouble.

BUG: 320791
This commit is contained in:
Frank Reininghaus 2013-06-06 08:49:12 +02:00
parent e7a9d5590b
commit f114564523

View file

@ -898,12 +898,12 @@ void KFileItemModelRolesUpdater::startUpdating()
startPreviewJob(itemsToResolve);
// Determine the icons asynchronously as fast as possible.
resolveNextPendingRoles();
QTimer::singleShot(0, this, SLOT(resolveNextPendingRoles()));
} else {
m_pendingIndexes = indexes;
// Trigger the asynchronous resolving of all roles.
m_state = ResolvingAllRoles;
resolveNextPendingRoles();
QTimer::singleShot(0, this, SLOT(resolveNextPendingRoles()));
}
}
@ -1002,7 +1002,7 @@ void KFileItemModelRolesUpdater::updateChangedItems()
// asynchronous determination of the sort role.
killPreviewJob();
m_state = ResolvingSortRole;
resolveNextSortRole();
QTimer::singleShot(0, this, SLOT(resolveNextSortRole()));
}
return;
@ -1050,7 +1050,7 @@ void KFileItemModelRolesUpdater::updateChangedItems()
if (!resolvingInProgress) {
// Trigger the asynchronous resolving of the changed roles.
m_state = ResolvingAllRoles;
resolveNextPendingRoles();
QTimer::singleShot(0, this, SLOT(resolveNextPendingRoles()));
}
}
}