mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
Fixed empty files being erroneously grouped together with folders in "By size" grouping
This commit is contained in:
parent
e5e824f876
commit
b500c27e11
|
@ -2513,8 +2513,6 @@ KFileItemModel::ItemGroupInfo KFileItemModel::nameRoleGroup(const ItemData *item
|
||||||
|
|
||||||
KFileItemModel::ItemGroupInfo KFileItemModel::sizeRoleGroup(const ItemData *itemData, bool withString) const
|
KFileItemModel::ItemGroupInfo KFileItemModel::sizeRoleGroup(const ItemData *itemData, bool withString) const
|
||||||
{
|
{
|
||||||
static ItemGroupInfo oldGroupInfo;
|
|
||||||
static KIO::filesize_t oldFileSize;
|
|
||||||
ItemGroupInfo groupInfo;
|
ItemGroupInfo groupInfo;
|
||||||
KIO::filesize_t fileSize;
|
KIO::filesize_t fileSize;
|
||||||
|
|
||||||
|
@ -2529,9 +2527,6 @@ KFileItemModel::ItemGroupInfo KFileItemModel::sizeRoleGroup(const ItemData *item
|
||||||
fileSize = itemData->values.value("size").toULongLong();
|
fileSize = itemData->values.value("size").toULongLong();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fileSize == oldFileSize) {
|
|
||||||
return oldGroupInfo;
|
|
||||||
}
|
|
||||||
if (groupInfo.comparable < 0) {
|
if (groupInfo.comparable < 0) {
|
||||||
if (fileSize < 5 * 1024 * 1024) { // < 5 MB
|
if (fileSize < 5 * 1024 * 1024) { // < 5 MB
|
||||||
groupInfo.comparable = 1; // Small
|
groupInfo.comparable = 1; // Small
|
||||||
|
@ -2546,8 +2541,6 @@ KFileItemModel::ItemGroupInfo KFileItemModel::sizeRoleGroup(const ItemData *item
|
||||||
char const *groupNames[] = {"Folders", "Small", "Medium", "Big"};
|
char const *groupNames[] = {"Folders", "Small", "Medium", "Big"};
|
||||||
groupInfo.text = i18nc("@title:group Size", groupNames[groupInfo.comparable]);
|
groupInfo.text = i18nc("@title:group Size", groupNames[groupInfo.comparable]);
|
||||||
}
|
}
|
||||||
oldFileSize = fileSize;
|
|
||||||
oldGroupInfo = groupInfo;
|
|
||||||
return groupInfo;
|
return groupInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user