added size column

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-11-02 12:18:24 +02:00
parent f8bb1a872a
commit 3cbc63bb9f
11 changed files with 78 additions and 40 deletions

View File

@ -89,6 +89,13 @@ std::pair<int, bool> Resource::compare(const Resource& other, SortType type) con
if (dateTimeChanged() < other.dateTimeChanged())
return { -1, type == SortType::DATE };
break;
case SortType::SIZE: {
if (fileinfo().size() > other.fileinfo().size())
return { 1, type == SortType::SIZE };
if (fileinfo().size() < other.fileinfo().size())
return { -1, type == SortType::SIZE };
break;
}
}
return { 0, false };