if (getSizeRole) {
data.insert("count", count);
- if (size != -1) {
- data.insert("size", QVariant::fromValue(size));
- }
+ data.insert("size", QVariant::fromValue(size));
}
if (getIsExpandableRole) {
data.insert("isExpandable", count > 0);
// Iterate over a const copy because items are deleted within the loop
const auto changedItems = m_changedItems;
- for (const KFileItem item : changedItems) {
+ for (const KFileItem &item : changedItems) {
const int index = m_model->index(item);
if (index < 0) {
data = rolesData(item);
}
- if (QIcon::hasThemeIcon(item.iconName())) {
+ if (!item.iconName().isEmpty()) {
data.insert("iconName", item.iconName());
}
const bool getIsExpandableRole = m_roles.contains("isExpandable");
if ((getSizeRole || getIsExpandableRole) && item.isDir()) {
- if (item.isLocalFile() && !item.isSlow()) {
+ if (item.isLocalFile()) {
// Tell m_directoryContentsCounter that we want to count the items
// inside the directory. The result will be received in slotDirectoryContentsCountReceived.
if (m_scanDirectories) {